Class LanderGncApp

Inheritance Relationships

Base Type

Class Documentation

class LanderGncApp : public lupnt::Application

Guidance/control application for a lunar lander, hosted on a agent alongside a LanderNavApp (both in the agent’s applications: list, guidance first).

It owns the powered-descent truth trajectory: it builds the Moon-fixed position, velocity, attitude, and the body-frame specific force / angular rate from the ENU descent path (or a supplied reference trajectory), writes the host lander’s truth state each epoch, and exposes the truth for the co-hosted navigation app to synthesize its measurements from. It reads only the shared World (terrain / ENU frame) — never the filter’s estimate — so a closed-loop guidance law could later consume the nav estimate without changing this split.

Public Functions

LanderGncApp() = default
explicit LanderGncApp(Config &config)
inline void SetReferenceTrajectoryEnu(const MatXd &ref_traj_enu)

Supply an externally-generated reference (truth) trajectory, N x 3 ENU rows [m] about the DEM site center. Overrides the built-in smoothstep descent and sets N. Call before the Simulation runs.

virtual void Setup() override

Initialize the application and schedule its periodic Step() calls.

Base implementation: if GetFrequency() > 0, schedules Step(t) on the owning agent’s Simulation at Event::Priority::APPLICATION, starting at t=0 with period 1/GetFrequency() seconds; otherwise logs a warning that no frequency is set. Derived classes (e.g. LanderNavApp::Setup, SurfaceStationApp::Setup) override this to additionally initialize their Filter’s time/state/covariance and dynamics/process noise callbacks before (optionally) calling the base behavior.

virtual void Step(Real t) override

Run one simulation step of this application’s mission logic at time t.

Pure virtual: derived classes implement the actual filter predict/update cycle here (e.g. LanderNavApp::Step computes a control input and logs state; the LNSS application’s Step would run the GNSS measurement-update). Invoked periodically by the Simulation event scheduled in Setup(), at the application’s configured frequency.

Parameters:

t – Current simulation time [s, since simulation epoch]

inline virtual void Log(Real) override

Log this application’s current state/diagnostics to the DataLogger.

Base implementation only emits a debug message. Called once after Setup() and thereafter from Agent::Log(t) (which forwards to application_->Log(time) each time the owning agent logs). Derived classes (e.g. LanderNavApp::Log) override this to additionally log their Filter’s state/covariance and any error metrics.

Parameters:

t – Current simulation time [s, since simulation epoch]

void EnsureInitialized()

Build the truth trajectory if not already built (idempotent). Called on the first Step, and by a co-hosted LanderNavApp so it can read the truth regardless of app order.

inline int N() const
inline double dt() const
inline const Vec3d &TruthPos(int k) const

Moon-fixed (MOON_PA) truth position [m] at epoch k.

inline const Vec3d &TruthVel(int k) const

Moon-fixed (MOON_PA) truth velocity [m/s] at epoch k.

inline const Mat3d &TruthAtt(int k) const

Body-to-MOON_PA truth attitude DCM at epoch k.

inline const Vec3d &SpecificForce(int k) const

Body-frame truth specific force [m/s^2] at epoch k (gravity removed).

inline const Vec3d &AngularRate(int k) const

Body-frame truth angular rate [rad/s] at epoch k.

inline double Altitude(int k) const

Truth height above terrain [m] at epoch k.

inline Vec3d EnuTruth(int k) const

Truth ENU position (East, North, Up) [m] at epoch k.

inline const LanderGncConfig &config() const
inline const MatXd &traj_enu_truth() const

[N x 3] truth ENU trajectory (guidance path), for plotting.

inline const VecXd &alt_truth() const

[N] truth height above terrain, for plotting.