27#include "Navigation/Transformations/Units.hpp"
51template<
typename DerivedA,
typename DerivedB>
53 const Eigen::MatrixBase<DerivedB>& n_Quat_b_coeffs)
56 Eigen::Matrix4<typename DerivedA::Scalar> A;
59 A << 0.0 , -b_omega_nb(0), -b_omega_nb(1), -b_omega_nb(2),
60 b_omega_nb(0), 0.0 , b_omega_nb(2), -b_omega_nb(1),
61 b_omega_nb(1), -b_omega_nb(2), 0.0 , b_omega_nb(0),
62 b_omega_nb(2), b_omega_nb(1), -b_omega_nb(0), 0.0 ;
66 return 0.5 * A * n_Quat_b_coeffs;
86template<
typename DerivedA,
typename DerivedB,
typename DerivedC,
typename DerivedD>
88 const Eigen::MatrixBase<DerivedB>& n_coriolisAcceleration,
89 const Eigen::MatrixBase<DerivedC>& n_gravitation,
90 const Eigen::MatrixBase<DerivedD>& n_centrifugalAcceleration)
92 return n_measuredForce
93 - n_coriolisAcceleration
95 - n_centrifugalAcceleration;
116template<
typename Derived>
118 const typename Derived::Scalar& phi,
const typename Derived::Scalar& h,
119 const typename Derived::Scalar& R_N,
const typename Derived::Scalar& R_E)
122 const auto& v_N = n_velocity(0);
124 const auto& v_E = n_velocity(1);
126 const auto& v_D = n_velocity(2);
128 return { v_N / (R_N + h),
129 v_E / ((R_E + h) * std::cos(phi)),
138template<
typename Scalar,
typename = std::enable_if_t<std::is_
floating_po
int_v<Scalar>>>
143 Eigen::Vector<Scalar, 10> y_dot = Eigen::Vector<Scalar, 10>::Zero();
145 Eigen::Quaternion<Scalar> n_Quat_b{ y(0), y(1), y(2), y(3) };
146 n_Quat_b.normalize();
147 Eigen::Quaternion<Scalar> n_Quat_e = trafo::n_Quat_e(y(7), y(8));
149 LOG_DATA(
"rollPitchYaw = {} [°]", rad2deg(trafo::quat2eulerZYX(n_Quat_b)).transpose());
150 LOG_DATA(
"n_velocity = {} [m/s]", y.template segment<3>(4).transpose());
151 LOG_DATA(
"lla_position = {}°, {}°, {} m", rad2deg(y(7)), rad2deg(y(8)), y(9));
160 LOG_DATA(
"n_omega_ie = {} [rad/s]", n_omega_ie.transpose());
162 Eigen::Vector3<Scalar> n_omega_en =
n_calcTransportRate(y.template segment<3>(7), y.template segment<3>(4), R_N, R_E);
163 LOG_DATA(
"n_omega_en = {} [rad/s]", n_omega_en.transpose());
165 Eigen::Vector3<Scalar> b_omega_nb = z.template segment<3>(3)
166 - n_Quat_b.conjugate()
169 LOG_DATA(
"b_omega_nb = {} [rad/s]", b_omega_nb.transpose());
174 : Eigen::Vector3<Scalar>::Zero();
175 LOG_DATA(
"n_coriolisAcceleration = {} [m/s^2]", n_coriolisAcceleration.transpose());
179 : Eigen::Vector3<Scalar>::Zero();
180 LOG_DATA(
"n_centrifugalAcceleration = {} [m/s^2]", n_centrifugalAcceleration.transpose());
186 y.template segment<4>(0));
189 n_coriolisAcceleration,
191 n_centrifugalAcceleration);
199 LOG_DATA(
"n_Quat_b_dot = {} ", y_dot.template segment<4>(0).transpose());
200 LOG_DATA(
"n_velocity_dot = {} [m/s^2]", y_dot.template segment<3>(4).transpose());
201 LOG_DATA(
"lla_position_dot = {} [rad/s, rad/s, m/s]", y_dot.template segment<3>(7).transpose());
Transformation collection.
Functions concerning the ellipsoid model.
Scalar calcEarthRadius_E(const Scalar &latitude, const Scalar &a=InsConst< Scalar >::WGS84::a, const Scalar &e_squared=InsConst<>::WGS84::e_squared)
Calculates the East/West (prime vertical) earth radius.
Definition Ellipsoid.hpp:57
Scalar calcEarthRadius_N(const Scalar &latitude, const Scalar &a=InsConst<>::WGS84::a, const Scalar &e_squared=InsConst<>::WGS84::e_squared)
Calculates the North/South (meridian) earth radius.
Definition Ellipsoid.hpp:41
Different Gravity Models.
Eigen::Vector3< typename Derived::Scalar > n_calcGravitation(const Eigen::MatrixBase< Derived > &lla_position, GravitationModel gravitationModel=GravitationModel::EGM96)
Calculates the gravitation (acceleration due to mass attraction of the Earth)
Definition Gravity.hpp:193
Inertial Navigation Helper Functions.
Eigen::Vector3< typename DerivedA::Scalar > n_calcCoriolisAcceleration(const Eigen::MatrixBase< DerivedA > &n_omega_ie, const Eigen::MatrixBase< DerivedB > &n_omega_en, const Eigen::MatrixBase< DerivedC > &n_velocity)
Calculates the coriolis acceleration in [m/s^2] (acceleration due to motion in rotating reference fra...
Definition Functions.hpp:90
Eigen::Vector3< typename DerivedA::Scalar > e_calcCentrifugalAcceleration(const Eigen::MatrixBase< DerivedA > &e_position, const Eigen::MatrixBase< DerivedB > &e_omega_ie=InsConst< typename DerivedB::Scalar >::e_omega_ie)
Calculates the centrifugal acceleration in [m/s^2] (acceleration that makes a body follow a curved pa...
Definition Functions.hpp:72
Eigen::Vector3< typename DerivedA::Scalar > n_calcTransportRate(const Eigen::MatrixBase< DerivedA > &lla_position, const Eigen::MatrixBase< DerivedB > &n_velocity, const typename DerivedA::Scalar &R_N, const typename DerivedA::Scalar &R_E)
Calculates the transport rate ω_en_n (rotation rate of the Earth frame relative to the navigation fra...
Definition Functions.hpp:39
Eigen::Vector3< typename DerivedA::Scalar > n_calcTimeDerivativeForVelocity(const Eigen::MatrixBase< DerivedA > &n_measuredForce, const Eigen::MatrixBase< DerivedB > &n_coriolisAcceleration, const Eigen::MatrixBase< DerivedC > &n_gravitation, const Eigen::MatrixBase< DerivedD > &n_centrifugalAcceleration)
Calculates the time derivative of the velocity in local-navigation frame coordinates.
Definition Mechanization.hpp:87
Eigen::Vector3< typename Derived::Scalar > lla_calcTimeDerivativeForPosition(const Eigen::MatrixBase< Derived > &n_velocity, const typename Derived::Scalar &phi, const typename Derived::Scalar &h, const typename Derived::Scalar &R_N, const typename Derived::Scalar &R_E)
Calculates the time derivative of the curvilinear position.
Definition Mechanization.hpp:117
Eigen::Vector< Scalar, 10 > n_calcPosVelAttDerivative(const Eigen::Vector< Scalar, 10 > &y, const Eigen::Vector< Scalar, 6 > &z, const PosVelAttDerivativeConstants< Scalar > &c, Scalar=0.0)
Calculates the derivative of the quaternion, velocity and curvilinear position.
Definition Mechanization.hpp:139
Eigen::Vector4< typename DerivedA::Scalar > calcTimeDerivativeFor_n_Quat_b(const Eigen::MatrixBase< DerivedA > &b_omega_nb, const Eigen::MatrixBase< DerivedB > &n_Quat_b_coeffs)
Calculates the time derivative of the quaternion n_Quat_b.
Definition Mechanization.hpp:52
Utility class for logging to console and file.
#define LOG_DATA
All output which occurs repeatedly every time observations are received.
Definition Logger.hpp:29
Inertial Navigation Mechanization Functions.
Provides Numerical integration methods.
Constants.
Definition Constants.hpp:26
Values needed to calculate the PosVelAttDerivative for the local-navigation frame.
Definition Mechanization.hpp:27
bool centrifgalAccelerationCompensationEnabled
Apply the centrifugal acceleration compensation to the measured accelerations.
Definition Mechanization.hpp:30
bool angularRateTransportRateCompensationEnabled
Apply the transport rate compensation to the measured angular rates.
Definition Mechanization.hpp:32
bool angularRateEarthRotationCompensationEnabled
Apply the Earth rotation rate compensation to the measured angular rates.
Definition Mechanization.hpp:31
GravitationModel gravitationModel
Gravity Model to use.
Definition Mechanization.hpp:28
bool coriolisAccelerationCompensationEnabled
Apply the Coriolis acceleration compensation to the measured accelerations.
Definition Mechanization.hpp:29