Class FixedPointingDynamics¶
Defined in File attitude_dynamics.h
Inheritance Relationships¶
Base Type¶
public lupnt::AttitudeDynamics(Class AttitudeDynamics)
Class Documentation¶
-
class FixedPointingDynamics : public lupnt::AttitudeDynamics¶
Attitude dynamics that orients a body frame so two configured axes point at two configured target bodies (“two-vector” / fixed-pointing attitude).
Builds a body-to-world rotation whose
primary_axis_points towardprimary_body_id_and whosesecondary_axis_is constrained towardsecondary_body_id_(e.g. antenna boresight at the target body, solar panel normal at the Sun). The resulting quaternion and angular velocity (obtained by differentiating the rotation in time via autodiff) are returned as anAttitudestate. Used by agents/ (e.g. constellation satellites, seeConstellationconstruction in agents/constellation.cc) to drive pointing-dependent devices.Public Functions
-
FixedPointingDynamics() = default¶
-
FixedPointingDynamics(Config &config)¶
Construct from a YAML configuration node specifying the primary and secondary pointing axes and target bodies.
Reads
primary_axis,primary_body_id,secondary_axis, andsecondary_body_idfromconfig.
-
inline void SetPrimaryPointing(Axis axis, BodyId body_id)¶
Set the primary pointing axis and the body it should track.
- Parameters:
axis – Body-frame axis (X/Y/Z) to align with the direction to
body_id.body_id – Target body whose direction defines the primary pointing axis.
-
inline void SetSecondaryPointing(Axis axis, BodyId body_id)¶
Set the secondary pointing axis and the body it should track.
- Parameters:
axis – Body-frame axis (X/Y/Z) constrained toward the direction to
body_id.body_id – Target body whose direction defines the secondary pointing axis.
-
virtual State Propagate(const State &qw, Real t0, Real tf, const State &rv) override¶
Compute the two-vector pointing attitude at time
tffrom the object’s position.Builds an orthonormal body-to-world rotation matrix
R_b2w(t)whose columns align the primary/secondary body axes with the directions from the object’s positionr = rv.head(3)toprimary_body_id_/secondary_body_id_atGetLupntEpoch() + t. The angular velocity is obtained from the analytic time-derivative ofR_b2w(via autodiff) usingRotToAngularVelocity.- Parameters:
qw – Initial attitude state at
t0(only its frame is used).t0 – Initial epoch [s, TDB since J2000] (unused; attitude is computed directly at
tf).tf – Final epoch [s, TDB since J2000] at which to evaluate the pointing attitude.
rv – Object’s Cartesian position/velocity state (
Cart6); must share the same frame asqwand have position inrv.head(3).
- Returns:
Attitude state (quaternion + body angular velocity) realizing the two-vector pointing law at time
tf.
-
virtual State Propagate(const State &qw, Real t0, Real tf, const State *u) override¶
Unimplemented: fixed-pointing attitude requires the object’s position/velocity.
Always raises a
LUPNT_CHECKfailure (“Position and velocity required for
fixed pointing dynamics”) and returns
qwunchanged. Callers must use thePropagate(qw, t0, tf, rv)overload instead.
-
inline virtual StateType GetStateType() const override¶
Return
Attitude::TYPE.
-
virtual State Propagate(const State &x0, Real t0, Real tf, const State *u, MatXd *stm)¶
Propagate the state and compute the state transition matrix (STM) d(xf)/d(x0) via automatic differentiation.
Default implementation: if
stm == nullptr, forwards to the no-STMPropagateoverload; otherwise wrapsPropagate(x0, t0, tf, u)in an autodiff Jacobian (jacobian(...)) with respect tox0. Used by filters (filters/) that need the linearized state transition for covariance propagation (e.g. EKF/UKF time updates).- Parameters:
x0 – Initial state at time
t0.t0 – Initial epoch [s, TDB since J2000].
tf – Final epoch [s, TDB since J2000].
u – Optional control/forcing input; nullptr if unused.
stm – Output: state transition matrix d(xf)/d(x0); left unmodified if nullptr.
- Returns:
Propagated state at time
tf.
-
virtual MatX Propagate(const State &x0, const VecX &tfs, const State *u = nullptr)¶
Propagate the state to a sequence of output epochs.
Repeatedly calls
Propagate(x0, t0, tf, u)between consecutive entries oftfs, accumulating each result as a row of the returned matrix. Used by applications/ and analysis scripts to generate a full trajectory time history in one call, with optional progress-bar output (see SetPrintProgress).- Parameters:
x0 – Initial state at
tfs(0).tfs – Vector of output epochs [s, TDB since J2000], including the initial epoch as
tfs(0).u – Optional control/forcing input applied at every step; nullptr if unused.
- Returns:
Matrix whose i-th row is the propagated state at
tfs(i).
-
FixedPointingDynamics() = default¶