Class GnssAttitude¶
Defined in File gnss_attitude.h
Class Documentation¶
-
class GnssAttitude¶
GNSS satellite body (attitude) frame.
Defines the orthonormal triad
(ex, ey, ez):ez: nadir direction (toward the central body),normalize(-r_sat)ey: cross-track direction (toward the Sun side),normalize(cross(ez, normalize(r_sun - r_sat)))ex: along-track direction, completing the right-handed triad,normalize(cross(ey, ez))
This is the frame in which transmit-antenna gain patterns are defined (
theta= azimuth aboutezmeasured fromex,phi= off-boresight angle fromez).Public Functions
-
GnssAttitude() = default¶
-
GnssAttitude(const Vec3 &r_sat_eci, const Vec3 &r_sun_eci)¶
Construct and immediately compute the attitude frame.
Convenience constructor wrapping
Update(r_sat_eci, r_sun_eci); used where aGnssAttitudeinstance (rather than raw(ex, ey, ez)out-parameters) is convenient, e.g. intest_gnss_attitude.cc.- Parameters:
r_sat_eci – Satellite position (ECI or any inertial frame) [m]
r_sun_eci – Sun position, in the same frame as
r_sat_eci[m]
-
void Update(const Vec3 &r_sat_eci, const Vec3 &r_sun_eci)¶
(Re-)compute and cache the attitude triad for this instance.
-
void Update(const Vec3 &r_sat_eci, const Vec3 &v_sat_eci, const Vec3 &r_sun_eci)¶
(Re-)compute and cache the attitude triad via the documented nominal yaw-steering law; see
Compute(r_sat_eci, v_sat_eci, r_sun_eci, ...).
-
inline const Vec3 &GetEx() const¶
Get the cached along-track body axis
ex(unit vector, in the same inertial frame as ther_sat_eci/r_sun_ecipassed toUpdate/Compute). Part of this orthonormal, GNSS-attitude-frame triad — distinct from the non-orthonormalijkPCO frame ofAntexLoader::ComputeIjkToEcefRotation.
-
inline const Vec3 &GetEy() const¶
Get the cached cross-track (Sun-side) body axis
ey(unit vector, same frame asGetEx). Part of this orthonormal, GNSS-attitude-frame triad — distinct from the non-orthonormalijkPCO frame ofAntexLoader::ComputeIjkToEcefRotation.
-
inline const Vec3 &GetEz() const¶
Get the cached nadir body axis
ez(unit vector, same frame asGetEx). Part of this orthonormal, GNSS-attitude-frame triad — distinct from the non-orthonormalijkPCO frame ofAntexLoader::ComputeIjkToEcefRotation.
-
Mat3 GetRotationMatrix() const¶
Body-to-inertial rotation matrix
[ex, ey, ez](columns), assembled from the cached triad. Used to express vectors given in this GNSS-attitude body frame (e.g. antenna boresight/PCO offsets) in the same inertial frame asr_sat_eci.
-
void GetAngles(const Vec3 &u, Real &theta, Real &phi) const¶
Off-boresight angle
theta(azimuth, aboutezmeasured fromex) andphi(polar angle fromez) of a unit directionu(expressed in the same inertial frame asr_sat_eci/r_sun_eci), as seen from the satellite body frame.Mirrors the angle computation used by GNSS link-budget and measurement-channel construction: given the line-of-sight direction to a receiver/target, returns the
(theta, phi)pair thatAntenna::ComputeGainexpects to look up the transmit/receive gain pattern.- Parameters:
u – Unit direction vector, in the same inertial frame as
r_sat_eci/r_sun_ecitheta – [out] Azimuth angle about
ez, measured fromex[rad]phi – [out] Polar (off-boresight) angle from
ez[rad]
Public Static Functions
-
static void Compute(const Vec3 &r_sat_eci, const Vec3 &r_sun_eci, Vec3 &ex, Vec3 &ey, Vec3 &ez)¶
Compute the canonical GNSS satellite body (attitude) triad
(ex, ey, ez)directly from the satellite-to-Sun geometry.This is the core attitude computation used to evaluate transmit antenna gain patterns:
GNSSMeasurements::ComputeCN0(lupnt/measurements/gnss_measurement.cc) calls the velocity-aware overload below to get the transmitter’s(ex, ey, ez)at the signal-transmission epoch, then projects the transmitter-to-receiver line of sight onto this triad to get the off-boresight angles fed toAntenna::ComputeGain. Mirrors the attitude computation inGNSSMeas.setup_measurements(python/pylupnt/measurements/gnss_meas.py).- Parameters:
r_sat_eci – Satellite position (ECI or any inertial frame) [m]
r_sun_eci – Sun position, in the same frame as
r_sat_eci[m]ex – [out] Along-track body axis (unit vector)
ey – [out] Cross-track body axis (unit vector)
ez – [out] Nadir body axis (unit vector)
-
static void Compute(const Vec3 &r_sat_eci, const Vec3 &v_sat_eci, const Vec3 &r_sun_eci, Vec3 &ex, Vec3 &ey, Vec3 &ez)¶
Compute the attitude triad
(ex, ey, ez)via the documented nominal yaw-steering law (GnssYawSteering::NominalYawAngle, Eq. 1 of Cheng et al., 2025), rather than directly from the Sun direction.Internally computes the Sun-elevation (
beta) and orbit (mu) angles viaGnssYawSteering::BetaAngle/OrbitAngle, evaluates the nominal yaw anglephi = NominalYawAngle(beta, mu), and builds the frame by rotating the orbital reference frame about the nadir axis byphi(seeComputeFromYawAngle). This is numerically identical toCompute(r_sat_eci, r_sun_eci, ...)— both describe the same Sun-pointing nominal attitude, since the nominal yaw law is, by construction, the angle that keeps the solar panels Sun-pointing — but this overload makes the dependency on the documented yaw-steering law explicit, andComputeFromYawAngleis the basis for computing the modeled (maneuver/eclipse) attitude from any ofGnssYawSteering’s block-specific yaw-steering laws (Eq. 3-7, 12-16). This is the overload called byGNSSMeasurements::ComputeCN0to get the transmitter’s body frame for antenna-gain lookups.- Parameters:
r_sat_eci – Satellite position (ECI or any inertial frame) [m]
v_sat_eci – Satellite velocity, in the same frame [m/s]
r_sun_eci – Sun position, in the same frame as
r_sat_eci[m]ex – [out] Along-track-ish body axis (unit vector)
ey – [out] Cross-track-ish body axis (unit vector)
ez – [out] Nadir body axis (unit vector)
-
static void ComputeFromYawAngle(const Vec3 &r_sat_eci, const Vec3 &v_sat_eci, Real yaw_angle, Vec3 &ex, Vec3 &ey, Vec3 &ez)¶
Build the attitude triad
(ex, ey, ez)from an explicit yaw anglephi, e.g. one produced by any ofGnssYawSteering’s nominal or modeled/maneuver yaw-steering laws (Eq. 1, 3-7, 8, 12-16), and the orbital geometry alone (no Sun direction needed):ez = normalize(-r_sat)(nadir)ex_ref = normalize(v_sat),ey_ref = ez x ex_ref(orbital frame, phi = 0)ex = cos(phi) * ex_ref + sin(phi) * ey_refey = -sin(phi) * ex_ref + cos(phi) * ey_refi.e.(ex, ey)are the orbital reference axes(ex_ref, ey_ref)rotated byphiabout the nadir axisez. Supplyingphi = GnssYawSteering::NominalYawAngle(beta, mu)reproduces exactly the Sun-pointing nominal frame ofCompute(verified intest_gnss_attitude.cc); supplying a modeled yaw angle from one ofGnssYawSteering’s maneuver-specific laws instead yields the actual (eclipse-season / midnight-noon-turn) attitude.- Parameters: