53 [[nodiscard]] std::string
type()
const override;
73 using Scalar =
long double;
75 constexpr static size_t INPUT_PORT_INDEX_CSV = 0;
76 constexpr static size_t OUTPUT_PORT_INDEX_IMU_OBS = 0;
77 constexpr static size_t OUTPUT_PORT_INDEX_POS_VEL_ATT = 1;
80 bool initialize()
override;
83 void deinitialize()
override;
89 [[nodiscard]] std::shared_ptr<const NodeData> pollImuObs(
size_t pinIdx,
bool peek);
95 [[nodiscard]] std::shared_ptr<const NodeData> pollPosVelAtt(
size_t pinIdx,
bool peek);
101 bool checkStopCondition(Scalar time,
const Eigen::Vector3<Scalar>& lla_position);
106 enum class StartTimeSource
113 StartTimeSource _startTimeSource = StartTimeSource::CustomTime;
119 InsTime _startTime{ 2000, 1, 1, 0, 0, 0 };
124 double _imuInternalFrequency = 1000;
126 double _imuFrequency = 100;
128 double _gnssFrequency = 5;
133 enum class TrajectoryType
145 static const char* to_string(TrajectoryType value);
148 TrajectoryType _trajectoryType = TrajectoryType::Fixed;
154 gui::widgets::PositionWithFrame _startPosition;
157 Eigen::Vector3d _fixedTrajectoryStartOrientation = Eigen::Vector3d::Zero();
160 Eigen::Vector3d _n_linearTrajectoryStartVelocity = Eigen::Vector3d{ 1, 0, 0 };
163 int _circularHarmonicFrequency = 0;
166 double _circularHarmonicAmplitudeFactor = 0.1;
178 static const char* to_string(Direction value);
181 Direction _trajectoryDirection = Direction::CCW;
184 double _trajectoryRotationAngle = 0.0;
187 double _trajectoryHorizontalSpeed = 10.0;
190 double _trajectoryVerticalSpeed = 0.0;
193 double _trajectoryRadius = 50.0;
199 int _rosePetDenom = 1;
202 double _roseStepLengthMax = 0.1;
205 double _roseSimDuration = 0.0;
213 DistanceOrCirclesOrRoses,
217 StopCondition _simulationStopCondition = StopCondition::Duration;
220 double _simulationDuration = 5 * 60;
223 Scalar _csvDuration = 0;
226 double _linearTrajectoryDistanceForStop = 100;
229 double _circularTrajectoryCircleCountForStop = 1.0;
232 double _roseTrajectoryCountForStop = 1.0;
239 bool _coriolisAccelerationEnabled =
true;
242 bool _centrifgalAccelerationEnabled =
true;
245 bool _angularRateEarthRotationEnabled =
true;
248 bool _angularRateTransportRateEnabled =
true;
256 [[nodiscard]] InsTime getTimeFromCsvLine(
const CsvData::CsvLine& line,
const std::vector<std::string>& description)
const;
262 [[nodiscard]] Eigen::Vector3<Scalar> e_getPositionFromCsvLine(
const CsvData::CsvLine& line,
const std::vector<std::string>& description)
const;
268 static Eigen::Quaternion<Scalar> n_getAttitudeQuaternionFromCsvLine_b(
const CsvData::CsvLine& line,
const std::vector<std::string>& description);
284 bool initializeSplines();
287 uint64_t _imuInternalUpdateCnt = 0.0;
289 uint64_t _imuUpdateCnt = 0.0;
291 uint64_t _gnssUpdateCnt = 0.0;
294 static constexpr Scalar INTERNAL_LINEAR_UPDATE_FREQUENCY = 1000;
297 Scalar _imuLastUpdateTime = 0.0;
299 Scalar _gnssLastUpdateTime = 0.0;
301 Eigen::Vector3<Scalar> _lla_imuLastLinearPosition = Eigen::Vector3<Scalar>::Zero();
303 Eigen::Vector3<Scalar> _lla_gnssLastLinearPosition = Eigen::Vector3<Scalar>::Zero();
305 Eigen::Vector3<Scalar> _p_lastImuAccelerationMeas = Eigen::Vector3<Scalar>::Ones() * std::nan(
"");
307 Eigen::Vector3<Scalar> _p_lastImuAngularRateMeas = Eigen::Vector3<Scalar>::Ones() * std::nan(
"");
312 [[nodiscard]] std::array<Scalar, 3> calcFlightAngles(Scalar time)
const;
317 [[nodiscard]] Eigen::Vector3<Scalar> lla_calcPosition(Scalar time)
const;
323 [[nodiscard]] Eigen::Vector3<Scalar> n_calcVelocity(Scalar time,
const Eigen::Quaternion<Scalar>& n_Quat_e)
const;
331 [[nodiscard]] Eigen::Vector3<Scalar> n_calcTrajectoryAccel(Scalar time,
const Eigen::Quaternion<Scalar>& n_Quat_e,
332 const Eigen::Vector3<Scalar>& lla_position,
const Eigen::Vector3<Scalar>& n_velocity)
const;
339 [[nodiscard]] Eigen::Vector3<Scalar> n_calcOmega_nb(Scalar time,
const Eigen::Vector3<Scalar>& rollPitchYaw,
const Eigen::Quaternion<Scalar>& n_Quat_b)
const;