Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData > Class Template Reference

Single interface to the hardware-in-the-loop framework. More...

#include <HIL.h>

Inheritance diagram for Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >:
Collaboration diagram for Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >:

Public Member Functions

 HIL (HILTransceiver< FlightPhases, SimulatorData, ActuatorData > *hilTransceiver, HILPhasesManager< FlightPhases, SimulatorData, ActuatorData > *hilPhasesManager, std::function< ActuatorData()> updateActuatorData, int simulationPeriod)
 Constructor of the HIL framework.
 
bool start () override
 Start the needed hardware-in-the-loop components.
 
void stop ()
 Signals the runner thread to terminate and joins the thread.
 
void waitStartSimulation ()
 
void registerToFlightPhase (const FlightPhases &flag, const PhasesCallback &func)
 
int getSimulationPeriod () const
 
int64_t getTimestampSimulatorData () const
 
const SimulatorData * getSensorData () const
 
- Public Member Functions inherited from Boardcore::ActiveObject
 ActiveObject (unsigned int stacksize=miosix::STACK_DEFAULT_FOR_PTHREAD, miosix::Priority priority=miosix::MAIN_PRIORITY)
 
virtual ~ActiveObject ()
 
bool isRunning ()
 

Protected Attributes

HILTransceiver< FlightPhases, SimulatorData, ActuatorData > * hilTransceiver
 
HILPhasesManager< FlightPhases, SimulatorData, ActuatorData > * hilPhasesManager
 
- Protected Attributes inherited from Boardcore::ActiveObject
miosix::Thread * thread = nullptr
 Gives access to the thread object.
 
std::atomic< bool > stopFlag {false}
 
std::atomic< bool > running {false}
 

Additional Inherited Members

- Protected Member Functions inherited from Boardcore::ActiveObject
bool shouldStop ()
 Tells whether or not the ActiveObject should stop its execution.
 

Detailed Description

template<class FlightPhases, class SimulatorData, class ActuatorData>
class Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >

Single interface to the hardware-in-the-loop framework.

Definition at line 40 of file HIL.h.

Constructor & Destructor Documentation

◆ HIL()

template<class FlightPhases , class SimulatorData , class ActuatorData >
Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::HIL ( HILTransceiver< FlightPhases, SimulatorData, ActuatorData > * hilTransceiver,
HILPhasesManager< FlightPhases, SimulatorData, ActuatorData > * hilPhasesManager,
std::function< ActuatorData()> updateActuatorData,
int simulationPeriod )
inline

Constructor of the HIL framework.

Parameters
hilTransceiverThe pointer to the already built HILTransceiver.
hilPhasesManagerThe pointer to the already built HILPhasesManager.
updateActuatorDataFunction which returns the current ActuatorData situation.
simulationPeriodPeriod of the simulation [ms].

Definition at line 56 of file HIL.h.

Member Function Documentation

◆ getSensorData()

template<class FlightPhases , class SimulatorData , class ActuatorData >
const SimulatorData * Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::getSensorData ( ) const
inline

Definition at line 125 of file HIL.h.

◆ getSimulationPeriod()

template<class FlightPhases , class SimulatorData , class ActuatorData >
int Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::getSimulationPeriod ( ) const
inline

Definition at line 118 of file HIL.h.

◆ getTimestampSimulatorData()

template<class FlightPhases , class SimulatorData , class ActuatorData >
int64_t Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::getTimestampSimulatorData ( ) const
inline

Definition at line 120 of file HIL.h.

◆ registerToFlightPhase()

template<class FlightPhases , class SimulatorData , class ActuatorData >
void Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::registerToFlightPhase ( const FlightPhases & flag,
const PhasesCallback & func )
inline

Definition at line 112 of file HIL.h.

◆ start()

template<class FlightPhases , class SimulatorData , class ActuatorData >
bool Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::start ( )
inlineoverridevirtual

Start the needed hardware-in-the-loop components.

Reimplemented from Boardcore::ActiveObject.

Definition at line 72 of file HIL.h.

◆ stop()

template<class FlightPhases , class SimulatorData , class ActuatorData >
void Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::stop ( )
inlinevirtual

Signals the runner thread to terminate and joins the thread.

This is a blocking call that will not return until the thread terminates! Your run() implementation must check shouldStop() and terminate ASAP if it returns true.

Reimplemented from Boardcore::ActiveObject.

Definition at line 97 of file HIL.h.

◆ waitStartSimulation()

template<class FlightPhases , class SimulatorData , class ActuatorData >
void Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::waitStartSimulation ( )
inline

Definition at line 105 of file HIL.h.

Member Data Documentation

◆ hilPhasesManager

template<class FlightPhases , class SimulatorData , class ActuatorData >
HILPhasesManager<FlightPhases, SimulatorData, ActuatorData>* Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::hilPhasesManager
protected

Definition at line 133 of file HIL.h.

◆ hilTransceiver

template<class FlightPhases , class SimulatorData , class ActuatorData >
HILTransceiver<FlightPhases, SimulatorData, ActuatorData>* Boardcore::HIL< FlightPhases, SimulatorData, ActuatorData >::hilTransceiver
protected

Definition at line 131 of file HIL.h.


The documentation for this class was generated from the following file: