DUNE: Uniform Navigational Environment
2016.09.0
|
Motor simulator task
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onResourceRelease (void) |
void | onResourceAcquisition (void) |
void | onResourceInitialization (void) |
void | onActivation (void) |
void | onDeactivation (void) |
void | reset (void) |
void | consume (const IMC::Brake *msg) |
void | consume (const IMC::Rpm *msg) |
void | consume (const IMC::EstimatedState *msg) |
void | consume (const IMC::DesiredSpeed *msg) |
void | consume (const IMC::DesiredZ *msg) |
void | consume (const IMC::ControlLoops *msg) |
void | task (void) |
void | onIdle (void) |
void | onChecking (void) |
void | onSubmerged (void) |
void | onForcing (void) |
bool | increaseSpeed (void) |
bool | hasZReference (void) |
Public Attributes | |
uint32_t | m_aloops |
MachineStates | m_mstate |
IMC::DesiredSpeed | m_forced_speed |
IMC::DesiredSpeed | m_dspeed |
IMC::DesiredZ | m_z_ref |
unsigned | m_incs |
float | m_speed_inc |
Time::Counter< float > * | m_counter_solo |
Time::Counter< float > * | m_counter_step |
float | m_rpm |
float | m_depth |
float | m_alt |
bool | m_got_data |
bool | m_last_try |
bool | m_braking |
uint32_t | m_scope_ref |
Arguments | m_args |
|
inline |
|
inline |
|
inline |
References m_rpm.
|
inline |
|
inline |
References m_dspeed.
|
inline |
References m_z_ref.
|
inline |
References m_aloops, m_scope_ref, and reset().
|
inline |
Check if we have depth/altitude reference.
References Control::AUV::Diving::Arguments::depth_threshold, m_alt, m_args, m_depth, and m_z_ref.
Referenced by onChecking(), onForcing(), and onSubmerged().
|
inline |
Increase desired speed.
References m_args, m_counter_step, m_dspeed, m_forced_speed, m_incs, m_speed_inc, Control::AUV::Diving::Arguments::max_increase, and Control::AUV::Diving::Arguments::speed_step.
Referenced by onChecking(), and onForcing().
|
inline |
On activation.
|
inline |
Checking state machine routine.
References Control::AUV::Diving::Arguments::depth_threshold, hasZReference(), increaseSpeed(), m_args, m_counter_solo, m_counter_step, m_depth, m_dspeed, m_mstate, Control::AUV::Diving::SM_FORCING, Control::AUV::Diving::SM_IDLE, and Control::AUV::Diving::SM_SUBMERGED.
Referenced by task().
|
inline |
On deactivation.
|
inline |
Forcing state machine routine.
References Control::AUV::Diving::Arguments::depth_threshold, hasZReference(), increaseSpeed(), m_args, m_counter_solo, m_counter_step, m_depth, m_dspeed, m_incs, m_last_try, m_mstate, reset(), Control::AUV::Diving::SM_IDLE, and Control::AUV::Diving::SM_SUBMERGED.
Referenced by task().
|
inline |
Idle state machine routine.
References Control::AUV::Diving::Arguments::depth_threshold, m_args, m_counter_solo, m_depth, m_dspeed, m_mstate, m_rpm, m_z_ref, Control::AUV::Diving::SM_CHECKING, and Control::AUV::Diving::Arguments::speed_tol.
Referenced by task().
|
inline |
Acquire resources.
References m_args, m_counter_solo, m_counter_step, Control::AUV::Diving::Arguments::time_solo, and Control::AUV::Diving::Arguments::time_step.
|
inline |
Initialize resources.
References reset().
|
inline |
Release resources.
References m_counter_solo, and m_counter_step.
|
inline |
Submerged state machine routine.
References Control::AUV::Diving::Arguments::depth_threshold, hasZReference(), m_args, m_counter_solo, m_depth, m_mstate, Control::AUV::Diving::SM_CHECKING, and Control::AUV::Diving::SM_IDLE.
Referenced by task().
|
inline |
Reset all variables.
References m_alt, m_counter_solo, m_counter_step, m_depth, m_dspeed, m_got_data, m_incs, m_last_try, m_mstate, m_rpm, m_speed_inc, m_z_ref, and Control::AUV::Diving::SM_IDLE.
Referenced by consume(), onForcing(), and onResourceInitialization().
|
inline |
uint32_t Control::AUV::Diving::Task::m_aloops |
Active loops.
Referenced by consume().
float Control::AUV::Diving::Task::m_alt |
Vehicle's altitude (if any)
Referenced by consume(), hasZReference(), reset(), and task().
Arguments Control::AUV::Diving::Task::m_args |
Task arguments.
Referenced by hasZReference(), increaseSpeed(), onChecking(), onForcing(), onIdle(), onResourceAcquisition(), onSubmerged(), and Task().
Time::Counter<float>* Control::AUV::Diving::Task::m_counter_solo |
Timer counter for solo attempt.
Referenced by consume(), onChecking(), onForcing(), onIdle(), onResourceAcquisition(), onResourceRelease(), onSubmerged(), and reset().
Time::Counter<float>* Control::AUV::Diving::Task::m_counter_step |
Timer counter for each speed increase step.
Referenced by consume(), increaseSpeed(), onChecking(), onForcing(), onResourceAcquisition(), onResourceRelease(), and reset().
float Control::AUV::Diving::Task::m_depth |
Vehicle's depth.
Referenced by consume(), hasZReference(), onChecking(), onForcing(), onIdle(), onSubmerged(), reset(), and task().
IMC::DesiredSpeed Control::AUV::Diving::Task::m_dspeed |
Last received desired speed.
Referenced by consume(), increaseSpeed(), onChecking(), onForcing(), onIdle(), reset(), and task().
IMC::DesiredSpeed Control::AUV::Diving::Task::m_forced_speed |
Forced desired speed.
Referenced by increaseSpeed().
bool Control::AUV::Diving::Task::m_got_data |
unsigned Control::AUV::Diving::Task::m_incs |
Number of speed increases.
Referenced by increaseSpeed(), onForcing(), and reset().
bool Control::AUV::Diving::Task::m_last_try |
On last attempt.
Referenced by consume(), onForcing(), and reset().
MachineStates Control::AUV::Diving::Task::m_mstate |
State machine state.
Referenced by consume(), onChecking(), onForcing(), onIdle(), onSubmerged(), reset(), and task().
float Control::AUV::Diving::Task::m_rpm |
uint32_t Control::AUV::Diving::Task::m_scope_ref |
float Control::AUV::Diving::Task::m_speed_inc |
Speed amount to increase.
Referenced by increaseSpeed(), and reset().
IMC::DesiredZ Control::AUV::Diving::Task::m_z_ref |
Last received desired z.
Referenced by consume(), hasZReference(), onIdle(), reset(), and task().