DUNE: Uniform Navigational Environment
2016.05.0
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onUpdateParameters (void) |
~Task (void) | |
void | onEntityReservation (void) |
void | onResourceAcquisition (void) |
void | setup (void) |
bool | getEEPROM (uint8_t command, const uint8_t *data=NULL, size_t data_size=0) |
bool | updateConfigArea (uint8_t command, std::vector< uint8_t > &dev_values, const std::vector< uint8_t > &new_values) |
bool | setupConfigGeneral (void) |
bool | setupConfigDCYC (void) |
bool | setupConfigIADC (void) |
bool | setupConfigERPM (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 | reportEntityState (void) |
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 |
uint8_t | m_dev_errors |
unsigned | m_motor_id |
bool | m_legacy |
Counter< double > | m_boot_timer |
Counter< double > | m_state_timer |
Counter< double > | m_wdog |
Counter< double > | m_wdog_setup |
Counter< double > | m_estate_timer |
size_t | m_sample_count |
size_t | m_faults_count |
size_t | m_timeout_count |
std::vector< unsigned > | m_version |
std::vector< uint8_t > | m_eep_config |
std::vector< uint8_t > | m_eep_dcyc |
std::vector< uint8_t > | m_eep_iadc |
std::vector< uint8_t > | m_eep_erpm |
SetupState | m_setup_state |
Arguments | m_args |
|
inline |
References Actuators::Broom::Arguments::actuation_wdt, Actuators::Broom::Arguments::bridge_elabel, Actuators::Broom::Arguments::bridge_temp_hyst, Actuators::Broom::Arguments::bridge_temp_max, Actuators::Broom::Arguments::ctl_dcyc_inc, Actuators::Broom::Arguments::ctl_dcyc_max, Actuators::Broom::Arguments::ctl_dcyc_negl, Actuators::Broom::Arguments::ctl_erpm_inc, Actuators::Broom::Arguments::ctl_erpm_max, Actuators::Broom::Arguments::ctl_erpm_negl, Actuators::Broom::Arguments::ctl_iadc_inc, Actuators::Broom::Arguments::ctl_iadc_max, Actuators::Broom::Arguments::ctl_iadc_negl, Actuators::Broom::Arguments::current_raw_offset, Actuators::Broom::Arguments::desired_speed, Actuators::Broom::Arguments::inv_rotation, m_args, Actuators::Broom::Arguments::max_rpm, Actuators::Broom::Arguments::mcu_elabel, Actuators::Broom::Arguments::motor_elabel, Actuators::Broom::Arguments::motor_id, Actuators::Broom::Arguments::motor_temp_hyst, Actuators::Broom::Arguments::motor_temp_max, Actuators::Broom::Arguments::pole_pairs, Actuators::Broom::Arguments::state_per, Actuators::Broom::Arguments::thrust_ctl_mode, Actuators::Broom::Arguments::timeout_error, Actuators::Broom::Arguments::timeout_failure, and Actuators::Broom::Arguments::uart_dev.
|
inline |
|
inline |
References m_motor_id, and setRefThrust().
|
inline |
References Actuators::Broom::Arguments::desired_speed, m_args, setRefRPM(), and setRefThrust().
|
inline |
References Actuators::Broom::ERR_NONE, m_dev_errors, m_proto, m_timeout_count, and waitForCommand().
Referenced by updateConfigArea().
|
inline |
References Actuators::Broom::c_dev_error_strings, Actuators::Broom::CMD_ACTUATE, Actuators::Broom::CMD_CONFIG, Actuators::Broom::CMD_CONFIG_DCYC, Actuators::Broom::CMD_CONFIG_ERPM, Actuators::Broom::CMD_CONFIG_IADC, Actuators::Broom::CMD_DEBUG, Actuators::Broom::CMD_STATE, Actuators::Broom::ERR_INIT, Actuators::Broom::ERR_POWER, Actuators::Broom::Arguments::inv_rotation, m_args, m_boot_timer, m_bridge_ent, m_dev_errors, m_eep_config, m_eep_dcyc, m_eep_erpm, m_eep_iadc, m_legacy, m_mcu_ent, m_motor_ent, m_proto, DUNE::Time::Counter< T >::overflow(), and Actuators::Broom::Arguments::pole_pairs.
Referenced by waitForCommand().
|
inline |
|
inline |
References m_args, m_boot_timer, m_proto, DUNE::Time::Counter< T >::setTop(), and Actuators::Broom::Arguments::uart_dev.
|
inline |
References m_args, m_motor_id, m_state_timer, m_thrust_ctl_mode, m_wdog, Actuators::Broom::MODE_CURRENT, Actuators::Broom::MODE_NONE, Actuators::Broom::MODE_RPM, Actuators::Broom::MODE_VOLTAGE, Actuators::Broom::Arguments::motor_id, DUNE::Time::Counter< T >::setTop(), Actuators::Broom::Arguments::state_per, Actuators::Broom::Arguments::thrust_ctl_mode, and Actuators::Broom::Arguments::timeout_error.
|
inline |
References m_legacy, and m_version.
Referenced by waitForCommand().
|
inline |
References DUNE::Time::Counter< T >::getElapsed(), m_args, m_boot_timer, m_dev_errors, m_estate_timer, m_faults_count, m_sample_count, m_timeout_count, m_wdog, DUNE::Time::Counter< T >::overflow(), DUNE::Time::Counter< T >::reset(), and Actuators::Broom::Arguments::timeout_failure.
Referenced by task().
|
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 Actuators::Broom::Arguments::ctl_iadc_max, m_actuation, m_args, m_ctl_mode, 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 Actuators::Broom::Arguments::ctl_iadc_max, m_args, m_ctl_mode, m_thrust_ctl_mode, 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 |
References m_proto, m_setup_state, m_version, m_wdog_setup, DUNE::Time::Counter< T >::overflow(), DUNE::Time::Counter< T >::setTop(), setupConfigDCYC(), setupConfigERPM(), setupConfigGeneral(), setupConfigIADC(), Actuators::Broom::SS_CONFIG, Actuators::Broom::SS_CONFIG_DCYC, Actuators::Broom::SS_CONFIG_ERPM, Actuators::Broom::SS_CONFIG_IADC, Actuators::Broom::SS_DONE, Actuators::Broom::SS_VERSION_GET, Actuators::Broom::SS_VERSION_WAIT, and waitForCommand().
Referenced by task().
|
inline |
|
inline |
|
inline |
References Actuators::Broom::Arguments::actuation_wdt, Actuators::Broom::Arguments::bridge_temp_hyst, Actuators::Broom::Arguments::bridge_temp_max, Actuators::Broom::CMD_CONFIG, Actuators::Broom::Arguments::current_raw_offset, m_args, m_eep_config, Actuators::Broom::Arguments::motor_temp_hyst, Actuators::Broom::Arguments::motor_temp_max, and updateConfigArea().
Referenced by setup().
|
inline |
|
inline |
References Actuators::Broom::CMD_ACTUATE, Actuators::Broom::CMD_STATE, m_actuation, m_ctl_mode, m_dev_errors, m_proto, m_setup_state, m_state_timer, m_timeout_count, DUNE::Time::Counter< T >::overflow(), reportEntityState(), DUNE::Time::Counter< T >::reset(), setup(), Actuators::Broom::SS_DONE, and waitForCommand().
|
inline |
References Actuators::Broom::CMD_CONFIG, and getEEPROM().
Referenced by setupConfigDCYC(), setupConfigERPM(), setupConfigGeneral(), and setupConfigIADC().
|
inline |
References m_faults_count, m_proto, m_sample_count, m_wdog, onCommand(), onVersion(), and DUNE::Time::Counter< T >::reset().
Referenced by getEEPROM(), setup(), and task().
int16_t Actuators::Broom::Task::m_actuation |
Actuation command.
Referenced by setRefCurrent(), setRefDcycle(), setRefRPM(), and task().
Arguments Actuators::Broom::Task::m_args |
Counter<double> Actuators::Broom::Task::m_boot_timer |
Used to silence some spurious boot errors.
Referenced by onCommand(), onResourceAcquisition(), and reportEntityState().
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 getEEPROM(), onCommand(), reportEntityState(), and task().
std::vector<uint8_t> Actuators::Broom::Task::m_eep_config |
EEPROM - General Config Area.
Referenced by onCommand(), and setupConfigGeneral().
std::vector<uint8_t> Actuators::Broom::Task::m_eep_dcyc |
EEPROM - DCYC Config Area.
Referenced by onCommand(), and setupConfigDCYC().
std::vector<uint8_t> Actuators::Broom::Task::m_eep_erpm |
EEPROM - RPM Config Area.
Referenced by onCommand(), and setupConfigERPM().
std::vector<uint8_t> Actuators::Broom::Task::m_eep_iadc |
EEPROM - IADC Config Area.
Referenced by onCommand(), and setupConfigIADC().
Counter<double> Actuators::Broom::Task::m_estate_timer |
Entity state timer.
Referenced by reportEntityState().
size_t Actuators::Broom::Task::m_faults_count |
Faults count.
Referenced by reportEntityState(), and waitForCommand().
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().
unsigned Actuators::Broom::Task::m_motor_id |
Motor identifier.
Referenced by consume(), and onUpdateParameters().
Hardware::LUCL::Protocol Actuators::Broom::Task::m_proto |
Device protocol handler.
Referenced by getEEPROM(), onCommand(), onResourceAcquisition(), setup(), task(), and waitForCommand().
IMC::Rpm Actuators::Broom::Task::m_rpms |
RPMs message.
size_t Actuators::Broom::Task::m_sample_count |
Sample count.
Referenced by reportEntityState(), and waitForCommand().
SetupState Actuators::Broom::Task::m_setup_state |
Counter<double> Actuators::Broom::Task::m_state_timer |
State update timer.
Referenced by onUpdateParameters(), and task().
DevControlModes Actuators::Broom::Task::m_thrust_ctl_mode |
Thrust control mode.
Referenced by onUpdateParameters(), and setRefThrust().
size_t Actuators::Broom::Task::m_timeout_count |
Timeout count.
Referenced by getEEPROM(), reportEntityState(), and task().
std::vector<unsigned> Actuators::Broom::Task::m_version |
Version.
Referenced by onVersion(), and setup().
Counter<double> Actuators::Broom::Task::m_wdog |
Watchdog.
Referenced by onUpdateParameters(), reportEntityState(), and waitForCommand().
Counter<double> Actuators::Broom::Task::m_wdog_setup |
Setup watchdog.
Referenced by setup().