18#include "Navigation/Transformations/Units.hpp"
29 [[nodiscard]]
static std::string
type()
36 [[nodiscard]] std::string
getType()
const override {
return type(); }
52 desc.emplace_back(
"Roll [deg]");
53 desc.emplace_back(
"Pitch [deg]");
54 desc.emplace_back(
"Yaw [deg]");
55 desc.emplace_back(
"Roll StdDev [deg]");
56 desc.emplace_back(
"Pitch StdDev [deg]");
57 desc.emplace_back(
"Yaw StdDev [deg]");
58 desc.emplace_back(
"n_Quat_b x");
59 desc.emplace_back(
"n_Quat_b y");
60 desc.emplace_back(
"n_Quat_b z");
61 desc.emplace_back(
"n_Quat_b w");
62 desc.emplace_back(
"n_Quat_b x StdDev");
63 desc.emplace_back(
"n_Quat_b y StdDev");
64 desc.emplace_back(
"n_Quat_b z StdDev");
65 desc.emplace_back(
"n_Quat_b w StdDev");
81 [[nodiscard]] std::optional<double>
getValueAt(
size_t idx)
const override
100 return rad2deg(std::sqrt(covRPY(0, 0)));
107 return rad2deg(std::sqrt(covRPY(1, 1)));
114 return rad2deg(std::sqrt(covRPY(2, 2)));
151 [[nodiscard]]
bool setValueAt(
size_t idx,
double value)
override
176 [[nodiscard]]
const Eigen::Quaterniond&
n_Quat_b()
const
190 [[nodiscard]]
const Eigen::Quaterniond&
e_Quat_b()
const
235 template<
typename Derived>
244 template<
typename Derived>
255 template<
typename DerivedP,
typename DerivedV,
typename DerivedA>
267 template<
typename DerivedP,
typename DerivedV,
typename DerivedA>
280 template<
typename DerivedP,
typename DerivedV,
typename DerivedA,
typename Derived>
282 const Eigen::QuaternionBase<DerivedA>&
e_Quat_b,
const Eigen::MatrixBase<Derived>& e_covarianceMatrix)
295 template<
typename DerivedP,
typename DerivedV,
typename DerivedA,
typename Derived>
297 const Eigen::QuaternionBase<DerivedA>&
n_Quat_b,
const Eigen::MatrixBase<Derived>& n_covarianceMatrix)
308 template<
typename Derived>
311 INS_ASSERT_USER_ERROR(e_covarianceMatrix.rows() == 10,
"This function needs a 10x10 matrix as input");
312 INS_ASSERT_USER_ERROR(e_covarianceMatrix.cols() == 10,
"This function needs a 10x10 matrix as input");
317 Eigen::Quaterniond n_q_e =
n_Quat_e();
318 Eigen::Matrix<double, 10, 10> J = Eigen::Matrix<double, 10, 10>::Zero();
319 J.block<3, 3>(0, 0) = n_q_e.toRotationMatrix();
320 J.block<3, 3>(3, 3) = n_q_e.toRotationMatrix();
330 template<
typename Derived>
333 INS_ASSERT_USER_ERROR(n_covarianceMatrix.rows() == 10,
"This function needs a 10x10 matrix as input");
334 INS_ASSERT_USER_ERROR(n_covarianceMatrix.cols() == 10,
"This function needs a 10x10 matrix as input");
339 Eigen::Quaterniond e_q_n =
e_Quat_n();
340 Eigen::Matrix<double, 10, 10> J = Eigen::Matrix<double, 10, 10>::Zero();
341 J.block<3, 3>(0, 0) = e_q_n.toRotationMatrix();
342 J.block<3, 3>(3, 3) = e_q_n.toRotationMatrix();
#define INS_ASSERT(_EXPR)
Assert function wrapper.
Definition Assert.h:19
#define INS_ASSERT_USER_ERROR(_EXP, _MSG)
Assert function with message.
Definition Assert.h:21
Transformation collection.
Eigen::Matrix3< typename Derived::Scalar > covQuat2RPY(const Eigen::MatrixBase< Derived > &covQuat, const Eigen::QuaternionBase< DerivedQ > &n_quat_b)
Converts a covariance for an attitude represented in quaternion form into a covariance for Euler ange...
Definition CoordinateFrames.hpp:241
Eigen::Matrix< typename Derived::Scalar, 4, 4 > covQuat2QuatJacobian(const Eigen::QuaternionBase< Derived > &beta_quat_alpha)
Calculates the Jacobian to convert an attitude represented in quaternions from one frame into another...
Definition CoordinateFrames.hpp:250
Eigen::Vector3< typename Derived::Scalar > quat2eulerZYX(const Eigen::QuaternionBase< Derived > &q)
Converts the quaternion to Euler rotation angles with rotation sequence ZYX.
Definition CoordinateFrames.hpp:141
constexpr std::array< StateKeyType, 4 > Att
All attitude keys.
Definition MotionModel.hpp:62
@ AttQ0
w: Real (scalar) part of the Quaternion
Definition MotionModel.hpp:50
@ 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
constexpr std::array< StateKeyType, 10 > PosVelAtt
Vector with all position velocity and attitude keys.
Definition MotionModel.hpp:70
Position and Velocity Storage Class.
Position, Velocity and Attitude Storage Class.
Definition PosVelAtt.hpp:25
Eigen::Quaterniond b_Quat_n() const
Returns the Quaternion from navigation to body frame (NED)
Definition PosVelAtt.hpp:183
size_t staticDescriptorCount() const override
Get the amount of descriptors.
Definition PosVelAtt.hpp:76
std::vector< std::string > staticDataDescriptors() const override
Returns a vector of data descriptors.
Definition PosVelAtt.hpp:73
void setAttitude_e_Quat_b(const Eigen::QuaternionBase< Derived > &e_Quat_b)
Set the Quaternion from body to earth frame.
Definition PosVelAtt.hpp:236
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition PosVelAtt.hpp:48
void setPosVelAttCovarianceMatrix_e(const Eigen::MatrixBase< Derived > &e_covarianceMatrix)
Set the Covariance matrix in ECEF coordinates.
Definition PosVelAtt.hpp:309
std::optional< Eigen::Vector4d > e_QuatStdev() const
Returns the standard deviation of the Quaternion body to earth frame (x, y, z, w)
Definition PosVelAtt.hpp:210
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition PosVelAtt.hpp:70
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition PosVelAtt.hpp:81
void setPosVelAttAndCov_e(const Eigen::MatrixBase< DerivedP > &e_position, const Eigen::MatrixBase< DerivedV > &e_velocity, const Eigen::QuaternionBase< DerivedA > &e_Quat_b, const Eigen::MatrixBase< Derived > &e_covarianceMatrix)
Set the position, velocity, attitude and the covariance matrix.
Definition PosVelAtt.hpp:281
Eigen::Quaterniond _n_Quat_b
Quaternion body to navigation frame (roll, pitch, yaw)
Definition PosVelAtt.hpp:357
void setAttitude_n_Quat_b(const Eigen::QuaternionBase< Derived > &n_Quat_b)
Set the Quaternion from body to navigation frame.
Definition PosVelAtt.hpp:245
void setPosVelAtt_n(const Eigen::MatrixBase< DerivedP > &lla_position, const Eigen::MatrixBase< DerivedV > &n_velocity, const Eigen::QuaternionBase< DerivedA > &n_Quat_b)
Set the position, velocity and attitude.
Definition PosVelAtt.hpp:268
void setPosVelAttAndCov_n(const Eigen::MatrixBase< DerivedP > &lla_position, const Eigen::MatrixBase< DerivedV > &n_velocity, const Eigen::QuaternionBase< DerivedA > &n_Quat_b, const Eigen::MatrixBase< Derived > &n_covarianceMatrix)
Set the position, velocity, attitude and the covariance matrix.
Definition PosVelAtt.hpp:296
const Eigen::Quaterniond & n_Quat_b() const
Returns the Quaternion from body to navigation frame (NED)
Definition PosVelAtt.hpp:176
bool setValueAt(size_t idx, double value) override
Set the value at the index.
Definition PosVelAtt.hpp:151
static std::string type()
Returns the type of the data class.
Definition PosVelAtt.hpp:29
void setPosVelAttCovarianceMatrix_n(const Eigen::MatrixBase< Derived > &n_covarianceMatrix)
Set the Covariance matrix in NED coordinates.
Definition PosVelAtt.hpp:331
Eigen::Quaterniond b_Quat_e() const
Returns the Quaternion from Earth-fixed to body frame.
Definition PosVelAtt.hpp:197
void setPosVelAtt_e(const Eigen::MatrixBase< DerivedP > &e_position, const Eigen::MatrixBase< DerivedV > &e_velocity, const Eigen::QuaternionBase< DerivedA > &e_Quat_b)
Set the position, velocity and attitude.
Definition PosVelAtt.hpp:256
Eigen::Quaterniond _e_Quat_b
Quaternion body to earth frame.
Definition PosVelAtt.hpp:355
Eigen::Vector3d rollPitchYaw() const
Returns the Roll, Pitch and Yaw angles in [rad].
Definition PosVelAtt.hpp:204
std::string getType() const override
Returns the type of the data class.
Definition PosVelAtt.hpp:36
const Eigen::Quaterniond & e_Quat_b() const
Returns the Quaternion from body to Earth-fixed frame.
Definition PosVelAtt.hpp:190
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition PosVelAtt.hpp:40
std::optional< Eigen::Vector4d > n_QuatStdev() const
Returns the standard deviation of the Quaternion body to navigation frame (roll, pitch,...
Definition PosVelAtt.hpp:220
Position and Velocity Storage Class.
Definition PosVel.hpp:23
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition PosVel.hpp:73
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition PosVel.hpp:38
const Eigen::Vector3d & n_velocity() const
Returns the velocity in [m/s], in navigation coordinates.
Definition PosVel.hpp:211
bool setValueAt(size_t idx, double value) override
Set the value at the index.
Definition PosVel.hpp:150
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition PosVel.hpp:46
static std::string type()
Returns the type of the data class.
Definition PosVel.hpp:27
const Eigen::Vector3d & e_velocity() const
Returns the velocity in [m/s], in earth coordinates.
Definition PosVel.hpp:208
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition PosVel.hpp:84
void setVelocity_n(const Eigen::MatrixBase< Derived > &n_velocity)
Set the Velocity in the NED frame.
Definition PosVel.hpp:249
void setVelocity_e(const Eigen::MatrixBase< Derived > &e_velocity)
Set the Velocity in the earth frame.
Definition PosVel.hpp:240
Eigen::Quaterniond e_Quat_n() const
Returns the Quaternion from navigation to Earth-fixed frame.
Definition Pos.hpp:220
std::optional< KeyedMatrixXd< Keys::MotionModelKey, Keys::MotionModelKey > > _e_covarianceMatrix
Covariance matrix in ECEF coordinates.
Definition Pos.hpp:361
std::optional< KeyedMatrixXd< Keys::MotionModelKey, Keys::MotionModelKey > > _n_covarianceMatrix
Covariance matrix in local navigation coordinates.
Definition Pos.hpp:364
Eigen::Quaterniond n_Quat_e() const
Returns the Quaternion from Earth-fixed frame to navigation.
Definition Pos.hpp:227
const Eigen::Vector3d & e_position() const
Returns the coordinates in [m].
Definition Pos.hpp:249
void setPosition_e(const Eigen::MatrixBase< Derived > &e_position)
Set the Position in coordinates.
Definition Pos.hpp:284
const Eigen::Vector3d & lla_position() const
Returns the latitude 𝜙, longitude λ and altitude (height above ground) in [rad, rad,...
Definition Pos.hpp:237
void setPosition_lla(const Eigen::MatrixBase< Derived > &lla_position)
Set the Position lla object.
Definition Pos.hpp:293
KeyedMatrixX< double, RowKeyType, ColKeyType > KeyedMatrixXd
Dynamic size KeyedMatrix with double types.
Definition KeyedMatrix.hpp:2313