55template<
typename StateKeyType>
58template<
typename StateKeyType>
61template<
typename StateKeyType>
65template<
typename StateKeyType>
69template<
typename StateKeyType>
77template<
typename StateKeyType>
94 template<
typename Scalar,
int Size>
100 F.template block<3>(
Pos,
Vel) = Eigen::Matrix3d::Identity();
114 template<
typename Scalar,
int Size>
121 const double& latitude,
122 const double& longitude,
159 updatePhiAndQ(Phi, Q, G, F, W, dt, latitude, longitude, algorithm);
169 bool ShowGui(
float itemWidth,
float unitWidth,
const char*
id)
171 bool changed =
false;
181 "%.2e", ImGuiInputTextFlags_CharsScientific))
189 "- 1 {} for a pedestrian or ship,\n"
190 "- {} {} for a car, and\n"
191 "- {} {} for a military aircraft.\n"
192 "The vertical acceleration PSD is usually smaller.",
220 Eigen::Matrix3d a_S_n = Eigen::DiagonalMatrix<double, 3>(
_covarianceAccel[0],
226 double dt2 = std::pow(dt, 2);
227 double dt3 = dt2 * dt;
232 Q.template block<3>(
Pos,
Pos) = dt3 / 3.0 * a_S_e;
233 Q.template block<3>(
Pos,
Vel) = dt2 / 2.0 * a_S_e;
234 Q.template block<3>(
Vel,
Pos) = Q.template block<3>(
Pos,
Vel).transpose();
235 Q.template block<3>(
Vel,
Vel) = dt * a_S_e;
265 if (j.contains(
"covarianceAccel")) { j.at(
"covarianceAccel").get_to(data.
_gui_covarianceAccel); }
277#ifndef DOXYGEN_IGNORE
281struct fmt::formatter<NAV::Keys::MotionModelKey> : fmt::formatter<const char*>
287 template<
typename FormatContext>
290 using namespace NAV::Keys;
295 return fmt::formatter<const char*>::format(
"PosX", ctx);
297 return fmt::formatter<const char*>::format(
"PosY", ctx);
299 return fmt::formatter<const char*>::format(
"PosZ", ctx);
301 return fmt::formatter<const char*>::format(
"VelX", ctx);
303 return fmt::formatter<const char*>::format(
"VelY", ctx);
305 return fmt::formatter<const char*>::format(
"VelZ", ctx);
307 return fmt::formatter<const char*>::format(
"AttQ1", ctx);
309 return fmt::formatter<const char*>::format(
"AttQ2", ctx);
311 return fmt::formatter<const char*>::format(
"AttQ3", ctx);
313 return fmt::formatter<const char*>::format(
"AttQ0", ctx);
315 return fmt::formatter<const char*>::format(
"MotionModelKey_COUNT", ctx);
318 return fmt::formatter<const char*>::format(
"ERROR", ctx);
Transformation collection.
Eigen::Quaternion< Scalar > e_Quat_n(const Scalar &latitude, const Scalar &longitude)
Quaternion for rotations from navigation to Earth-fixed frame.
Definition CoordinateFrames.hpp:305
Eigen::Quaternion< Scalar > n_Quat_e(const Scalar &latitude, const Scalar &longitude)
Quaternion for rotations from Earth-fixed to navigation frame.
Definition CoordinateFrames.hpp:320
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
double convertUnit(const double &value, Units::PositionUncertaintyUnits unit)
Converts the value depending on the unit provided.
Units used by the system model parameters.
CovarianceAccelUnits
Possible Units for the Standard deviation of the acceleration due to user motion.
Definition Units.hpp:29
@ m_sqrts3
[ m / √(s^3) ]
Definition Units.hpp:31
Text Help Marker (?) with Tooltip.
void HelpMarker(const char *desc, const char *symbol="(?)")
Text Help Marker, e.g. '(?)', with Tooltip.
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
Definition Logger.hpp:67
Generalized Kalman Filter class.
Derived::PlainObject transitionMatrix_Phi_Taylor(const Eigen::MatrixBase< Derived > &F, double tau_s, size_t order)
Calculates the state transition matrix 𝚽 limited to specified order in 𝐅𝜏ₛ
Definition KalmanFilter.hpp:195
std::ostream & operator<<(std::ostream &os, const NAV::Keys::MotionModelKey &obj)
Stream insertion operator overload.
constexpr std::array< StateKeyType, 4 > Att
All attitude keys.
Definition MotionModel.hpp:62
constexpr std::array< StateKeyType, 3 > Pos
All position keys.
Definition MotionModel.hpp:56
MotionModelKey
Keys used in the model.
Definition MotionModel.hpp:40
@ PosY
Position ECEF_Y [m].
Definition MotionModel.hpp:42
@ VelZ
Velocity ECEF_Z [m/s].
Definition MotionModel.hpp:46
@ VelY
Velocity ECEF_Y [m/s].
Definition MotionModel.hpp:45
@ VelX
Velocity ECEF_X [m/s].
Definition MotionModel.hpp:44
@ AttQ0
w: Real (scalar) part of the Quaternion
Definition MotionModel.hpp:50
@ PosX
Position ECEF_X [m].
Definition MotionModel.hpp:41
@ AttQ3
z: Coefficient of k
Definition MotionModel.hpp:49
@ AttQ1
x: Coefficient of i
Definition MotionModel.hpp:47
@ AttQ2
y: Coefficient of j
Definition MotionModel.hpp:48
@ PosZ
Position ECEF_Z [m].
Definition MotionModel.hpp:43
@ MotionModelKey_COUNT
Count.
Definition MotionModel.hpp:51
constexpr std::array< StateKeyType, 10 > PosVelAtt
Vector with all position velocity and attitude keys.
Definition MotionModel.hpp:70
constexpr std::array< StateKeyType, 6 > PosVel
Vector with all position and velocity keys.
Definition MotionModel.hpp:66
constexpr std::array< StateKeyType, 3 > Vel
All velocity keys.
Definition MotionModel.hpp:59
SystemModelCalcAlgorithm
Algorithms to calculate the system model with.
Definition SystemModel.hpp:23
@ VanLoan
Van-Loan.
Definition SystemModel.hpp:24
Van Loan Method loan1978.
std::pair< typename DerivedF::PlainObject, typename DerivedF::PlainObject > calcPhiAndQWithVanLoanMethod(const Eigen::MatrixBase< DerivedF > &F, const Eigen::MatrixBase< DerivedG > &G, const Eigen::MatrixBase< DerivedW > &W, double dt)
Numerical Method to calculate the State transition matrix 𝚽 and System/Process noise covariance matri...
Definition VanLoan.hpp:65
Static sized KeyedMatrix.
Definition KeyedMatrix.hpp:1921
Motion System Model.
Definition MotionModel.hpp:79
friend void to_json(json &j, const MotionModel &data)
Converts the provided data into a json object.
Definition MotionModel.hpp:252
const std::array< StateKeyType, 6 > & PosVel
All position and velocity keys.
Definition MotionModel.hpp:209
void updatePhiAndQ(KeyedMatrix< Scalar, StateKeyType, StateKeyType, Size, Size > &Phi, KeyedMatrix< Scalar, StateKeyType, StateKeyType, Size, Size > &Q, KeyedMatrix< Scalar, StateKeyType, StateKeyType, Size, Size > &G, const KeyedMatrix< Scalar, StateKeyType, StateKeyType, Size, Size > &F, const KeyedMatrix< Scalar, StateKeyType, StateKeyType, Size, Size > &W, double dt, const double &latitude, const double &longitude, SystemModelCalcAlgorithm algorithm)
Updates the provided Phi, Q and G matrix.
Definition MotionModel.hpp:115
std::array< double, 2 > _covarianceAccel
Covariance of the acceleration 𝜎_a due to user motion in horizontal and vertical component [m²/s³].
Definition MotionModel.hpp:247
std::array< double, 2 > _gui_covarianceAccel
GUI selection for the Standard deviation of the acceleration 𝜎_a due to user motion in horizontal and...
Definition MotionModel.hpp:244
void initialize()
Initializes the motion model.
Definition MotionModel.hpp:82
const std::array< StateKeyType, 3 > & Vel
All velocity keys.
Definition MotionModel.hpp:207
void initialize(KeyedMatrix< Scalar, StateKeyType, StateKeyType, Size, Size > &F, KeyedMatrix< Scalar, StateKeyType, StateKeyType, Size, Size > &W)
Initializes the motion model.
Definition MotionModel.hpp:95
bool ShowGui(float itemWidth, float unitWidth, const char *id)
Shows a GUI.
Definition MotionModel.hpp:169
Units::CovarianceAccelUnits _gui_covarianceAccelUnit
Gui selection for the Unit of the input covarianceAccel parameter for the StDev due to acceleration d...
Definition MotionModel.hpp:241
const std::array< StateKeyType, 3 > & Pos
All position keys.
Definition MotionModel.hpp:205
KeyedMatrix6d< StateKeyType > calcProcessNoiseMatrixTaylor(double dt, double latitude, double longitude) const
Calculates the process noise matrix Q.
Definition MotionModel.hpp:217
friend void from_json(const json &j, MotionModel &data)
Converts the provided json object into the data object.
Definition MotionModel.hpp:262
std::pair< KeyedMatrix6d< StateKeyType >, KeyedMatrix6d< StateKeyType > > calcPhiAndQ(double dt, const double &latitude, const double &longitude, SystemModelCalcAlgorithm algorithm)
Calculates the state transition matrix (𝚽) and the process noise covariance matrix (𝐐)
Definition MotionModel.hpp:150
Matrix which can be accessed by keys.
static const internal::all_t all
Used to request all rows or columns in KeyedMatrices.
Definition KeyedMatrix.hpp:1457
KeyedMatrix< double, RowKeyType, ColKeyType, 6, 6 > KeyedMatrix6d
Static 6x6 squared size KeyedMatrix with double types.
Definition KeyedMatrix.hpp:2338