53 [[nodiscard]] std::string
type()
const override;
56 [[nodiscard]]
static std::string
category();
63 [[nodiscard]]
json save()
const override;
87 [[nodiscard]] std::shared_ptr<const NodeData>
pollImuObs(
size_t pinIdx,
bool peek);
93 [[nodiscard]] std::shared_ptr<const NodeData>
pollPosVelAtt(
size_t pinIdx,
bool peek);
321 [[nodiscard]] Eigen::Vector3d
n_calcVelocity(
double time,
const Eigen::Quaterniond& n_Quat_e)
const;
330 const Eigen::Vector3d& lla_position,
const Eigen::Vector3d& n_velocity)
const;
337 [[nodiscard]] Eigen::Vector3d
n_calcOmega_nb(
double time,
const Eigen::Vector3d& rollPitchYaw,
const Eigen::Quaterniond& n_Quat_b)
const;
nlohmann::json json
json namespace
Different Gravity Models.
The class is responsible for all time-related tasks.
Widget to modify time point values.
std::vector< CsvElement > CsvLine
CSV Line with splitted entries.
gui::widgets::PositionWithFrame _startPosition
double _roseSimDuration
Simulation duration needed for the rose figure.
CubicSpline< long double > pitch
Pitch angle [rad].
void restore(const json &j) override
Restores the node from a json object.
ImuSimulator()
Default constructor.
void deinitialize() override
Deinitialize the node.
double sampleInterval
Spline sample interval.
TrajectoryType
Types of Trajectories available for simulation.
@ Linear
Linear movement with constant velocity.
@ Fixed
Static position without movement.
@ COUNT
Amount of items in the enum.
@ Csv
Get the input from the CsvData pin.
@ RoseFigure
Movement along a mathmatical rose figure.
std::shared_ptr< const NodeData > pollPosVelAtt(size_t pinIdx, bool peek)
Polls the next simulated data.
uint64_t _imuInternalUpdateCnt
Counter to calculate the internal IMU update time.
ImuSimulator(ImuSimulator &&)=delete
Move constructor.
double _trajectoryRotationAngle
In the GUI selected origin angle of the circular trajectory in [rad].
CubicSpline< long double > yaw
Yaw angle [rad].
CubicSpline< long double > roll
Roll angle [rad].
StartTimeSource
Types where the start time should be pulled from.
@ CurrentComputerTime
Gets the current computer time as start time.
@ CustomTime
Custom time selected by the user.
Eigen::Vector3d _lla_imuLastLinearPosition
Last calculated position for the IMU in linear mode for iterative calculations as latitude,...
double _circularHarmonicAmplitudeFactor
Harmonic Oscillation Amplitude Factor of the circle radius [-].
static constexpr size_t OUTPUT_PORT_INDEX_POS_VEL_ATT
Flow (PosVelAtt)
Direction _trajectoryDirection
In the GUI selected direction of the circular trajectory (used by circular and rose figure)
CubicSpline< long double > z
ECEF Z Position [m].
double _imuInternalFrequency
Frequency to calculate the delta IMU values in [Hz].
double _csvDuration
Duration from the CSV file in [s].
double _gnssLastUpdateTime
Last time the GNSS message was calculated in [s].
json save() const override
Saves the node into a json object.
~ImuSimulator() override
Destructor.
std::optional< Eigen::Quaterniond > n_getAttitudeQuaternionFromCsvLine_b(const CsvData::CsvLine &line, const std::vector< std::string > &description) const
Get the Attitude quaternion n_quat_b from a CSV line.
int _circularHarmonicFrequency
Harmonic Oscillation Frequency on the circular trajectory [cycles/revolution].
int _rosePetNum
In the GUI selected numerator of petals (2*k for even k, k for uneven k) of the rose figure.
static constexpr size_t OUTPUT_PORT_INDEX_IMU_OBS
Flow (ImuObs)
ImuSimulator(const ImuSimulator &)=delete
Copy constructor.
gui::widgets::TimeEditFormat _startTimeEditFormat
Time Format to input the start time with.
InsTime _startTime
Global starttime.
double _linearTrajectoryDistanceForStop
Distance in [m] to the start position to stop the simulation.
static std::string category()
String representation of the Class Category.
Eigen::Vector3d n_calcVelocity(double time, const Eigen::Quaterniond &n_Quat_e) const
Calculates the velocity in local-navigation frame coordinates at the given time depending on the traj...
std::optional< Eigen::Vector3d > e_getPositionFromCsvLine(const CsvData::CsvLine &line, const std::vector< std::string > &description) const
Get the Position from a CSV line.
bool _angularRateEarthRotationEnabled
Apply the Earth rotation rate to the measured angular rates.
double _imuLastUpdateTime
Last time the IMU message was calculated in [s].
double _trajectoryVerticalSpeed
Vertical speed of the vehicle in the tangential plane in [m/s] (used by circular and rose figure)
static std::string typeStatic()
String representation of the Class Type.
int _rosePetDenom
In the GUI selected denominator of petals (2*k for even k, k for uneven k) of the rose figure.
static constexpr size_t INPUT_PORT_INDEX_CSV
Object (CsvData)
TrajectoryType _trajectoryType
Selected trajectory type in the GUI.
Direction
Possible directions for the circular trajectory.
double _roseTrajectoryCountForStop
Amount of rose figures to simulate before stopping.
double _roseStepLengthMax
Maxmimum step length for the spline points for the rose figure [m]. Points will be spaced between [L/...
void guiConfig() override
ImGui config window which is shown on double click.
CubicSpline< long double > y
ECEF Y Position [m].
bool _centrifgalAccelerationEnabled
Apply the centrifugal acceleration to the measured accelerations.
double _simulationDuration
Duration to simulate in [s].
bool resetNode() override
Resets the node. Moves the read cursor to the start.
StopCondition
Possible stop conditions for the simulation.
@ DistanceOrCirclesOrRoses
Distance for Linear trajectory / Circle count for Circular / Count for rose figure trajectory.
std::array< double, 3 > calcFlightAngles(double time) const
Calculates the flight angles (roll, pitch, yaw)
bool initializeSplines()
Initializes the spline values.
double _circularTrajectoryCircleCountForStop
Amount of circles to simulate before stopping.
std::shared_ptr< const NodeData > pollImuObs(size_t pinIdx, bool peek)
Polls the next simulated data.
Eigen::Vector3d _n_linearTrajectoryStartVelocity
Start Velocity of the vehicle in local-navigation frame cooridnates in [m/s].
uint64_t _imuUpdateCnt
Counter to calculate the IMU update time.
Eigen::Vector3d n_calcOmega_nb(double time, const Eigen::Vector3d &rollPitchYaw, const Eigen::Quaterniond &n_Quat_b) const
Calculates ω_nb_n, the turn rate of the body with respect to the navigation system expressed in NED c...
Eigen::Vector3d lla_calcPosition(double time) const
Calculates the position in latLonAlt at the given time depending on the trajectoryType.
bool _angularRateTransportRateEnabled
Apply the transport rate to the measured angular rates.
static const char * to_string(TrajectoryType value)
Converts the enum to a string.
std::string type() const override
String representation of the Class Type.
struct NAV::ImuSimulator::@112323040341172005327360071040367216370163224314 _splines
Assign a variable that holds the Spline information.
GravitationModel _gravitationModel
Gravitation model selected in the GUI.
ImuSimulator & operator=(const ImuSimulator &)=delete
Copy assignment operator.
bool checkStopCondition(double time, const Eigen::Vector3d &lla_position)
Checks the selected stop condition.
uint64_t _gnssUpdateCnt
Counter to calculate the GNSS update time.
static constexpr double INTERNAL_LINEAR_UPDATE_FREQUENCY
Update rate for the internal solution of linear movement in [Hz].
Eigen::Vector3d _lla_gnssLastLinearPosition
Last calculated position for the GNSS in linear mode for iterative calculations as latitude,...
StopCondition _simulationStopCondition
Condition which has to be met to stop the simulation.
ImuSimulator & operator=(ImuSimulator &&)=delete
Move assignment operator.
double _trajectoryRadius
In the GUI selected radius of the circular trajectory (used by circular and rose figure)
StartTimeSource _startTimeSource
Source for the start time, selected in the GUI.
Eigen::Vector3d _p_lastImuAccelerationMeas
Last calculated acceleration measurement in platform coordinates [m/s²].
double _trajectoryHorizontalSpeed
Horizontal speed of the vehicle in the tangential plane in [m/s] (used by circular and rose figure)
bool _coriolisAccelerationEnabled
Apply the coriolis acceleration to the measured accelerations.
Eigen::Vector3d _p_lastImuAngularRateMeas
Last calculated angular rate measurement in platform coordinates [rad/s].
Eigen::Vector3d n_calcTrajectoryAccel(double time, const Eigen::Quaterniond &n_Quat_e, const Eigen::Vector3d &lla_position, const Eigen::Vector3d &n_velocity) const
Calculates the acceleration in local-navigation frame coordinates at the given time depending on the ...
bool initialize() override
Initialize the node.
std::optional< InsTime > getTimeFromCsvLine(const CsvData::CsvLine &line, const std::vector< std::string > &description) const
Get the Time from a CSV line.
CubicSpline< long double > x
ECEF X Position [m].
double _gnssFrequency
Frequency to sample the position with in [Hz].
double _imuFrequency
Frequency to sample the IMU with in [Hz].
Eigen::Vector3d _fixedTrajectoryStartOrientation
Orientation of the vehicle [roll, pitch, yaw] [rad].
Imu(const Imu &)=delete
Copy constructor.
The class is responsible for all time-related tasks.
GravitationModel
Available Gravitation Models.
@ EGM96
Earth Gravitational Model 1996.