DUNE: Uniform Navigational Environment  2019.02.0
Simulators::Servos::Task Struct Reference

Detailed Description

Servos simulator task

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void onResourceAcquisition (void)
 
void onResourceRelease (void)
 
void onResourceInitialization (void)
 
void consume (const IMC::SetServoPosition *msg)
 
void consume (const IMC::SimulatedState *msg)
 
void onMain (void)
 

Public Attributes

IMC::ServoPosition m_positions [c_servo_count]
 
IMC::SetServoPosition m_commands [c_servo_count]
 
Random::Generatorm_prng
 
double m_last_time
 
double m_fault_timer
 
bool m_faulted
 
int m_servo_in_fault
 
Arguments m_args
 

Constructor & Destructor Documentation

Member Function Documentation

void Simulators::Servos::Task::consume ( const IMC::SimulatedState *  msg)
inline
void Simulators::Servos::Task::onMain ( void  )
inline
void Simulators::Servos::Task::onResourceAcquisition ( void  )
inline
void Simulators::Servos::Task::onResourceInitialization ( void  )
inline

Initialize resources.

References m_last_time, and m_positions.

void Simulators::Servos::Task::onResourceRelease ( void  )
inline

Release resources.

References m_prng.

void Simulators::Servos::Task::onUpdateParameters ( void  )
inline

Member Data Documentation

Arguments Simulators::Servos::Task::m_args
IMC::SetServoPosition Simulators::Servos::Task::m_commands[c_servo_count]

Message for SetServoPosition.

Referenced by consume().

double Simulators::Servos::Task::m_fault_timer

Fault timer counter.

Referenced by consume().

bool Simulators::Servos::Task::m_faulted

Flag to signal a fault has already been generated.

Referenced by consume().

double Simulators::Servos::Task::m_last_time

Last time a setservoposition message was received.

Referenced by consume(), and onResourceInitialization().

IMC::ServoPosition Simulators::Servos::Task::m_positions[c_servo_count]

Message for servo positions.

Referenced by consume(), and onResourceInitialization().

Random::Generator* Simulators::Servos::Task::m_prng

PRNG handle.

Referenced by consume(), onResourceAcquisition(), and onResourceRelease().

int Simulators::Servos::Task::m_servo_in_fault

Number of faulty servo.

Referenced by consume().

Collaboration diagram for Simulators::Servos::Task:
Collaboration graph