Class Application

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class Application : public lupnt::Object<Application>

Base class for top-level simulation “application” logic attached to an Agent (e.g. RoverApp, SurfaceStationApp) &#8212; the part of an agent that runs its navigation filter / mission logic on a periodic schedule.

An Application is created and owned by an Agent (see the Agent(Config&) constructor, which builds it from the application: block of the agent’s Config and calls SetApplication(...)). Derived classes wire together the agent’s dynamics, devices, and a Filter (EKF/UKF/etc.) into a runnable scenario: Setup() initializes the filter state/covariance and schedules periodic Step() calls, Step() performs one predict/update cycle, and Log() records results each step (Agent::Log forwards to it).

Subclassed by lupnt::LunaNetSatApp, lupnt::RoverApp, lupnt::SurfaceStationApp

Public Functions

Application() = default
Application(Config &config)

Construct an Application from a YAML Config node.

Called via AssetFactory<Application, Config&>::Create from the Agent(Config&) constructor when an agent’s config contains an application: block. Reads the optional name (defaults to GetId()) and frequency [Hz] entries and stores the full config for use by derived-class constructors (e.g. RoverApp reads dynamics/filter sub-configs from it).

Parameters:

config – YAML configuration node for this application (must outlive derived objects that retain a reference into it).

virtual ~Application() = default
virtual void Setup()

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. RoverApp::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) = 0

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. RoverApp::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]

virtual void Log(Real t)

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. RoverApp::Log) override this to additionally log their Filter’s state/covariance and any error metrics.

Parameters:

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

inline std::string GetName() const

Get the application’s name (used as a prefix for logging/data keys).

inline void SetName(std::string name)

Set the application’s name.

inline Real GetFrequency() const

Get the configured Step() call frequency [Hz].

inline void SetFrequency(Real frequency)

Set the Step() call frequency [Hz]; used by Setup() to schedule periodic steps.

inline Agent *GetAgent() const

Get the Agent that owns this application.

inline void SetAgent(Agent *agent)

Set the Agent that owns this application (called by Agent::SetApplication).

Protected Attributes

std::string name_
Real frequency_ = 0.0
Agent *agent_ = nullptr
Config config_