DUNE: Uniform Navigational Environment
2.6.1
|
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 |
Entities::BasicEntity * | m_motor_ent |
Entities::BasicEntity * | m_bridge_ent |
Entities::BasicEntity * | m_mcu_ent |
double | m_last_state |
Arguments | m_args |
uint8_t | m_dev_errors |
bool | m_legacy |
|
inline |
References Actuators::Broom::Arguments::bridge_elabel, Actuators::Broom::Arguments::desired_speed, Actuators::Broom::Arguments::inv_rotation, m_args, m_last_state, Actuators::Broom::Arguments::max_phase_current, Actuators::Broom::Arguments::max_rpm, Actuators::Broom::Arguments::mcu_elabel, Actuators::Broom::Arguments::motor_elabel, Actuators::Broom::Arguments::pole_pairs, Actuators::Broom::Arguments::state_per, Actuators::Broom::Arguments::thrust_ctl_mode, and Actuators::Broom::Arguments::uart_dev.
|
inline |
|
inline |
References setRefThrust().
|
inline |
References Actuators::Broom::Arguments::desired_speed, m_args, setRefRPM(), and setRefThrust().
|
inline |
References Actuators::Broom::c_dev_error_strings, Actuators::Broom::CMD_ACTUATE, Actuators::Broom::CMD_DEBUG, Actuators::Broom::CMD_STATE, Actuators::Broom::ERR_INIT, Actuators::Broom::ERR_POWER, Actuators::Broom::Arguments::inv_rotation, m_args, m_bridge_ent, m_dev_errors, m_legacy, m_mcu_ent, m_motor_ent, m_proto, and Actuators::Broom::Arguments::pole_pairs.
Referenced by waitForCommand().
|
inline |
|
inline |
References m_args, m_proto, and Actuators::Broom::Arguments::uart_dev.
|
inline |
|
inline |
References m_legacy.
Referenced by waitForCommand().
|
inline |
Sanitize the actuation reference (limits and sign)
[in] | value | actuation reference value to be sanitized |
References Actuators::Broom::Arguments::inv_rotation, m_args, and DUNE::Math::trimValue().
Referenced by setRefCurrent(), setRefDcycle(), and setRefRPM().
|
inline |
Set phase current value as actuation reference.
[in] | value | phase 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().
|
inline |
Set percentage of duty cycle as actuation reference.
[in] | value | percentage 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().
|
inline |
Set rotor Rotations Per Minute value as actuation reference.
[in] | value | rotor 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().
|
inline |
Set thrust actuation reference, using the mode configured for the task.
[in] | value | percentage of thrust from -1 to 1 |
References m_args, m_ctl_mode, m_thrust_ctl_mode, Actuators::Broom::Arguments::max_phase_current, Actuators::Broom::Arguments::max_rpm, Actuators::Broom::MODE_CURRENT, Actuators::Broom::MODE_NONE, Actuators::Broom::MODE_RPM, Actuators::Broom::MODE_VOLTAGE, setRefCurrent(), setRefDcycle(), and setRefRPM().
Referenced by consume().
|
inline |
|
inline |
References m_proto, onCommand(), and onVersion().
Referenced by task().
int16_t Actuators::Broom::Task::m_actuation |
Actuation command.
Referenced by setRefCurrent(), setRefDcycle(), setRefRPM(), and task().
Arguments Actuators::Broom::Task::m_args |
Task arguments.
Referenced by consume(), onCommand(), onEntityReservation(), onResourceAcquisition(), onUpdateParameters(), sanitizeRef(), setRefCurrent(), setRefRPM(), setRefThrust(), Task(), and task().
Entities::BasicEntity* Actuators::Broom::Task::m_bridge_ent |
Bridge entity.
Referenced by onCommand(), and onEntityReservation().
DevControlModes Actuators::Broom::Task::m_ctl_mode |
Control mode.
Referenced by setRefCurrent(), setRefDcycle(), setRefRPM(), setRefThrust(), and task().
uint8_t Actuators::Broom::Task::m_dev_errors |
Device error mask.
Referenced by onCommand(), and task().
bool Actuators::Broom::Task::m_legacy |
Enable legacy protocol.
Referenced by onCommand(), and onVersion().
Entities::BasicEntity* Actuators::Broom::Task::m_mcu_ent |
MCU entity.
Referenced by onCommand(), and onEntityReservation().
Entities::BasicEntity* Actuators::Broom::Task::m_motor_ent |
Motor entity.
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.
DevControlModes Actuators::Broom::Task::m_thrust_ctl_mode |
Thrust control mode.
Referenced by onUpdateParameters(), and setRefThrust().