DUNE: Uniform Navigational Environment  2016.09.0
Actuators::SCRTv4::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onEntityReservation (void)
 
void onResourceRelease (void)
 
void onResourceAcquisition (void)
 
void onResourceInitialization (void)
 
void consume (const IMC::SetServoPosition *msg)
 
bool readConstantParameters (void)
 
bool readEffectiveParameters (void)
 
bool startContinuous (void)
 
bool stopContinuous (void)
 
LUCL::Command * waitForReply (Commands command, double timeout)
 
bool waitForReplyAndDiscard (Commands command, double timeout)
 
uint8_t convertAngleToDemand (unsigned servo, double angle)
 
void setServoPosition (uint8_t servo, double position)
 
void handleState (LUCL::Command::CommandPayload &cmd)
 
void handleCommand (LUCL::Command *cmd)
 
void dispatchStats (void)
 
void clearStats (void)
 
void onMain (void)
 

Public Attributes

Arguments m_args
 
IMC::ServoPosition m_servo_pos [c_servo_count]
 
IMC::Current m_servo_amp [c_servo_count]
 
SerialPort * m_uart
 
Listenerm_listener
 
double m_exc_min [c_servo_count]
 
double m_exc_max [c_servo_count]
 
uint8_t m_demand_res
 
unsigned m_stat_invalid
 
unsigned m_stat_error
 
unsigned m_stat_timeout
 
Counter< double > m_wdog
 

Constructor & Destructor Documentation

Actuators::SCRTv4::Task::Task ( const std::string &  name,
Tasks::Context &  ctx 
)
inline

Member Function Documentation

void Actuators::SCRTv4::Task::clearStats ( void  )
inline
void Actuators::SCRTv4::Task::consume ( const IMC::SetServoPosition *  msg)
inline

References setServoPosition().

uint8_t Actuators::SCRTv4::Task::convertAngleToDemand ( unsigned  servo,
double  angle 
)
inline
void Actuators::SCRTv4::Task::dispatchStats ( void  )
inline
void Actuators::SCRTv4::Task::handleCommand ( LUCL::Command *  cmd)
inline
void Actuators::SCRTv4::Task::handleState ( LUCL::Command::CommandPayload &  cmd)
inline
void Actuators::SCRTv4::Task::onEntityReservation ( void  )
inline

References m_servo_amp, and m_servo_pos.

void Actuators::SCRTv4::Task::onResourceAcquisition ( void  )
inline
void Actuators::SCRTv4::Task::onResourceInitialization ( void  )
inline
void Actuators::SCRTv4::Task::onResourceRelease ( void  )
inline

References m_listener, and m_uart.

bool Actuators::SCRTv4::Task::readConstantParameters ( void  )
inline
bool Actuators::SCRTv4::Task::readEffectiveParameters ( void  )
inline
void Actuators::SCRTv4::Task::setServoPosition ( uint8_t  servo,
double  position 
)
inline
bool Actuators::SCRTv4::Task::startContinuous ( void  )
inline
bool Actuators::SCRTv4::Task::stopContinuous ( void  )
inline
LUCL::Command* Actuators::SCRTv4::Task::waitForReply ( Commands  command,
double  timeout 
)
inline
bool Actuators::SCRTv4::Task::waitForReplyAndDiscard ( Commands  command,
double  timeout 
)
inline

References waitForReply().

Referenced by startContinuous(), and stopContinuous().

Member Data Documentation

Arguments Actuators::SCRTv4::Task::m_args
uint8_t Actuators::SCRTv4::Task::m_demand_res

Demand resolution.

Referenced by convertAngleToDemand(), and readConstantParameters().

double Actuators::SCRTv4::Task::m_exc_max[c_servo_count]

Maximum excursion (º).

Referenced by convertAngleToDemand(), and readEffectiveParameters().

double Actuators::SCRTv4::Task::m_exc_min[c_servo_count]

Minimum excursion (º).

Referenced by convertAngleToDemand(), handleState(), and readEffectiveParameters().

Listener* Actuators::SCRTv4::Task::m_listener

Command listener.

Referenced by onMain(), onResourceAcquisition(), onResourceRelease(), and waitForReply().

IMC::Current Actuators::SCRTv4::Task::m_servo_amp[c_servo_count]

Current messages.

Referenced by handleState(), and onEntityReservation().

IMC::ServoPosition Actuators::SCRTv4::Task::m_servo_pos[c_servo_count]

Servo position messages.

Referenced by handleState(), and onEntityReservation().

unsigned Actuators::SCRTv4::Task::m_stat_error

Count of communication errors.

Referenced by clearStats(), dispatchStats(), and handleCommand().

unsigned Actuators::SCRTv4::Task::m_stat_invalid

Count of invalid checksums.

Referenced by clearStats(), dispatchStats(), and handleCommand().

unsigned Actuators::SCRTv4::Task::m_stat_timeout

Count of command timeouts.

Referenced by clearStats(), dispatchStats(), and waitForReply().

SerialPort* Actuators::SCRTv4::Task::m_uart
Counter<double> Actuators::SCRTv4::Task::m_wdog

Watchdog.

Referenced by handleState(), onMain(), and onResourceInitialization().

Collaboration diagram for Actuators::SCRTv4::Task:
Collaboration graph