DUNE: Uniform Navigational Environment  2.4.1
Actuators::Broom::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
 ~Task (void)
 
void onEntityReservation (void)
 
void onResourceAcquisition (void)
 
void onCommand (uint8_t cmd, const uint8_t *data, int data_size)
 
void onVersion (unsigned major, unsigned minor, unsigned patch)
 
int16_t sanitizeRef (int16_t value)
 
void setRefDcycle (float value)
 
void setRefCurrent (float value)
 
void setRefRPM (int value)
 
void setRefThrust (float value)
 
void consume (const IMC::SetThrusterActuation *msg)
 
void consume (const IMC::DesiredSpeed *msg)
 
bool waitForCommand (uint8_t code)
 
void task (void)
 

Public Attributes

Hardware::LUCL::Protocol m_proto
 
int16_t m_actuation
 
DevControlModes m_ctl_mode
 
DevControlModes m_thrust_ctl_mode
 
IMC::Rpm m_rpms
 
IMC::Current m_current
 
IMC::Current m_bridge_current
 
IMC::Temperature m_motor_temp
 
IMC::Temperature m_bridge_temp
 
IMC::Voltage m_bridge_volt
 
IMC::Temperature m_mcu_temp
 
IMC::Voltage m_mcu_volt
 
IMC::Voltage m_motor_volt
 
double m_last_state
 
Arguments m_args
 
uint8_t m_dev_errors
 
bool m_legacy
 

Constructor & Destructor Documentation

Actuators::Broom::Task::~Task ( void  )
inline

Member Function Documentation

void Actuators::Broom::Task::consume ( const IMC::SetThrusterActuation *  msg)
inline

References setRefThrust().

void Actuators::Broom::Task::consume ( const IMC::DesiredSpeed *  msg)
inline
void Actuators::Broom::Task::onResourceAcquisition ( void  )
inline
void Actuators::Broom::Task::onVersion ( unsigned  major,
unsigned  minor,
unsigned  patch 
)
inline

References m_legacy.

Referenced by waitForCommand().

int16_t Actuators::Broom::Task::sanitizeRef ( int16_t  value)
inline

Sanitize the actuation reference (limits and sign)

Parameters
[in]valueactuation reference value to be sanitized

References Actuators::Broom::Arguments::inv_rotation, m_args, and DUNE::Math::trimValue().

Referenced by setRefCurrent(), setRefDcycle(), and setRefRPM().

void Actuators::Broom::Task::setRefCurrent ( float  value)
inline

Set phase current value as actuation reference.

Parameters
[in]valuephase current reference in Ampere

References m_actuation, m_args, m_ctl_mode, Actuators::Broom::Arguments::max_phase_current, Actuators::Broom::MODE_CURRENT, sanitizeRef(), and DUNE::Math::trimValue().

Referenced by setRefThrust().

void Actuators::Broom::Task::setRefDcycle ( float  value)
inline

Set percentage of duty cycle as actuation reference.

Parameters
[in]valuepercentage reference from -1.0 to 1.0

References m_actuation, m_ctl_mode, Actuators::Broom::MODE_VOLTAGE, sanitizeRef(), and DUNE::Math::trimValue().

Referenced by setRefThrust().

void Actuators::Broom::Task::setRefRPM ( int  value)
inline

Set rotor Rotations Per Minute value as actuation reference.

Parameters
[in]valuerotor angular velocity reference in Rotations Per Minute

References m_actuation, m_args, m_ctl_mode, Actuators::Broom::MODE_RPM, Actuators::Broom::Arguments::pole_pairs, and sanitizeRef().

Referenced by consume(), and setRefThrust().

void Actuators::Broom::Task::setRefThrust ( float  value)
inline
bool Actuators::Broom::Task::waitForCommand ( uint8_t  code)
inline

References m_proto, onCommand(), and onVersion().

Referenced by task().

Member Data Documentation

int16_t Actuators::Broom::Task::m_actuation

Actuation command.

Referenced by setRefCurrent(), setRefDcycle(), setRefRPM(), and task().

IMC::Current Actuators::Broom::Task::m_bridge_current

Bridge current message.

Referenced by onCommand(), and onEntityReservation().

IMC::Temperature Actuators::Broom::Task::m_bridge_temp

Bridge temperature message.

Referenced by onCommand(), and onEntityReservation().

IMC::Voltage Actuators::Broom::Task::m_bridge_volt

Bridge voltage message.

Referenced by onCommand(), and onEntityReservation().

DevControlModes Actuators::Broom::Task::m_ctl_mode
IMC::Current Actuators::Broom::Task::m_current

Motor phase current message.

Referenced by onCommand(), and onEntityReservation().

uint8_t Actuators::Broom::Task::m_dev_errors

Device error mask.

Referenced by onCommand(), and task().

double Actuators::Broom::Task::m_last_state

Last state request.

Referenced by Task(), and task().

bool Actuators::Broom::Task::m_legacy

Enable legacy protocol.

Referenced by onCommand(), and onVersion().

IMC::Temperature Actuators::Broom::Task::m_mcu_temp

MCU temperature message.

Referenced by onCommand(), and onEntityReservation().

IMC::Voltage Actuators::Broom::Task::m_mcu_volt

MCU voltage message.

Referenced by onCommand(), and onEntityReservation().

IMC::Temperature Actuators::Broom::Task::m_motor_temp

Motor temperature message.

Referenced by onCommand(), and onEntityReservation().

IMC::Voltage Actuators::Broom::Task::m_motor_volt

Motor voltage message.

Referenced by onCommand(), and onEntityReservation().

Hardware::LUCL::Protocol Actuators::Broom::Task::m_proto

Device protocol handler.

Referenced by onCommand(), onResourceAcquisition(), task(), and waitForCommand().

IMC::Rpm Actuators::Broom::Task::m_rpms

RPMs message.

Referenced by onCommand(), and onEntityReservation().

DevControlModes Actuators::Broom::Task::m_thrust_ctl_mode

Thrust control mode.

Referenced by onUpdateParameters(), and setRefThrust().

Collaboration diagram for Actuators::Broom::Task:
Collaboration graph