0.3.0
Loading...
Searching...
No Matches
LooselyCoupledKF.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
14
15#pragma once
16
18
21
24
26
27namespace NAV
28{
30class LooselyCoupledKF : public Node
31{
32 public:
46 [[nodiscard]] static std::string typeStatic();
47
49 [[nodiscard]] std::string type() const override;
50
52 [[nodiscard]] static std::string category();
53
56 void guiConfig() override;
57
59 [[nodiscard]] json save() const override;
60
63 void restore(const json& j) override;
64
94
112
113 private:
114 constexpr static size_t INPUT_PORT_INDEX_IMU = 0;
115 constexpr static size_t INPUT_PORT_INDEX_GNSS = 1;
116 constexpr static size_t INPUT_PORT_INDEX_POS_VEL_ATT_INIT = 2;
117 constexpr static size_t OUTPUT_PORT_INDEX_SOLUTION = 0;
118
120 bool initialize() override;
121
123 void deinitialize() override;
124
128
132 void recvImuObservation(InputPin::NodeDataQueue& queue, size_t pinIdx);
133
138
142 void recvPosVelAttInit(InputPin::NodeDataQueue& queue, size_t pinIdx);
143
148 void looselyCoupledPrediction(const std::shared_ptr<const PosVelAtt>& inertialNavSol, double tau_i, const ImuPos& imuPos);
149
152 void looselyCoupledUpdate(const std::shared_ptr<const PosVel>& posVelObs);
153
156
161
163 std::shared_ptr<const ImuObs> _lastImuObs = nullptr;
164
166 std::array<double, 3> _initalRollPitchYaw{};
171
174
182 inline static const std::vector<KFStates> KFPos = { KFStates::PosLat, KFStates::PosLon, KFStates::PosAlt };
184 inline static const std::vector<KFStates> KFVel = { KFStates::VelN, KFStates::VelE, KFStates::VelD };
186 inline static const std::vector<KFStates> KFAtt = { KFStates::Roll, KFStates::Pitch, KFStates::Yaw };
188 inline static const std::vector<KFStates> KFAccBias = { KFStates::AccBiasX, KFStates::AccBiasY, KFStates::AccBiasZ };
190 inline static const std::vector<KFStates> KFGyrBias = { KFStates::GyrBiasX, KFStates::GyrBiasY, KFStates::GyrBiasZ };
191
195
199 inline static const std::vector<KFMeas> dPos = { KFMeas::dPosLat, KFMeas::dPosLon, KFMeas::dPosAlt };
201 inline static const std::vector<KFMeas> dVel = { KFMeas::dVelN, KFMeas::dVelE, KFMeas::dVelD };
202
205
206 // #########################################################################################################################################
207 // GUI settings
208 // #########################################################################################################################################
209
212
213 // ###########################################################################################################
214 // Parameters
215 // ###########################################################################################################
216
218 Eigen::Vector3d _b_leverArm_InsGnss{ 0.0, 0.0, 0.0 };
219
220 // ###########################################################################################################
221
223 enum class StdevAccelNoiseUnits : uint8_t
224 {
225 mg_sqrtHz,
227 };
230
233 Eigen::Vector3d _stdev_ra = 0.04 /* [mg/√(Hz)] */ * Eigen::Vector3d::Ones();
234
235 // ###########################################################################################################
236
238 enum class StdevGyroNoiseUnits : uint8_t
239 {
242 };
245
248 Eigen::Vector3d _stdev_rg = 5 /* [deg/hr/√(Hz)]^2 */ * Eigen::Vector3d::Ones();
249
250 // ###########################################################################################################
251
253 enum class StdevAccelBiasUnits : uint8_t
254 {
255 microg,
256 m_s2,
257 };
260
263 Eigen::Vector3d _stdev_bad = 10 /* [µg] */ * Eigen::Vector3d::Ones();
264
266 Eigen::Vector3d _tau_bad = 0.1 * Eigen::Vector3d::Ones();
267
268 // ###########################################################################################################
269
271 enum class StdevGyroBiasUnits : uint8_t
272 {
273 deg_h,
274 rad_s,
275 };
278
281 Eigen::Vector3d _stdev_bgd = 1 /* [°/h] */ * Eigen::Vector3d::Ones();
282
284 Eigen::Vector3d _tau_bgd = 0.1 * Eigen::Vector3d::Ones();
285
286 // ###########################################################################################################
287
289 enum class RandomProcess : uint8_t
290 {
291 // WhiteNoise, ///< White noise
292 // RandomConstant, ///< Random constant
293
294 RandomWalk,
296
297 // GaussMarkov2, ///< Gauss-Markov 2nd Order
298 // GaussMarkov3, ///< Gauss-Markov 3rd Order
299 };
300
305
306 // ###########################################################################################################
307
310 {
312 rad_rad_m,
313 meter2,
314 meter,
315 };
318
321 Eigen::Vector3d _gnssMeasurementUncertaintyPosition{ 0.3, 0.3, 0.3 * 3 };
322
325
326 // ###########################################################################################################
327
330 {
331 m2_s2,
332 m_s,
333 };
336
338 Eigen::Vector3d _gnssMeasurementUncertaintyVelocity{ 0.5, 0.5, 0.5 };
339
342
343 // ###########################################################################################################
344
346 enum class InitCovariancePositionUnit : uint8_t
347 {
349 rad_rad_m,
350 meter2,
351 meter,
352 };
355
357 Eigen::Vector3d _initCovariancePosition{ 100.0, 100.0, 100.0 };
358
359 // ###########################################################################################################
360
362 enum class InitCovarianceVelocityUnit : uint8_t
363 {
364 m2_s2,
365 m_s,
366 };
369
371 Eigen::Vector3d _initCovarianceVelocity{ 10.0, 10.0, 10.0 };
372
373 // ###########################################################################################################
374
377 {
378 rad2,
379 deg2,
380 rad,
381 deg,
382 };
385
387 Eigen::Vector3d _initCovarianceAttitudeAngles{ 10.0, 10.0, 10.0 };
388
389 // ###########################################################################################################
390
392 enum class InitCovarianceBiasAccelUnit : uint8_t
393 {
394 m2_s4,
395 m_s2,
396 };
399
401 Eigen::Vector3d _initCovarianceBiasAccel{ 1.0, 1.0, 1.0 };
402
403 // ###########################################################################################################
404
406 enum class InitCovarianceBiasGyroUnit : uint8_t
407 {
408 rad2_s2,
409 deg2_s2,
410 rad_s,
411 deg_s,
412 };
415
417 Eigen::Vector3d _initCovarianceBiasGyro{ 0.5, 0.5, 0.5 };
418
419 // ###########################################################################################################
420
422 enum class InitBiasAccelUnit : uint8_t
423 {
424 m_s2,
425 };
428
430 Eigen::Vector3d _initBiasAccel{ 0.0, 0.0, 0.0 };
431
432 // ###########################################################################################################
433
435 enum class InitBiasGyroUnit : uint8_t
436 {
437 rad_s,
438 deg_s,
439 };
442
444 Eigen::Vector3d _initBiasGyro{ 0.0, 0.0, 0.0 };
445
446 // ###########################################################################################################
447
449 enum class PhiCalculationAlgorithm : uint8_t
450 {
452 Taylor,
453 };
456
459
461 enum class QCalculationAlgorithm : uint8_t
462 {
463 VanLoan,
464 Taylor1,
465 };
468
469 // ###########################################################################################################
470 // Prediction
471 // ###########################################################################################################
472
473 // ###########################################################################################################
474 // System matrix 𝐅
475 // ###########################################################################################################
476
490 [[nodiscard]] KeyedMatrix<double, KFStates, KFStates, 15, 15> n_systemMatrix_F(const Eigen::Quaterniond& n_Quat_b,
491 const Eigen::Vector3d& b_specForce_ib,
492 const Eigen::Vector3d& n_omega_in,
493 const Eigen::Vector3d& n_velocity,
494 const Eigen::Vector3d& lla_position,
495 double R_N,
496 double R_E,
497 double g_0,
498 double r_eS_e,
499 const Eigen::Vector3d& tau_bad,
500 const Eigen::Vector3d& tau_bgd) const;
501
512 [[nodiscard]] KeyedMatrix<double, KFStates, KFStates, 15, 15> e_systemMatrix_F(const Eigen::Quaterniond& e_Quat_b,
513 const Eigen::Vector3d& b_specForce_ib,
514 const Eigen::Vector3d& e_position,
515 const Eigen::Vector3d& e_gravitation,
516 double r_eS_e,
517 const Eigen::Vector3d& e_omega_ie,
518 const Eigen::Vector3d& tau_bad,
519 const Eigen::Vector3d& tau_bgd) const;
520
521 // ###########################################################################################################
522 // Noise input matrix 𝐆 & Noise scale matrix 𝐖
523 // System noise covariance matrix 𝐐
524 // ###########################################################################################################
525
529 [[nodiscard]] static KeyedMatrix<double, KFStates, KFStates, 15, 15> noiseInputMatrix_G(const Eigen::Quaterniond& ien_Quat_b);
530
539 [[nodiscard]] Eigen::Matrix<double, 15, 15> noiseScaleMatrix_W(const Eigen::Vector3d& sigma_ra, const Eigen::Vector3d& sigma_rg,
540 const Eigen::Vector3d& sigma_bad, const Eigen::Vector3d& sigma_bgd,
541 const Eigen::Vector3d& tau_bad, const Eigen::Vector3d& tau_bgd);
542
555 [[nodiscard]] static KeyedMatrix<double, KFStates, KFStates, 15, 15> n_systemNoiseCovarianceMatrix_Q(const Eigen::Vector3d& sigma2_ra, const Eigen::Vector3d& sigma2_rg,
556 const Eigen::Vector3d& sigma2_bad, const Eigen::Vector3d& sigma2_bgd,
557 const Eigen::Vector3d& tau_bad, const Eigen::Vector3d& tau_bgd,
558 const Eigen::Matrix3d& n_F_21, const Eigen::Matrix3d& T_rn_p,
559 const Eigen::Matrix3d& n_Dcm_b, const double& tau_s);
560
572 [[nodiscard]] static KeyedMatrix<double, KFStates, KFStates, 15, 15> e_systemNoiseCovarianceMatrix_Q(const Eigen::Vector3d& sigma2_ra, const Eigen::Vector3d& sigma2_rg,
573 const Eigen::Vector3d& sigma2_bad, const Eigen::Vector3d& sigma2_bgd,
574 const Eigen::Vector3d& tau_bad, const Eigen::Vector3d& tau_bgd,
575 const Eigen::Matrix3d& e_F_21,
576 const Eigen::Matrix3d& e_Dcm_b, const double& tau_s);
577
578 // ###########################################################################################################
579 // Error covariance matrix P
580 // ###########################################################################################################
581
589 [[nodiscard]] KeyedMatrix<double, KFStates, KFStates, 15, 15> initialErrorCovarianceMatrix_P0(const Eigen::Vector3d& variance_angles,
590 const Eigen::Vector3d& variance_vel,
591 const Eigen::Vector3d& variance_pos,
592 const Eigen::Vector3d& variance_accelBias,
593 const Eigen::Vector3d& variance_gyroBias) const;
594
595 // ###########################################################################################################
596 // Correction
597 // ###########################################################################################################
598
606 [[nodiscard]] static KeyedMatrix<double, KFMeas, KFStates, 6, 15> n_measurementMatrix_H(const Eigen::Matrix3d& T_rn_p,
607 const Eigen::Matrix3d& n_Dcm_b,
608 const Eigen::Vector3d& b_omega_ib,
609 const Eigen::Vector3d& b_leverArm_InsGnss,
610 const Eigen::Matrix3d& n_Omega_ie);
611
618 [[nodiscard]] static KeyedMatrix<double, KFMeas, KFStates, 6, 15> e_measurementMatrix_H(const Eigen::Matrix3d& e_Dcm_b,
619 const Eigen::Vector3d& b_omega_ib,
620 const Eigen::Vector3d& b_leverArm_InsGnss,
621 const Eigen::Matrix3d& e_Omega_ie);
622
627 [[nodiscard]] static KeyedMatrix<double, KFMeas, KFMeas, 6, 6> n_measurementNoiseCovariance_R(const Eigen::Vector3d& gnssVarianceLatLonAlt,
628 const Eigen::Vector3d& gnssVarianceVelocity);
629
634 [[nodiscard]] static KeyedMatrix<double, KFMeas, KFMeas, 6, 6> e_measurementNoiseCovariance_R(const Eigen::Vector3d& gnssVariancePosition,
635 const Eigen::Vector3d& gnssVarianceVelocity);
636
648 [[nodiscard]] static KeyedVector<double, KFMeas, 6> n_measurementInnovation_dz(const Eigen::Vector3d& lla_positionMeasurement, const Eigen::Vector3d& lla_positionEstimate,
649 const Eigen::Vector3d& n_velocityMeasurement, const Eigen::Vector3d& n_velocityEstimate,
650 const Eigen::Matrix3d& T_rn_p, const Eigen::Quaterniond& n_Quat_b, const Eigen::Vector3d& b_leverArm_InsGnss,
651 const Eigen::Vector3d& b_omega_ib, const Eigen::Matrix3d& n_Omega_ie);
652
663 [[nodiscard]] static KeyedVector<double, KFMeas, 6> e_measurementInnovation_dz(const Eigen::Vector3d& e_positionMeasurement, const Eigen::Vector3d& e_positionEstimate,
664 const Eigen::Vector3d& e_velocityMeasurement, const Eigen::Vector3d& e_velocityEstimate,
665 const Eigen::Quaterniond& e_Quat_b, const Eigen::Vector3d& b_leverArm_InsGnss,
666 const Eigen::Vector3d& b_omega_ib, const Eigen::Matrix3d& e_Omega_ie);
667};
668
669} // namespace NAV
670
671#ifndef DOXYGEN_IGNORE
672
673template<>
674struct fmt::formatter<NAV::LooselyCoupledKF::KFStates> : fmt::formatter<const char*>
675{
680 template<typename FormatContext>
681 auto format(const NAV::LooselyCoupledKF::KFStates& st, FormatContext& ctx) const
682 {
683 switch (st)
684 {
686 return fmt::formatter<const char*>::format("Roll/Psi_eb_1", ctx);
688 return fmt::formatter<const char*>::format("Pitch/Psi_eb_2", ctx);
690 return fmt::formatter<const char*>::format("Yaw/Psi_eb_3", ctx);
692 return fmt::formatter<const char*>::format("VelN/VelX", ctx);
694 return fmt::formatter<const char*>::format("VelE/VelY", ctx);
696 return fmt::formatter<const char*>::format("VelD/VelZ", ctx);
698 return fmt::formatter<const char*>::format("PosLat/PosX", ctx);
700 return fmt::formatter<const char*>::format("PosLon/PosY", ctx);
702 return fmt::formatter<const char*>::format("PosAlt/PosZ", ctx);
704 return fmt::formatter<const char*>::format("AccBiasX", ctx);
706 return fmt::formatter<const char*>::format("AccBiasY", ctx);
708 return fmt::formatter<const char*>::format("AccBiasZ", ctx);
710 return fmt::formatter<const char*>::format("GyrBiasX", ctx);
712 return fmt::formatter<const char*>::format("GyrBiasY", ctx);
714 return fmt::formatter<const char*>::format("GyrBiasZ", ctx);
715 }
716
717 return fmt::formatter<const char*>::format("ERROR", ctx);
718 }
719};
720template<>
721struct fmt::formatter<NAV::LooselyCoupledKF::KFMeas> : fmt::formatter<const char*>
722{
727 template<typename FormatContext>
728 auto format(const NAV::LooselyCoupledKF::KFMeas& st, FormatContext& ctx) const
729 {
730 switch (st)
731 {
733 return fmt::formatter<const char*>::format("dPosLat/dPosX", ctx);
735 return fmt::formatter<const char*>::format("dPosLon/dPosY", ctx);
737 return fmt::formatter<const char*>::format("dPosAlt/dPosZ", ctx);
739 return fmt::formatter<const char*>::format("dVelN/dVelX", ctx);
741 return fmt::formatter<const char*>::format("dVelE/dVelY", ctx);
743 return fmt::formatter<const char*>::format("dVelD/dVelZ", ctx);
744 }
745
746 return fmt::formatter<const char*>::format("ERROR", ctx);
747 }
748};
749
750#endif
751
756std::ostream& operator<<(std::ostream& os, const NAV::LooselyCoupledKF::KFStates& obj);
757
762std::ostream& operator<<(std::ostream& os, const NAV::LooselyCoupledKF::KFMeas& obj);
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
Parent Class for all IMU Observations.
Inertial Measurement Integrator.
The class is responsible for all time-related tasks.
Kalman Filter with keyed states.
std::ostream & operator<<(std::ostream &os, const NAV::LooselyCoupledKF::KFStates &obj)
Stream insertion operator overload.
Node Class.
Position, Velocity and Attitude Storage Class.
IMU Position.
Definition ImuPos.hpp:26
Inertial Measurement Integrator.
Definition InertialIntegrator.hpp:37
The class is responsible for all time-related tasks.
Definition InsTime.hpp:668
Keyed Kalman Filter class.
Definition KeyedKalmanFilter.hpp:38
Static sized KeyedMatrix.
Definition KeyedMatrix.hpp:1910
Static sized KeyedVector.
Definition KeyedMatrix.hpp:1457
Loosely-coupled Kalman Filter for INS/GNSS integration.
Definition LooselyCoupledKF.hpp:31
static KeyedMatrix< double, KFStates, KFStates, 15, 15 > noiseInputMatrix_G(const Eigen::Quaterniond &ien_Quat_b)
Calculates the noise input matrix 𝐆
InitCovarianceVelocityUnit
Possible Units for the initial covariance for the velocity (standard deviation σ or Variance σ²)
Definition LooselyCoupledKF.hpp:363
KFStates
State Keys of the Kalman filter.
Definition LooselyCoupledKF.hpp:67
@ Pitch
Pitch.
Definition LooselyCoupledKF.hpp:69
@ VelY
ECEF Velocity Y.
Definition LooselyCoupledKF.hpp:88
@ GyrBiasX
Gyroscope Bias X.
Definition LooselyCoupledKF.hpp:80
@ PosLat
Latitude.
Definition LooselyCoupledKF.hpp:74
@ VelE
Velocity East.
Definition LooselyCoupledKF.hpp:72
@ Roll
Roll.
Definition LooselyCoupledKF.hpp:68
@ Psi_eb_3
Angle between Earth and Body frame around 3. axis.
Definition LooselyCoupledKF.hpp:86
@ AccBiasZ
Accelerometer Bias Z.
Definition LooselyCoupledKF.hpp:79
@ VelX
ECEF Velocity X.
Definition LooselyCoupledKF.hpp:87
@ PosAlt
Altitude.
Definition LooselyCoupledKF.hpp:76
@ GyrBiasZ
Gyroscope Bias Z.
Definition LooselyCoupledKF.hpp:82
@ GyrBiasY
Gyroscope Bias Y.
Definition LooselyCoupledKF.hpp:81
@ VelD
Velocity Down.
Definition LooselyCoupledKF.hpp:73
@ AccBiasX
Accelerometer Bias X.
Definition LooselyCoupledKF.hpp:77
@ VelN
Velocity North.
Definition LooselyCoupledKF.hpp:71
@ PosLon
Longitude.
Definition LooselyCoupledKF.hpp:75
@ VelZ
ECEF Velocity Z.
Definition LooselyCoupledKF.hpp:89
@ PosX
ECEF Position X.
Definition LooselyCoupledKF.hpp:90
@ Yaw
Yaw.
Definition LooselyCoupledKF.hpp:70
@ AccBiasY
Accelerometer Bias Y.
Definition LooselyCoupledKF.hpp:78
@ PosZ
ECEF Position Z.
Definition LooselyCoupledKF.hpp:92
@ PosY
ECEF Position Y.
Definition LooselyCoupledKF.hpp:91
@ Psi_eb_2
Angle between Earth and Body frame around 2. axis.
Definition LooselyCoupledKF.hpp:85
@ Psi_eb_1
Angle between Earth and Body frame around 1. axis.
Definition LooselyCoupledKF.hpp:84
StdevGyroNoiseUnits
Possible Units for the Standard deviation of the noise on the gyro angular-rate measurements.
Definition LooselyCoupledKF.hpp:239
RandomProcess _randomProcessAccel
Random Process used to estimate the accelerometer biases.
Definition LooselyCoupledKF.hpp:302
json save() const override
Saves the node into a json object.
InitBiasAccelUnit _initBiasAccelUnit
Gui selection for the unit of the initial accelerometer biases.
Definition LooselyCoupledKF.hpp:427
InitCovarianceVelocityUnit _initCovarianceVelocityUnit
Gui selection for the Unit of the initial covariance for the velocity.
Definition LooselyCoupledKF.hpp:368
bool _preferAccelerationOverDeltaMeasurements
Prefer the raw acceleration measurements over the deltaVel & deltaTheta values.
Definition LooselyCoupledKF.hpp:160
Eigen::Vector3d _initBiasAccel
GUI selection of the initial accelerometer biases.
Definition LooselyCoupledKF.hpp:430
InitCovarianceAttitudeAnglesUnit
Possible Units for the initial covariance for the attitude angles (standard deviation σ or Variance σ...
Definition LooselyCoupledKF.hpp:377
Eigen::Vector3d _gnssMeasurementUncertaintyVelocity
GUI selection of the GNSS NED velocity measurement uncertainty (standard deviation σ or Variance σ²)
Definition LooselyCoupledKF.hpp:338
LooselyCoupledKF & operator=(const LooselyCoupledKF &)=delete
Copy assignment operator.
PhiCalculationAlgorithm _phiCalculationAlgorithm
GUI option for the Phi calculation algorithm.
Definition LooselyCoupledKF.hpp:455
int _phiCalculationTaylorOrder
GUI option for the order of the Taylor polynom to calculate the Phi matrix.
Definition LooselyCoupledKF.hpp:458
StdevGyroNoiseUnits _stdevGyroNoiseUnits
Gui selection for the Unit of the input stdev_rg parameter.
Definition LooselyCoupledKF.hpp:244
Eigen::Vector3d _initCovariancePosition
GUI selection of the initial covariance diagonal values for position (standard deviation σ or Varianc...
Definition LooselyCoupledKF.hpp:357
Eigen::Matrix< double, 15, 15 > noiseScaleMatrix_W(const Eigen::Vector3d &sigma_ra, const Eigen::Vector3d &sigma_rg, const Eigen::Vector3d &sigma_bad, const Eigen::Vector3d &sigma_bgd, const Eigen::Vector3d &tau_bad, const Eigen::Vector3d &tau_bgd)
Calculates the noise scale matrix 𝐖
InitBiasGyroUnit
Possible Units for the initial gyroscope biases.
Definition LooselyCoupledKF.hpp:436
static const std::vector< KFMeas > dPos
All position difference keys.
Definition LooselyCoupledKF.hpp:199
Eigen::Vector3d _b_leverArm_InsGnss
Lever arm between INS and GNSS in [m, m, m].
Definition LooselyCoupledKF.hpp:218
static KeyedMatrix< double, KFMeas, KFMeas, 6, 6 > e_measurementNoiseCovariance_R(const Eigen::Vector3d &gnssVariancePosition, const Eigen::Vector3d &gnssVarianceVelocity)
Measurement noise covariance matrix 𝐑
static const std::vector< KFMeas > Meas
Vector with all measurement keys.
Definition LooselyCoupledKF.hpp:197
StdevGyroBiasUnits
Possible Units for the Variance of the accelerometer dynamic bias.
Definition LooselyCoupledKF.hpp:272
LooselyCoupledKF(const LooselyCoupledKF &)=delete
Copy constructor.
void recvImuObservation(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the IMU observation.
static const std::vector< KFStates > KFAccBias
All acceleration bias keys.
Definition LooselyCoupledKF.hpp:188
GnssMeasurementUncertaintyVelocityUnit _gnssMeasurementUncertaintyVelocityUnit
Gui selection for the Unit of the GNSS measurement uncertainty for the velocity.
Definition LooselyCoupledKF.hpp:335
void looselyCoupledUpdate(const std::shared_ptr< const PosVel > &posVelObs)
Updates the predicted state from the InertialNavSol with the PosVel observation.
Eigen::Vector3d _initCovarianceVelocity
GUI selection of the initial covariance diagonal values for velocity (standard deviation σ or Varianc...
Definition LooselyCoupledKF.hpp:371
StdevAccelBiasUnits
Possible Units for the Variance of the accelerometer dynamic bias.
Definition LooselyCoupledKF.hpp:254
Eigen::Vector3d _initCovarianceBiasGyro
GUI selection of the initial covariance diagonal values for gyroscope biases (standard deviation σ or...
Definition LooselyCoupledKF.hpp:417
LooselyCoupledKF & operator=(LooselyCoupledKF &&)=delete
Move assignment operator.
bool _gnssMeasurementUncertaintyPositionOverride
Whether to override the position uncertainty or use the one included in the measurement.
Definition LooselyCoupledKF.hpp:324
Eigen::Vector3d _gnssMeasurementUncertaintyPosition
GUI selection of the GNSS position measurement uncertainty (standard deviation σ or Variance σ²)....
Definition LooselyCoupledKF.hpp:321
static constexpr size_t INPUT_PORT_INDEX_POS_VEL_ATT_INIT
Flow (PosVelAtt)
Definition LooselyCoupledKF.hpp:116
~LooselyCoupledKF() override
Destructor.
QCalculationAlgorithm _qCalculationAlgorithm
GUI option for the Q calculation algorithm.
Definition LooselyCoupledKF.hpp:467
InitCovariancePositionUnit
Possible Units for the initial covariance for the position (standard deviation σ or Variance σ²)
Definition LooselyCoupledKF.hpp:347
@ meter
Standard deviation NED [m, m, m].
static const std::vector< KFStates > KFVel
All velocity keys.
Definition LooselyCoupledKF.hpp:184
bool _initializeStateOverExternalPin
Whether to initialize the state over an external pin.
Definition LooselyCoupledKF.hpp:168
Eigen::Vector3d _tau_bgd
Correlation length of the gyro dynamic bias in [s].
Definition LooselyCoupledKF.hpp:284
KeyedMatrix< double, KFStates, KFStates, 15, 15 > e_systemMatrix_F(const Eigen::Quaterniond &e_Quat_b, const Eigen::Vector3d &b_specForce_ib, const Eigen::Vector3d &e_position, const Eigen::Vector3d &e_gravitation, double r_eS_e, const Eigen::Vector3d &e_omega_ie, const Eigen::Vector3d &tau_bad, const Eigen::Vector3d &tau_bgd) const
Calculates the system matrix 𝐅 for the ECEF frame.
QCalculationAlgorithm
GUI option for the Q calculation algorithm.
Definition LooselyCoupledKF.hpp:462
static KeyedMatrix< double, KFMeas, KFStates, 6, 15 > e_measurementMatrix_H(const Eigen::Matrix3d &e_Dcm_b, const Eigen::Vector3d &b_omega_ib, const Eigen::Vector3d &b_leverArm_InsGnss, const Eigen::Matrix3d &e_Omega_ie)
Measurement matrix for GNSS measurements at timestep k, represented in Earth frame coordinates.
static KeyedMatrix< double, KFStates, KFStates, 15, 15 > n_systemNoiseCovarianceMatrix_Q(const Eigen::Vector3d &sigma2_ra, const Eigen::Vector3d &sigma2_rg, const Eigen::Vector3d &sigma2_bad, const Eigen::Vector3d &sigma2_bgd, const Eigen::Vector3d &tau_bad, const Eigen::Vector3d &tau_bgd, const Eigen::Matrix3d &n_F_21, const Eigen::Matrix3d &T_rn_p, const Eigen::Matrix3d &n_Dcm_b, const double &tau_s)
System noise covariance matrix 𝐐_{k-1}.
bool _checkKalmanMatricesRanks
Check the rank of the Kalman matrices every iteration (computational expensive)
Definition LooselyCoupledKF.hpp:211
GnssMeasurementUncertaintyPositionUnit _gnssMeasurementUncertaintyPositionUnit
Gui selection for the Unit of the GNSS measurement uncertainty for the position.
Definition LooselyCoupledKF.hpp:317
KeyedMatrix< double, KFStates, KFStates, 15, 15 > initialErrorCovarianceMatrix_P0(const Eigen::Vector3d &variance_angles, const Eigen::Vector3d &variance_vel, const Eigen::Vector3d &variance_pos, const Eigen::Vector3d &variance_accelBias, const Eigen::Vector3d &variance_gyroBias) const
Initial error covariance matrix P_0.
static KeyedMatrix< double, KFMeas, KFStates, 6, 15 > n_measurementMatrix_H(const Eigen::Matrix3d &T_rn_p, const Eigen::Matrix3d &n_Dcm_b, const Eigen::Vector3d &b_omega_ib, const Eigen::Vector3d &b_leverArm_InsGnss, const Eigen::Matrix3d &n_Omega_ie)
Measurement matrix for GNSS measurements at timestep k, represented in navigation coordinates.
static const std::vector< KFStates > KFAtt
All attitude keys.
Definition LooselyCoupledKF.hpp:186
KeyedKalmanFilterD< KFStates, KFMeas > _kalmanFilter
Kalman Filter representation.
Definition LooselyCoupledKF.hpp:204
InitBiasGyroUnit _initBiasGyroUnit
Gui selection for the unit of the initial gyroscope biases.
Definition LooselyCoupledKF.hpp:441
static const std::vector< KFMeas > dVel
All velocity difference keys.
Definition LooselyCoupledKF.hpp:201
LooselyCoupledKF(LooselyCoupledKF &&)=delete
Move constructor.
void updateExternalPvaInitPin()
Add or remove the external PVA Init pin.
void recvPosVelAttInit(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the PosVelAtt observation.
std::shared_ptr< const ImuObs > _lastImuObs
Last received IMU observation (to get ImuPos)
Definition LooselyCoupledKF.hpp:163
PhiCalculationAlgorithm
GUI option for the Phi calculation algorithm.
Definition LooselyCoupledKF.hpp:450
static const std::vector< KFStates > States
Vector with all state keys.
Definition LooselyCoupledKF.hpp:176
InitCovarianceBiasAccelUnit _initCovarianceBiasAccelUnit
Gui selection for the Unit of the initial covariance for the accelerometer biases.
Definition LooselyCoupledKF.hpp:398
InitCovariancePositionUnit _initCovariancePositionUnit
Gui selection for the Unit of the initial covariance for the position.
Definition LooselyCoupledKF.hpp:354
Eigen::Vector3d _stdev_rg
𝜎_rg Standard deviation of the noise on the gyro angular-rate measurements
Definition LooselyCoupledKF.hpp:248
InitCovarianceBiasGyroUnit
Possible Units for the initial covariance for the gyroscope biases (standard deviation σ or Variance ...
Definition LooselyCoupledKF.hpp:407
InsTime _externalInitTime
Time from the external init.
Definition LooselyCoupledKF.hpp:170
static constexpr size_t OUTPUT_PORT_INDEX_SOLUTION
Flow (InsGnssLCKFSolution)
Definition LooselyCoupledKF.hpp:117
static constexpr size_t INPUT_PORT_INDEX_IMU
Flow (ImuObs)
Definition LooselyCoupledKF.hpp:114
void deinitialize() override
Deinitialize the node.
static KeyedVector< double, KFMeas, 6 > n_measurementInnovation_dz(const Eigen::Vector3d &lla_positionMeasurement, const Eigen::Vector3d &lla_positionEstimate, const Eigen::Vector3d &n_velocityMeasurement, const Eigen::Vector3d &n_velocityEstimate, const Eigen::Matrix3d &T_rn_p, const Eigen::Quaterniond &n_Quat_b, const Eigen::Vector3d &b_leverArm_InsGnss, const Eigen::Vector3d &b_omega_ib, const Eigen::Matrix3d &n_Omega_ie)
Measurement innovation vector 𝜹𝐳
Eigen::Vector3d _stdev_bad
𝜎²_bad Variance of the accelerometer dynamic bias
Definition LooselyCoupledKF.hpp:263
StdevAccelBiasUnits _stdevAccelBiasUnits
Gui selection for the Unit of the input variance_bad parameter.
Definition LooselyCoupledKF.hpp:259
InertialIntegrator _inertialIntegrator
Inertial Integrator.
Definition LooselyCoupledKF.hpp:158
void restore(const json &j) override
Restores the node from a json object.
void invokeCallbackWithPosVelAtt(const PosVelAtt &posVelAtt)
Invoke the callback with a PosVelAtt solution (without LCKF specific output)
void looselyCoupledPrediction(const std::shared_ptr< const PosVelAtt > &inertialNavSol, double tau_i, const ImuPos &imuPos)
Predicts the state from the InertialNavSol.
static KeyedVector< double, KFMeas, 6 > e_measurementInnovation_dz(const Eigen::Vector3d &e_positionMeasurement, const Eigen::Vector3d &e_positionEstimate, const Eigen::Vector3d &e_velocityMeasurement, const Eigen::Vector3d &e_velocityEstimate, const Eigen::Quaterniond &e_Quat_b, const Eigen::Vector3d &b_leverArm_InsGnss, const Eigen::Vector3d &b_omega_ib, const Eigen::Matrix3d &e_Omega_ie)
Measurement innovation vector 𝜹𝐳
StdevGyroBiasUnits _stdevGyroBiasUnits
Gui selection for the Unit of the input variance_bad parameter.
Definition LooselyCoupledKF.hpp:277
KFMeas
Measurement Keys of the Kalman filter.
Definition LooselyCoupledKF.hpp:97
@ dPosLat
Latitude difference.
Definition LooselyCoupledKF.hpp:98
@ dPosLon
Longitude difference.
Definition LooselyCoupledKF.hpp:99
@ dPosY
ECEF Position Y difference.
Definition LooselyCoupledKF.hpp:106
@ dPosX
ECEF Position X difference.
Definition LooselyCoupledKF.hpp:105
@ dVelE
Velocity East difference.
Definition LooselyCoupledKF.hpp:102
@ dPosZ
ECEF Position Z difference.
Definition LooselyCoupledKF.hpp:107
@ dPosAlt
Altitude difference.
Definition LooselyCoupledKF.hpp:100
@ dVelN
Velocity North difference.
Definition LooselyCoupledKF.hpp:101
@ dVelZ
ECEF Velocity Z difference.
Definition LooselyCoupledKF.hpp:110
@ dVelX
ECEF Velocity X difference.
Definition LooselyCoupledKF.hpp:108
@ dVelY
ECEF Velocity Y difference.
Definition LooselyCoupledKF.hpp:109
@ dVelD
Velocity Down difference.
Definition LooselyCoupledKF.hpp:103
static const std::vector< KFStates > KFPosVel
All position and velocity keys.
Definition LooselyCoupledKF.hpp:193
InitBiasAccelUnit
Possible Units for the initial accelerometer biases.
Definition LooselyCoupledKF.hpp:423
InitCovarianceBiasAccelUnit
Possible Units for the initial covariance for the accelerometer biases (standard deviation σ or Varia...
Definition LooselyCoupledKF.hpp:393
static KeyedMatrix< double, KFMeas, KFMeas, 6, 6 > n_measurementNoiseCovariance_R(const Eigen::Vector3d &gnssVarianceLatLonAlt, const Eigen::Vector3d &gnssVarianceVelocity)
Measurement noise covariance matrix 𝐑
static std::string typeStatic()
String representation of the class type.
void recvPosVelObservation(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the PosVel observation.
bool _gnssMeasurementUncertaintyVelocityOverride
Whether to override the velocity uncertainty or use the one included in the measurement.
Definition LooselyCoupledKF.hpp:341
static const std::vector< KFStates > KFPos
All position keys.
Definition LooselyCoupledKF.hpp:182
static KeyedMatrix< double, KFStates, KFStates, 15, 15 > e_systemNoiseCovarianceMatrix_Q(const Eigen::Vector3d &sigma2_ra, const Eigen::Vector3d &sigma2_rg, const Eigen::Vector3d &sigma2_bad, const Eigen::Vector3d &sigma2_bgd, const Eigen::Vector3d &tau_bad, const Eigen::Vector3d &tau_bgd, const Eigen::Matrix3d &e_F_21, const Eigen::Matrix3d &e_Dcm_b, const double &tau_s)
System noise covariance matrix 𝐐_{k-1}.
Eigen::Vector3d _stdev_ra
𝜎_ra Standard deviation of the noise on the accelerometer specific-force measurements
Definition LooselyCoupledKF.hpp:233
Eigen::Vector3d _tau_bad
Correlation length of the accelerometer dynamic bias in [s].
Definition LooselyCoupledKF.hpp:266
InitCovarianceBiasGyroUnit _initCovarianceBiasGyroUnit
Gui selection for the Unit of the initial covariance for the gyroscope biases.
Definition LooselyCoupledKF.hpp:414
std::string type() const override
String representation of the class type.
static const std::vector< KFStates > KFGyrBias
All gyroscope bias keys.
Definition LooselyCoupledKF.hpp:190
GnssMeasurementUncertaintyPositionUnit
Possible Units for the GNSS measurement uncertainty for the position (standard deviation σ or Varianc...
Definition LooselyCoupledKF.hpp:310
@ rad_rad_m
Standard deviation LatLonAlt [rad, rad, m].
@ rad2_rad2_m2
Variance LatLonAlt^2 [rad^2, rad^2, m^2].
std::array< double, 3 > _initalRollPitchYaw
Roll, Pitch and Yaw angles in [deg] used for initialization if not taken from separate pin.
Definition LooselyCoupledKF.hpp:166
LooselyCoupledKF()
Default constructor.
static constexpr size_t INPUT_PORT_INDEX_GNSS
Flow (PosVel)
Definition LooselyCoupledKF.hpp:115
RandomProcess
Available Random processes.
Definition LooselyCoupledKF.hpp:290
@ GaussMarkov1
Gauss-Markov 1st Order.
KeyedMatrix< double, KFStates, KFStates, 15, 15 > n_systemMatrix_F(const Eigen::Quaterniond &n_Quat_b, const Eigen::Vector3d &b_specForce_ib, const Eigen::Vector3d &n_omega_in, const Eigen::Vector3d &n_velocity, const Eigen::Vector3d &lla_position, double R_N, double R_E, double g_0, double r_eS_e, const Eigen::Vector3d &tau_bad, const Eigen::Vector3d &tau_bgd) const
Calculates the system matrix 𝐅 for the local navigation frame.
bool _initialSensorBiasesApplied
Whether the accumulated biases have been initialized in the 'inertialIntegrator'.
Definition LooselyCoupledKF.hpp:173
RandomProcess _randomProcessGyro
Random Process used to estimate the gyroscope biases.
Definition LooselyCoupledKF.hpp:304
Eigen::Vector3d _initCovarianceBiasAccel
GUI selection of the initial covariance diagonal values for accelerometer biases (standard deviation ...
Definition LooselyCoupledKF.hpp:401
StdevAccelNoiseUnits _stdevAccelNoiseUnits
Gui selection for the Unit of the input stdev_ra parameter.
Definition LooselyCoupledKF.hpp:229
void guiConfig() override
ImGui config window which is shown on double click.
StdevAccelNoiseUnits
Possible Units for the Standard deviation of the noise on the accelerometer specific-force measuremen...
Definition LooselyCoupledKF.hpp:224
bool initialize() override
Initialize the node.
Eigen::Vector3d _initCovarianceAttitudeAngles
GUI selection of the initial covariance diagonal values for attitude angles (standard deviation σ or ...
Definition LooselyCoupledKF.hpp:387
GnssMeasurementUncertaintyVelocityUnit
Possible Units for the GNSS measurement uncertainty for the velocity (standard deviation σ or Varianc...
Definition LooselyCoupledKF.hpp:330
Eigen::Vector3d _stdev_bgd
𝜎²_bgd Variance of the gyro dynamic bias
Definition LooselyCoupledKF.hpp:281
static std::string category()
String representation of the class category.
Eigen::Vector3d _initBiasGyro
GUI selection of the initial gyroscope biases.
Definition LooselyCoupledKF.hpp:444
InitCovarianceAttitudeAnglesUnit _initCovarianceAttitudeAnglesUnit
Gui selection for the Unit of the initial covariance for the attitude angles.
Definition LooselyCoupledKF.hpp:384
Abstract parent class for all nodes.
Definition Node.hpp:86
Position, Velocity and Attitude Storage Class.
Definition PosVelAtt.hpp:25