AMS Advanced Air Mobility Sensors UG
Loading...
Searching...
No Matches
NNavigationUtilities Namespace Reference

Classes

class  CGeoConstants
 
class  CMathConstants
 

Functions

float HeightFromPressure (float fPressurePascals)
 Compute height above mean sea level from pressure. Valid input range [22700.0 127780.0]. The range corresponds to height from approximately -2000m to 11000m.
 
float PartialDerivativeHeightWrtPressure (float fPressurePascals)
 Compute a partial derivative of height above mean sea level with respect to pressure. Valid input range [22700.0 127780.0]. The range corresponds to height from approximately -2000m to 11000m.
 
void EulerFromSpecificForce (const Eigen::Vector3f &korSpecificForce, float &frRoll, float &frPitch)
 Compute Euler angles (roll and pitch) from specific force measurements. The function does not check for static conditions. Aerospace sequence of Euler angles is assumed.
 
void EulerFromQuaternion (const CQuaternion &korQuaternion, float &frRoll, float &frPitch, float &frYaw)
 Convert a quaternion to Euler angles. Quaternion's norm shall be 1, otherwise usage of this function does not make sense. The function does not vefify the input, it shall be done by a caller.
 
float HeadingFromMagnetometer (const Eigen::Vector3f &korMagneticFieldVectorInGauss, float fRoll, float fPitch)
 Compute magnetic heading given known attitude and a magnetometer measurement.
 
CQuaternion QuaternionFromEuler (float fRoll, float fPitch, float fYaw)
 Convert Euler angles to a quaternion.
 
Eigen::Matrix3f DcmFromQuaternion (const CQuaternion &korQuaternion)
 Convert a quaternion to a rotation matrix.
 
template<typename tUnsignedType >
int32_t DiffOfUnsigned (tUnsignedType uTimestamp1, tUnsignedType uTimestamp2)
 Computes a signed difference of two unsigned numbers. The function asserts if the diff is greater than the max value of the return type.
 

Function Documentation

◆ DcmFromQuaternion()

Eigen::Matrix3f NNavigationUtilities::DcmFromQuaternion ( const CQuaternion korQuaternion)

Convert a quaternion to a rotation matrix.

Parameters
korQuaternionInput quaternion.
Returns
Rotation matrix.

◆ DiffOfUnsigned()

template<typename tUnsignedType >
int32_t NNavigationUtilities::DiffOfUnsigned ( tUnsignedType  uTimestamp1,
tUnsignedType  uTimestamp2 
)
inline

Computes a signed difference of two unsigned numbers. The function asserts if the diff is greater than the max value of the return type.

Template Parameters
tUnsignedTypeUnsigned type
Parameters
[in]uTimestamp1
[in]uTimestamp2
Returns
uTimestamp1 minus uTimastamp2

◆ EulerFromQuaternion()

void NNavigationUtilities::EulerFromQuaternion ( const CQuaternion korQuaternion,
float &  frRoll,
float &  frPitch,
float &  frYaw 
)

Convert a quaternion to Euler angles. Quaternion's norm shall be 1, otherwise usage of this function does not make sense. The function does not vefify the input, it shall be done by a caller.

Parameters
korQuaternionA quaternion to be converted.
frRollOutput roll angle, [rad], from -pi to pi
frPitchOutput pitch angle, [rad], from -pi/2 to pi/2
frYawOutput yaw angle, [rad], from -pi to pi

◆ EulerFromSpecificForce()

void NNavigationUtilities::EulerFromSpecificForce ( const Eigen::Vector3f &  korSpecificForce,
float &  frRoll,
float &  frPitch 
)

Compute Euler angles (roll and pitch) from specific force measurements. The function does not check for static conditions. Aerospace sequence of Euler angles is assumed.

Parameters
korSpecificForceThe specific force measurement.
frRollOutput roll angle.
frPitchOutput pitch angle.

◆ HeadingFromMagnetometer()

float NNavigationUtilities::HeadingFromMagnetometer ( const Eigen::Vector3f &  korMagneticFieldVectorInGauss,
float  fRoll,
float  fPitch 
)

Compute magnetic heading given known attitude and a magnetometer measurement.

Roll must be between +-pi, pitch must be between +-pi/2. The function returns NaN if inputs are not in the expected range. Rturns NaN in gimbal lock, i. e. when pitch is exactly +pi/2 or -pi/2

Parameters
korMagneticFieldVectorInGaussMagnetometer measurement.
fRollRoll angle, [rad], must belong to the closed interval [-pi, pi]
fPitchPitch angle, [rad]
Returns
Magnetic heading in radians, from -pi to pi.

◆ HeightFromPressure()

float NNavigationUtilities::HeightFromPressure ( float  fPressurePascals)

Compute height above mean sea level from pressure. Valid input range [22700.0 127780.0]. The range corresponds to height from approximately -2000m to 11000m.

Parameters
fPressurePascalsMeasured pressure.
Returns
Height above mean sea level when input is from the valid range, quiet NaN otherwise.

◆ PartialDerivativeHeightWrtPressure()

float NNavigationUtilities::PartialDerivativeHeightWrtPressure ( float  fPressurePascals)

Compute a partial derivative of height above mean sea level with respect to pressure. Valid input range [22700.0 127780.0]. The range corresponds to height from approximately -2000m to 11000m.

Parameters
fPressurePascalsMeasured pressure.
Returns
A value of a partial derivative of height with respect to pressure when input is from the valid range, quiet NaN otherwise.

◆ QuaternionFromEuler()

CQuaternion NNavigationUtilities::QuaternionFromEuler ( float  fRoll,
float  fPitch,
float  fYaw 
)

Convert Euler angles to a quaternion.

Parameters
fRollRoll angle.
fPitchPitch angle.
fYawYaw angle.
Returns
Quaternion.