Fixposition SDK 0.0.0-heads/main-0-ga33788a
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
fpsdk::common::trafo Namespace Reference

Transformation utilities. More...

Classes

struct  CrsInfo
 Coordinate reference system (CRS) information. More...
struct  TransformerOpts
 Transformer options. More...
class  Transformer
 "Universal" coordinate transformer, backed by PROJ More...

Enumerations

enum class  CrsType : int {
  UNKNOWN = 0 , GEOCENTRIC = 1 , GEOGRAPHIC_2D = 2 , GEOGRAPHIC_3D = 3 ,
  PROJECTED = 4 , VERTICAL = 5 , COMPOUND = 6 , OTHER = 7
}
 Coordinate reference system (CRS) types. More...

Functions

Eigen::Matrix3d RotEnuEcef (const double lat, const double lon)
 Calculate the rotation matrix from ECEF to ENU for a given reference latitude/longitude.
Eigen::Matrix3d RotEnuEcef (const Eigen::Vector3d &ecef)
 Calculate the rotation matrix from ECEF to ENU for a given reference position.
Eigen::Matrix3d RotNedEnu ()
 Returns rotation matrix between NED and ENU.
Eigen::Matrix3d RotNedEcef (const double lat, const double lon)
 Calculate the rotation matrix from ECEF to NED for a given reference latitude/longitude.
Eigen::Matrix3d RotNedEcef (const Eigen::Vector3d &ecef)
 Calculate the rotation matrix from ECEF to NED for a given reference origin.
Eigen::Vector3d TfEnuEcef (const Eigen::Vector3d &ecef, const Eigen::Vector3d &wgs84llh_ref)
 Transform ECEF coordinate to ENU with specified ENU-origin.
Eigen::Vector3d TfEcefEnu (const Eigen::Vector3d &enu, const Eigen::Vector3d &wgs84llh_ref)
 Transform ENU coordinate to ECEF with specified ENU-origin.
Eigen::Vector3d TfNedEcef (const Eigen::Vector3d &ecef, const Eigen::Vector3d &wgs84llh_ref)
 Convert ECEF coordinates to ENU with specified ENU origin.
Eigen::Vector3d TfEcefNed (const Eigen::Vector3d &ned, const Eigen::Vector3d &wgs84llh_ref)
Eigen::Vector3d TfEcefWgs84Llh (const Eigen::Vector3d &wgs84llh)
 Convert geodetic coordinates (latitude, longitude, height) to ECEF (x, y, z).
Eigen::Vector3d TfWgs84LlhEcef (const Eigen::Vector3d &ecef)
 Convert ECEF (x, y, z) coordinates to geodetic coordinates (latitude, longitude, height).
Eigen::Vector3d EcefPoseToEnuEul (const Eigen::Vector3d &ecef_p, const Eigen::Matrix3d &ecef_r)
 Calculate yaw, pitch and roll in ENU from a given pose in ECEF.
Eigen::Vector3d QuatToEul (const Eigen::Quaterniond &quat)
 Vector4 quaternion to intrinsic Euler angles in ZYX (yaw, pitch, roll).
Eigen::Vector3d RotToEul (const Eigen::Matrix3d &rot)
 Rotation Matrix to intrinsic Euler angles in ZYX (yaw, pitch, roll) order in radian.
Eigen::Vector3d LlhDegToRad (const Eigen::Vector3d &llh_deg)
 Convert llh from deg to rad, height component unchanged.
Eigen::Vector3d LlhRadToDeg (const Eigen::Vector3d &llh_rad)
 Convert llh from rad to deg, height component unchanged.
const char * CrsTypeStr (const CrsType type)
 Stringify CRS type.

Variables

WGS-84 constants
static constexpr double WGS84_A = 6378137.0
 WGS-84 Earth radius major axis [m].
static constexpr double WGS84_B = 6356752.314245
 WGS-84 Earth radius minor axis [m].
static constexpr double WGS84_C = 40075016.6855785
 Circumference at equator (= 2π * WGS84_A) [m].
static constexpr double WGS84_1F = 298.257223563
 WGS-84 1/f inverse of flattening parameter.
static constexpr double WGS84_E2 = 6.69437999014e-3
 WGS-84 first eccentricity squared.
static constexpr double WGS84_A2 = WGS84_A * WGS84_A
 WGS-84 a^2.
static constexpr double WGS84_B2 = WGS84_B * WGS84_B
 WGS-84 b^2.
static constexpr double WGS84_EE2 = (WGS84_A2 / WGS84_B2) - 1.0
 WGS-84 e'^2 second eccentricity squared.

Detailed Description

Transformation utilities.

Enumeration Type Documentation

