|
Vulcan
Aerospace Engineering Utilities Built on Janus
|
#include <FramePrimitives.hpp>
Public Member Functions | |
| CoordinateFrame () | |
| Default constructor - creates ECEF identity frame. | |
| CoordinateFrame (const Vec3< Scalar > &x, const Vec3< Scalar > &y, const Vec3< Scalar > &z, const Vec3< Scalar > &o) | |
| Construct from basis vectors and origin. | |
| Vec3< Scalar > | from_ecef (const Vec3< Scalar > &v) const |
| Vec3< Scalar > | to_ecef (const Vec3< Scalar > &v) const |
| Vec3< Scalar > | position_from_ecef (const Vec3< Scalar > &pos_ecef) const |
| Vec3< Scalar > | position_to_ecef (const Vec3< Scalar > &pos_local) const |
| Mat3< Scalar > | dcm () const |
| Mat3< Scalar > | dcm_inverse () const |
| janus::Quaternion< Scalar > | quaternion () const |
| bool | is_valid (double tol=1e-9) const |
Static Public Member Functions | |
| static CoordinateFrame | from_quaternion (const janus::Quaternion< Scalar > &q, const Vec3< Scalar > &o=Vec3< Scalar >::Zero()) |
| static CoordinateFrame | ecef () |
| static CoordinateFrame | eci (Scalar gmst) |
| static CoordinateFrame | ned (Scalar lon, Scalar lat) |
| static CoordinateFrame | enu (Scalar lon, Scalar lat) |
Public Attributes | |
| Vec3< Scalar > | x_axis |
| Unit X basis vector in ECEF. | |
| Vec3< Scalar > | y_axis |
| Unit Y basis vector in ECEF. | |
| Vec3< Scalar > | z_axis |
| Unit Z basis vector in ECEF. | |
| Vec3< Scalar > | origin |
| Frame origin in ECEF [m]. | |
Coordinate frame defined by orthonormal basis vectors expressed in ECEF
This is the central abstraction for coordinate transformations in Vulcan. All frames are represented by three unit basis vectors (X, Y, Z axes) expressed in the ECEF (Earth-Centered Earth-Fixed) frame, plus an origin point. Transformations between frames are performed via dot products (projections) through ECEF as the hub.
This representation follows the TAOS specification's "Unit Vector Projection Method" which provides O(2N) transformations instead of O(N²) direct matrix pairs.
Example:
| Scalar | Scalar type (double for numeric, janus::SymbolicScalar for symbolic) |
|
inline |
Default constructor - creates ECEF identity frame.
|
inline |
Construct from basis vectors and origin.
|
inlinenodiscard |
|
inlinenodiscard |
Compose inverse DCM (ECEF to local)
The inverse DCM transforms vectors from ECEF to this frame: v_local = dcm_inverse() * v_ecef
For orthonormal frames, this is simply the transpose.
|
inlinestatic |
Create ECEF identity frame
X: Points to prime meridian at equator Y: Points to 90°E at equator Z: Points to North Pole
|
inlinestatic |
Create ECI (Earth-Centered Inertial) frame at given GMST
The ECI frame is rotated from ECEF about the Z-axis by the Greenwich Mean Sidereal Time (or Earth Rotation Angle).
At GMST=0, ECI aligns with ECEF (X points to vernal equinox, which coincides with Greenwich at epoch).
| gmst | Greenwich Mean Sidereal Time [rad] |
|
inlinestatic |
Create ENU (East-North-Up) frame at given geodetic position
X: Points East (tangent to parallel) Y: Points North (tangent to meridian) Z: Points Up (ellipsoid normal)
Common in surveying and some navigation applications.
| lon | Longitude [rad] |
| lat | Geodetic latitude [rad] |
|
inlinenodiscard |
|
inlinestatic |
Create frame from quaternion and origin
The quaternion should represent the rotation from ECEF to the target frame (i.e., how to transform ECEF vectors to local coords).
| q | Quaternion (ECEF to local rotation) |
| o | Origin in ECEF [m] |
|
inlinenodiscard |
Check if frame is orthonormal within tolerance
Verifies:
| tol | Tolerance for numerical checks |
|
inlinestatic |
Create NED (North-East-Down) frame at given geodetic position
X: Points North (tangent to meridian) Y: Points East (tangent to parallel) Z: Points Down (opposite to ellipsoid normal)
This is the standard aerospace local horizon frame.
| lon | Longitude [rad] |
| lat | Geodetic latitude [rad] |
|
inlinenodiscard |
Transform position FROM ECEF TO this frame (includes origin offset)
| pos_ecef | Position in ECEF [m] |
|
inlinenodiscard |
Transform position FROM this frame TO ECEF (includes origin offset)
| pos_local | Position in this frame [m] |
|
inlinenodiscard |
Get frame orientation as quaternion (rotation from ECEF to this frame)
The quaternion represents the rotation that transforms vectors from ECEF coordinates to this frame's coordinates.
|
inlinenodiscard |
| Vec3<Scalar> vulcan::CoordinateFrame< Scalar >::origin |
Frame origin in ECEF [m].
| Vec3<Scalar> vulcan::CoordinateFrame< Scalar >::x_axis |
Unit X basis vector in ECEF.
| Vec3<Scalar> vulcan::CoordinateFrame< Scalar >::y_axis |
Unit Y basis vector in ECEF.
| Vec3<Scalar> vulcan::CoordinateFrame< Scalar >::z_axis |
Unit Z basis vector in ECEF.