Class Device¶
Defined in File device.h
Inheritance Relationships¶
Base Type¶
public lupnt::DataLogger(Class DataLogger)
Derived Types¶
public lupnt::Camera(Class Camera)public lupnt::Clock(Class Clock)public lupnt::Imu(Class Imu)public lupnt::Receiver(Class Receiver)public lupnt::Transmitter(Class Transmitter)public lupnt::Transponder(Class Transponder)
Class Documentation¶
-
class Device : public lupnt::DataLogger¶
Base class for all onboard hardware devices (clocks, IMUs, cameras, comms radios) that can be attached to an
Agent.Concrete devices (
Clock,Imu,Camera,Transmitter/Receiver/Transponder,GnssTransmitter/GnssReceiver) derive fromDeviceand overrideStep/Setup/Logto plug into the agent’s simulation loop:Setupis called once during agent initialization to register the device (e.g. schedule periodicStepcalls or bind to aChannel), andStepis then invoked by theSimulationevent scheduler at the device’s configuredfrequency_to advance its internal state/dynamics and produce measurements.DataLogger::Logis used byStepoverrides to record device state to the simulation output.Subclassed by lupnt::Camera, lupnt::Clock, lupnt::Imu, lupnt::Receiver, lupnt::Transmitter, lupnt::Transponder
Public Functions
-
Device() = default¶
-
Device(Config &config)¶
Construct a device from a YAML config node, reading the common
nameand (optional)frequency[Hz] fields used byAgent/Simulationto schedule periodicStepcalls.
-
virtual ~Device() = default¶
-
virtual void Step(Real t)¶
Advance the device’s internal state/dynamics by one simulation step at time
t[s].Called by the
Simulationevent scheduler (via the periodic event registered inSetup) once per device update at the device’s configuredfrequency_. Derived devices (Clock,Imu,Camera, comms radios) override this to propagate dynamics, generate measurements, and/or log state.- Parameters:
t – Simulation time of this step [s]
-
virtual void Setup()¶
One-time initialization performed when the device is attached to an
Agentand the simulation is built.The base implementation schedules a recurring
Stepevent (priorityEvent::Priority::DEVICE) on the owning agent’sSimulationiffrequency_ > 0. Derived devices (e.g.Transmitter/Receiver/Transponder) override this to additionally resolve theirChannelfrom the simulation by name.
-
inline std::string GetName() const¶
Human-readable identifier for this device, used in log messages and
DataLoggeroutput paths (e.g."<name>/state/...").
-
inline void SetName(std::string name)¶
Set the device’s identifier (see
GetName).
-
inline Agent *GetAgent() const¶
The
Agentthis device is attached to (e.g. a satellite, rover, or ground station), ornullptrif not yet attached.
-
inline void SetAgent(Agent *agent)¶
Attach this device to an owning
Agent(called byAgent::AddDevice).
-
inline Real GetFrequency() const¶
Update rate at which
Stepis scheduled [Hz]; 0 means no periodic stepping is scheduled by the baseSetup.
-
inline void SetFrequency(Real frequency)¶
Set the periodic
Stepupdate rate [Hz] (seeGetFrequency).
-
inline virtual void Log(Real time)¶
Record this device’s current state to the simulation’s
DataLoggeroutput at timet[s]. Overridden by derived devices (e.g.Clock::Log) to log model-specific quantities; the base implementation is a no-op.
-
Device() = default¶