◆ CrsType

enum class fpsdk::common::trafo::CrsType : int
strong

Coordinate reference system (CRS) types.

(Like PROJ's PJ_TYPE_GEOCENTRIC_CRS etc., see their docu for details)

Enumerator
UNKNOWN 

Unknown (or not initialised).

GEOCENTRIC 

Geocentric (ECEF x/y/z), e.g. EPSG:4978.

GEOGRAPHIC_2D 

Geographic 2D (lat/lon), e.g. EPSG:4326.

GEOGRAPHIC_3D 

Geographic 3D (lat/lon/height), e.g. EPSG:4979.

PROJECTED 

Projected (east/north), e.g. EPSG:2056.

VERTICAL 

Vertical (height), e.g. EPSG:5703.

COMPOUND 

Compound (horizontal + vertical), e.g. EPSG:4258+5703.

OTHER 

Other type (engineering, temporal, ...).

Definition at line 222 of file trafo.hpp.

Function Documentation

◆ RotEnuEcef() [1/2]

Eigen::Matrix3d fpsdk::common::trafo::RotEnuEcef ( const double lat,
const double lon )

Calculate the rotation matrix from ECEF to ENU for a given reference latitude/longitude.

Parameters
[in]latReference latitude [rad]
[in]lonReference longitude [rad]
Returns
the rotation matrix from ECEF to ENU

Reference https://gssc.esa.int/navipedia/index.php/Transformations_between_ECEF_and_ENU_coordinates

◆ RotEnuEcef() [2/2]

Eigen::Matrix3d fpsdk::common::trafo::RotEnuEcef ( const Eigen::Vector3d & ecef)

Calculate the rotation matrix from ECEF to ENU for a given reference position.

Note
The reference position is projected to the WGS84 ellipsoid
Parameters
[in]ecefReference position in ECEF [m]
Returns
the rotation matrix from ECEF to ENU

◆ RotNedEnu()

Eigen::Matrix3d fpsdk::common::trafo::RotNedEnu ( )

Returns rotation matrix between NED and ENU.

| 0,  1,  0 |
| 1,  0,  0 |
| 0,  0, -1 |
Returns
the rotation matrix between NED and ENU

◆ RotNedEcef() [1/2]

Eigen::Matrix3d fpsdk::common::trafo::RotNedEcef ( const double lat,
const double lon )

Calculate the rotation matrix from ECEF to NED for a given reference latitude/longitude.

Parameters
[in]latReference latitude [rad]
[in]lonReference longitude [rad]
Returns
the rotation matrix from ECEF to NED

◆ RotNedEcef() [2/2]

Eigen::Matrix3d fpsdk::common::trafo::RotNedEcef ( const Eigen::Vector3d & ecef)

Calculate the rotation matrix from ECEF to NED for a given reference origin.

Note
The reference position is projected to the WGS84 ellipsoid
Parameters
[in]ecefReference position in ECEF [m]
Returns
the rRotation matrix from ECEF to NED

◆ TfEnuEcef()

Eigen::Vector3d fpsdk::common::trafo::TfEnuEcef ( const Eigen::Vector3d & ecef,
const Eigen::Vector3d & wgs84llh_ref )

Transform ECEF coordinate to ENU with specified ENU-origin.

Parameters
[in]ecefECEF position to be transformed [m]
[in]wgs84llh_refENU-origin in geodetic coordinates (lat [rad], lon [rad], height [m])
Returns
the position in ENU coordinates

◆ TfEcefEnu()

Eigen::Vector3d fpsdk::common::trafo::TfEcefEnu ( const Eigen::Vector3d & enu,
const Eigen::Vector3d & wgs84llh_ref )

Transform ENU coordinate to ECEF with specified ENU-origin.

Parameters
[in]enuENU position to be transformed [m]
[in]wgs84llh_refENU-origin in geodetic coordinates (lat [rad], lon [rad], height [m])
Returns
Todo
documentation

◆ TfNedEcef()

Eigen::Vector3d fpsdk::common::trafo::TfNedEcef ( const Eigen::Vector3d & ecef,
const Eigen::Vector3d & wgs84llh_ref )

Convert ECEF coordinates to ENU with specified ENU origin.

Parameters
[in]ecefECEF position to be converted
[in]wgs84llh_refENU-origin input given in geodetic coordinates
Returns
the position in ENU coordinates

◆ TfEcefNed()

Eigen::Vector3d fpsdk::common::trafo::TfEcefNed ( const Eigen::Vector3d & ned,
const Eigen::Vector3d & wgs84llh_ref )
Todo
documentation

◆ TfEcefWgs84Llh()

Eigen::Vector3d fpsdk::common::trafo::TfEcefWgs84Llh ( const Eigen::Vector3d & wgs84llh)

Convert geodetic coordinates (latitude, longitude, height) to ECEF (x, y, z).

Parameters
[in]wgs84llhGeodetic coordinates (lat [rad], lon [rad], height [m])
Returns
the ECEF coordinates [m]

◆ TfWgs84LlhEcef()

Eigen::Vector3d fpsdk::common::trafo::TfWgs84LlhEcef ( const Eigen::Vector3d & ecef)

Convert ECEF (x, y, z) coordinates to geodetic coordinates (latitude, longitude, height).

Parameters
[in]ecefECEF coordinates [m]
Returns
the geodetic coordinates (lat [rad], lon [rad], height [m])

◆ EcefPoseToEnuEul()

Eigen::Vector3d fpsdk::common::trafo::EcefPoseToEnuEul ( const Eigen::Vector3d & ecef_p,
const Eigen::Matrix3d & ecef_r )

Calculate yaw, pitch and roll in ENU from a given pose in ECEF.

Yaw is -Pi/2 when X points North, because ENU starts with East

Parameters
[in]ecef_p3D position vector in ECEF
[in]ecef_r3x3 rotation matrix representing rotation from body to ECEF
Returns
yaw, pitch and roll in ENU

◆ QuatToEul()

Eigen::Vector3d fpsdk::common::trafo::QuatToEul ( const Eigen::Quaterniond & quat)

Vector4 quaternion to intrinsic Euler angles in ZYX (yaw, pitch, roll).

Parameters
[in]quatQuaternion (w, i, j, k)
Returns
the intrinsic Euler angles in ZYX (yaw, pitch, roll) order

◆ RotToEul()

Eigen::Vector3d fpsdk::common::trafo::RotToEul ( const Eigen::Matrix3d & rot)

Rotation Matrix to intrinsic Euler angles in ZYX (yaw, pitch, roll) order in radian.

Parameters
[in]rotEigen::Matrix3d
Returns
intrinsic euler angle in ZYX (Yaw-Pitch-Roll) order in radian

◆ LlhDegToRad()

Eigen::Vector3d fpsdk::common::trafo::LlhDegToRad ( const Eigen::Vector3d & llh_deg)

Convert llh from deg to rad, height component unchanged.

Parameters
[in]llh_degllh in degrees
Returns
llh in radian

◆ LlhRadToDeg()

Eigen::Vector3d fpsdk::common::trafo::LlhRadToDeg ( const Eigen::Vector3d & llh_rad)

Convert llh from rad to deg, height component unchanged.

Parameters
[in]llh_radllh in radian
Returns
llh in degrees

◆ CrsTypeStr()

const char * fpsdk::common::trafo::CrsTypeStr ( const CrsType type)

Stringify CRS type.

Parameters
[in]typeThe CRS type
Returns
a unique identifier string for the CRS type

Variable Documentation

◆ WGS84_A

double fpsdk::common::trafo::WGS84_A = 6378137.0
staticconstexpr

WGS-84 Earth radius major axis [m].

Definition at line 50 of file trafo.hpp.

◆ WGS84_B

double fpsdk::common::trafo::WGS84_B = 6356752.314245
staticconstexpr

WGS-84 Earth radius minor axis [m].

Definition at line 51 of file trafo.hpp.

◆ WGS84_C

double fpsdk::common::trafo::WGS84_C = 40075016.6855785
staticconstexpr

Circumference at equator (= 2π * WGS84_A) [m].

Definition at line 52 of file trafo.hpp.

◆ WGS84_1F

double fpsdk::common::trafo::WGS84_1F = 298.257223563
staticconstexpr

WGS-84 1/f inverse of flattening parameter.

Definition at line 53 of file trafo.hpp.

◆ WGS84_E2

double fpsdk::common::trafo::WGS84_E2 = 6.69437999014e-3
staticconstexpr

WGS-84 first eccentricity squared.

Definition at line 54 of file trafo.hpp.

◆ WGS84_A2

double fpsdk::common::trafo::WGS84_A2 = WGS84_A * WGS84_A
staticconstexpr

WGS-84 a^2.

Definition at line 55 of file trafo.hpp.

◆ WGS84_B2

double fpsdk::common::trafo::WGS84_B2 = WGS84_B * WGS84_B
staticconstexpr

WGS-84 b^2.

Definition at line 56 of file trafo.hpp.

◆ WGS84_EE2

double fpsdk::common::trafo::WGS84_EE2 = (WGS84_A2 / WGS84_B2) - 1.0
staticconstexpr

WGS-84 e'^2 second eccentricity squared.

Definition at line 57 of file trafo.hpp.