Skyward boardcore
|
HILTransceiver is a Singleton and provides an easy interface for the control algorithms to send and receive data during a simulation. More...
#include <HILTransceiver.h>
Public Member Functions | |
HILTransceiver (USART &hilSerial, HILPhasesManager< FlightPhases, SimulatorData, ActuatorData > *hilPhasesManager) | |
Construct a serial connection attached to a control algorithm. | |
void | setActuatorData (ActuatorData actuatorData) |
sets the actuator data and then wakes up the MatlabTransceiver thread in order to send the data back to the simulator (called by the control algorithm) | |
const SimulatorData * | getSensorData () const |
returns the reference of the SimulatorData | |
![]() | |
HILTransceiverBase (USART &hilSerial) | |
Construct a serial connection attached to a control algorithm. | |
int | getLostUpdates () const |
Returns the number of lost updates. | |
int64_t | getTimestampSimulatorData () const |
Returns the value in ns of the timestamp of the last received simulatorData. | |
![]() | |
ActiveObject (unsigned int stacksize=miosix::STACK_DEFAULT_FOR_PTHREAD, miosix::Priority priority=miosix::MAIN_PRIORITY) | |
virtual | ~ActiveObject () |
virtual bool | start () |
Start the thread associated with this active object. | |
virtual void | stop () |
Signals the runner thread to terminate and joins the thread. | |
bool | isRunning () |
Additional Inherited Members | |
![]() | |
void | waitActuatorData () |
Waits for the control algorithm(s) to update actuatorData. | |
![]() | |
bool | shouldStop () |
Tells whether or not the ActiveObject should stop its execution. | |
![]() | |
USART & | hilSerial |
bool | receivedFirstPacket = false |
bool | updated = false |
int | nLostUpdates = 0 |
int64_t | timestampSimulatorData = 0 |
miosix::FastMutex | mutex |
miosix::ConditionVariable | condVar |
PrintLogger | logger = Logging::getLogger("HILTransceiver") |
![]() | |
miosix::Thread * | thread = nullptr |
Gives access to the thread object. | |
std::atomic< bool > | stopFlag {false} |
std::atomic< bool > | running {false} |
HILTransceiver is a Singleton and provides an easy interface for the control algorithms to send and receive data during a simulation.
Definition at line 88 of file HILTransceiver.h.
|
inlineexplicit |
Construct a serial connection attached to a control algorithm.
hilSerial | Serial port for the HIL communication. |
Definition at line 96 of file HILTransceiver.h.
|
inline |
returns the reference of the SimulatorData
Definition at line 129 of file HILTransceiver.h.
|
inline |
sets the actuator data and then wakes up the MatlabTransceiver thread in order to send the data back to the simulator (called by the control algorithm)
actuatorData | sets the data that will be sent to the simulator |
Definition at line 111 of file HILTransceiver.h.