17#include <Eigen/src/Core/Matrix.h>
27 [[nodiscard]]
static std::string
type()
46 desc.emplace_back(
"Velocity norm [m/s]");
47 desc.emplace_back(
"X velocity ECEF [m/s]");
48 desc.emplace_back(
"Y velocity ECEF [m/s]");
49 desc.emplace_back(
"Z velocity ECEF [m/s]");
50 desc.emplace_back(
"North velocity [m/s]");
51 desc.emplace_back(
"East velocity [m/s]");
52 desc.emplace_back(
"Down velocity [m/s]");
53 desc.emplace_back(
"X velocity ECEF StDev [m/s]");
54 desc.emplace_back(
"Y velocity ECEF StDev [m/s]");
55 desc.emplace_back(
"Z velocity ECEF StDev [m/s]");
56 desc.emplace_back(
"XY velocity StDev [m]");
57 desc.emplace_back(
"XZ velocity StDev [m]");
58 desc.emplace_back(
"YZ velocity StDev [m]");
59 desc.emplace_back(
"North velocity StDev [m/s]");
60 desc.emplace_back(
"East velocity StDev [m/s]");
61 desc.emplace_back(
"Down velocity StDev [m/s]");
62 desc.emplace_back(
"NE velocity StDev [m]");
63 desc.emplace_back(
"ND velocity StDev [m]");
64 desc.emplace_back(
"ED velocity StDev [m]");
80 [[nodiscard]] std::optional<double>
getValueAt(
size_t idx)
const override
193 [[nodiscard]]
const Eigen::Vector3d&
e_velocity()
const {
return _e_velocity; }
196 [[nodiscard]]
const Eigen::Vector3d&
n_velocity()
const {
return _n_velocity; }
199 [[nodiscard]] std::optional<std::reference_wrapper<const Eigen::Vector3d>>
e_velocityStdev()
const {
return _e_velocityStdev; }
202 [[nodiscard]] std::optional<std::reference_wrapper<const Eigen::Vector3d>>
n_velocityStdev()
const {
return _n_velocityStdev; }
205 [[nodiscard]] std::optional<std::reference_wrapper<const KeyedMatrixXd<States::StateKeys, States::StateKeys>>>
e_CovarianceMatrix()
const {
return _e_covarianceMatrix; }
208 [[nodiscard]] std::optional<std::reference_wrapper<const KeyedMatrixXd<States::StateKeys, States::StateKeys>>>
n_CovarianceMatrix()
const {
return _n_covarianceMatrix; }
236 _e_velocityStdev = e_velocityCovarianceMatrix.diagonal().cwiseSqrt();
237 _n_velocityStdev = (
n_Quat_e() * e_velocityCovarianceMatrix *
e_Quat_n()).diagonal().cwiseSqrt();
246 _n_velocityStdev = n_velocityCovarianceMatrix.diagonal().cwiseSqrt();
247 _e_velocityStdev = (
e_Quat_n() * n_velocityCovarianceMatrix *
n_Quat_e()).diagonal().cwiseSqrt();
253 template<
typename Derived>
262 _n_covarianceMatrix = _e_covarianceMatrix;
267 (*_n_covarianceMatrix)(all, all).setZero();
275 template<
typename Derived>
284 _e_covarianceMatrix = _n_covarianceMatrix;
289 (*_e_covarianceMatrix)(all, all).setZero();
300 Eigen::Vector3d _e_velocity{ std::nan(
""), std::nan(
""), std::nan(
"") };
302 Eigen::Vector3d _n_velocity{ std::nan(
""), std::nan(
""), std::nan(
"") };
305 std::optional<Eigen::Vector3d> _e_velocityStdev;
307 std::optional<Eigen::Vector3d> _n_velocityStdev;
310 std::optional<KeyedMatrixXd<States::StateKeys, States::StateKeys>> _e_covarianceMatrix;
313 std::optional<KeyedMatrixXd<States::StateKeys, States::StateKeys>> _n_covarianceMatrix;
#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
Dynamic sized KeyedMatrix.
Definition KeyedMatrix.hpp:2055
Position, Velocity and Attitude Storage Class.
Definition PosVel.hpp:23
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition PosVel.hpp:69
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition PosVel.hpp:34
void setVelocityAndStdDev_e(const Eigen::Vector3d &e_velocity, const Eigen::Matrix3d &e_velocityCovarianceMatrix)
Set the Velocity in ECEF coordinates and its standard deviation.
Definition PosVel.hpp:233
const Eigen::Vector3d & n_velocity() const
Returns the velocity in [m/s], in navigation coordinates.
Definition PosVel.hpp:196
std::optional< std::reference_wrapper< const Eigen::Vector3d > > e_velocityStdev() const
Returns the standard deviation of the velocity in [m/s], in earth coordinates.
Definition PosVel.hpp:199
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition PosVel.hpp:42
void setVelocity_e(const Eigen::Vector3d &e_velocity)
Set the Velocity in the earth frame.
Definition PosVel.hpp:216
std::vector< std::string > staticDataDescriptors() const override
Returns a vector of data descriptors.
Definition PosVel.hpp:72
static std::string type()
Returns the type of the data class.
Definition PosVel.hpp:27
std::optional< std::reference_wrapper< const Eigen::Vector3d > > n_velocityStdev() const
Returns the standard deviation of the velocity in [m/s], in navigation coordinates.
Definition PosVel.hpp:202
size_t staticDescriptorCount() const override
Get the amount of descriptors.
Definition PosVel.hpp:75
void setPosVelCovarianceMatrix_e(const Eigen::MatrixBase< Derived > &e_covarianceMatrix)
Set the Covariance matrix in ECEF coordinates.
Definition PosVel.hpp:254
std::optional< std::reference_wrapper< const KeyedMatrixXd< States::StateKeys, States::StateKeys > > > e_CovarianceMatrix() const
Returns the Covariance matrix in ECEF frame.
Definition PosVel.hpp:205
void setVelocity_n(const Eigen::Vector3d &n_velocity)
Set the Velocity in the NED frame.
Definition PosVel.hpp:224
const Eigen::Vector3d & e_velocity() const
Returns the velocity in [m/s], in earth coordinates.
Definition PosVel.hpp:193
std::optional< std::reference_wrapper< const KeyedMatrixXd< States::StateKeys, States::StateKeys > > > n_CovarianceMatrix() const
Returns the Covariance matrix in local navigation frame.
Definition PosVel.hpp:208
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition PosVel.hpp:80
void setVelocityAndStdDev_n(const Eigen::Vector3d &n_velocity, const Eigen::Matrix3d &n_velocityCovarianceMatrix)
Set the Velocity in NED coordinates and its standard deviation.
Definition PosVel.hpp:243
void setPosVelCovarianceMatrix_n(const Eigen::MatrixBase< Derived > &n_covarianceMatrix)
Set the Covariance matrix in NED coordinates.
Definition PosVel.hpp:276
Position, Velocity and Attitude Storage Class.
Definition Pos.hpp:29
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition Pos.hpp:84
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition Pos.hpp:46
const double & latitude() const
Returns the latitude 𝜙 in [rad].
Definition Pos.hpp:191
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition Pos.hpp:40
Eigen::Quaterniond e_Quat_n() const
Returns the Quaternion from navigation to Earth-fixed frame.
Definition Pos.hpp:153
static std::string type()
Returns the type of the data class.
Definition Pos.hpp:33
Eigen::Quaterniond n_Quat_e() const
Returns the Quaternion from Earth-fixed frame to navigation.
Definition Pos.hpp:160
const double & longitude() const
Returns the longitude λ in [rad].
Definition Pos.hpp:194
States.
Definition PosVel.hpp:168
StateKeys
State Keys.
Definition PosVel.hpp:174
@ States_COUNT
Count.
Definition PosVel.hpp:181
@ PosY
Position ECEF_Y [m].
Definition PosVel.hpp:176
@ PosZ
Position ECEF_Z [m].
Definition PosVel.hpp:177
@ PosX
Position ECEF_X [m].
Definition PosVel.hpp:175
@ VelY
Velocity ECEF_Y [m/s].
Definition PosVel.hpp:179
@ VelZ
Velocity ECEF_Z [m/s].
Definition PosVel.hpp:180
@ VelX
Velocity ECEF_X [m/s].
Definition PosVel.hpp:178
States()=delete
Constructor.
static const std::vector< StateKeys > PosVel
Vector with all position and velocity state keys.
Definition PosVel.hpp:188
static const std::vector< StateKeys > Vel
All velocity keys.
Definition PosVel.hpp:186
static const std::vector< StateKeys > Pos
All position keys.
Definition PosVel.hpp:184