17#include "Navigation/Transformations/Units.hpp"
23#include <Eigen/src/Core/MatrixBase.h>
33 [[nodiscard]]
static std::string
type()
84 [[nodiscard]] std::optional<double>
getValueAt(
size_t idx)
const override
188 [[nodiscard]]
const Eigen::Vector3d&
lla_position()
const {
return _lla_position; }
200 [[nodiscard]]
const Eigen::Vector3d&
e_position()
const {
return _e_position; }
203 [[nodiscard]] std::optional<std::reference_wrapper<const Eigen::Vector3d>>
e_positionStdev()
const {
return _e_positionStdev; }
206 [[nodiscard]] std::optional<std::reference_wrapper<const Eigen::Vector3d>>
n_positionStdev()
const {
return _n_positionStdev; }
209 [[nodiscard]] std::optional<std::reference_wrapper<const KeyedMatrixXd<States::StateKeys, States::StateKeys>>>
e_CovarianceMatrix()
const {
return _e_covarianceMatrix; }
212 [[nodiscard]] std::optional<std::reference_wrapper<const KeyedMatrixXd<States::StateKeys, States::StateKeys>>>
n_CovarianceMatrix()
const {
return _n_covarianceMatrix; }
223 _lla_position = trafo::ecef2lla_WGS84(
e_position);
240 _e_positionStdev = e_positionCovarianceMatrix.diagonal().cwiseSqrt();
241 _n_positionStdev = (
n_Quat_e() * e_positionCovarianceMatrix *
e_Quat_n()).diagonal().cwiseSqrt();
250 _n_positionStdev = n_positionCovarianceMatrix.diagonal().cwiseSqrt();
251 _e_positionStdev = (
e_Quat_n() * n_positionCovarianceMatrix *
n_Quat_e()).diagonal().cwiseSqrt();
257 template<
typename Derived>
276 template<
typename Derived>
298 Eigen::Vector3d _e_position{ std::nan(
""), std::nan(
""), std::nan(
"") };
300 Eigen::Vector3d _lla_position{ std::nan(
""), std::nan(
""), std::nan(
"") };
303 std::optional<Eigen::Vector3d> _e_positionStdev;
305 std::optional<Eigen::Vector3d> _n_positionStdev;
308 std::optional<KeyedMatrixXd<States::StateKeys, States::StateKeys>> _e_covarianceMatrix;
311 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
Common logging variables like time into run and local positions.
Transformation collection.
static LocalPosition calcLocalPosition(const Eigen::Vector3d &lla_position)
Calculate the local position offset from a reference point.
Dynamic sized KeyedMatrix.
Definition KeyedMatrix.hpp:2055
Parent class for all data transmitted over Flow pins.
Definition NodeData.hpp:27
static std::string type()
Returns the type of the data class.
Definition NodeData.hpp:44
Position, Velocity and Attitude Storage Class.
Definition Pos.hpp:29
std::optional< std::reference_wrapper< const Eigen::Vector3d > > e_positionStdev() const
Returns the standard deviation of the position in ECEF frame coordinates in [m].
Definition Pos.hpp:203
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
void setPositionAndStdDev_e(const Eigen::Vector3d &e_position, const Eigen::Matrix3d &e_positionCovarianceMatrix)
Set the Position in ECEF coordinates and its standard deviation.
Definition Pos.hpp:237
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition Pos.hpp:73
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
std::optional< std::reference_wrapper< const KeyedMatrixXd< States::StateKeys, States::StateKeys > > > n_CovarianceMatrix() const
Returns the Covariance matrix in local navigation frame.
Definition Pos.hpp:212
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
void setPosCovarianceMatrix_n(const Eigen::MatrixBase< Derived > &n_covarianceMatrix)
Set the Covariance matrix in ECEF coordinates.
Definition Pos.hpp:277
std::optional< std::reference_wrapper< const KeyedMatrixXd< States::StateKeys, States::StateKeys > > > e_CovarianceMatrix() const
Returns the Covariance matrix in ECEF frame.
Definition Pos.hpp:209
void setPositionAndStdDev_lla(const Eigen::Vector3d &lla_position, const Eigen::Matrix3d &n_positionCovarianceMatrix)
Set the Position in LLA coordinates and its standard deviation.
Definition Pos.hpp:247
Eigen::Quaterniond n_Quat_e() const
Returns the Quaternion from Earth-fixed frame to navigation.
Definition Pos.hpp:160
const Eigen::Vector3d & e_position() const
Returns the coordinates in [m].
Definition Pos.hpp:200
const Eigen::Vector3d & lla_position() const
Returns the latitude 𝜙, longitude λ and altitude (height above ground) in [rad, rad,...
Definition Pos.hpp:188
size_t staticDescriptorCount() const override
Get the amount of descriptors.
Definition Pos.hpp:79
std::optional< std::reference_wrapper< const Eigen::Vector3d > > n_positionStdev() const
Returns the standard deviation of the position in local navigation frame coordinates in [m].
Definition Pos.hpp:206
void setPosition_e(const Eigen::Vector3d &e_position)
Set the Position in coordinates.
Definition Pos.hpp:220
void setPosition_lla(const Eigen::Vector3d &lla_position)
Set the Position lla object.
Definition Pos.hpp:228
const double & altitude() const
Returns the altitude (height above ground) in [m].
Definition Pos.hpp:197
std::vector< std::string > staticDataDescriptors() const override
Returns a vector of data descriptors.
Definition Pos.hpp:76
const double & longitude() const
Returns the longitude λ in [rad].
Definition Pos.hpp:194
void setPosCovarianceMatrix_e(const Eigen::MatrixBase< Derived > &e_covarianceMatrix)
Set the Covariance matrix in ECEF coordinates.
Definition Pos.hpp:258
double northSouth
North/South deviation from the reference point [m].
Definition CommonLog.hpp:50
double eastWest
East/West deviation from the reference point [m].
Definition CommonLog.hpp:51
States.
Definition Pos.hpp:171
static const std::vector< StateKeys > Pos
All position keys.
Definition Pos.hpp:184
StateKeys
State Keys.
Definition Pos.hpp:177
@ PosX
Position ECEF_X [m].
Definition Pos.hpp:178
@ States_COUNT
Count.
Definition Pos.hpp:181
@ PosY
Position ECEF_Y [m].
Definition Pos.hpp:179
@ PosZ
Position ECEF_Z [m].
Definition Pos.hpp:180
States()=delete
Constructor.
Matrix which can be accessed by keys.