DUNE: Uniform Navigational Environment  2016.09.0
Control::AUV::Diving::Task Struct Reference

Detailed Description

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
 

Constructor & Destructor Documentation

Member Function Documentation

void Control::AUV::Diving::Task::consume ( const IMC::Brake *  msg)
inline
void Control::AUV::Diving::Task::consume ( const IMC::Rpm *  msg)
inline

References m_rpm.

void Control::AUV::Diving::Task::consume ( const IMC::EstimatedState *  msg)
inline

References m_alt, and m_depth.

void Control::AUV::Diving::Task::consume ( const IMC::DesiredSpeed *  msg)
inline

References m_dspeed.

void Control::AUV::Diving::Task::consume ( const IMC::DesiredZ *  msg)
inline

References m_z_ref.

void Control::AUV::Diving::Task::consume ( const IMC::ControlLoops *  msg)
inline

References m_aloops, m_scope_ref, and reset().

bool Control::AUV::Diving::Task::hasZReference ( void  )
inline

Check if we have depth/altitude reference.

Returns
true if we do, false otherwise

References Control::AUV::Diving::Arguments::depth_threshold, m_alt, m_args, m_depth, and m_z_ref.

Referenced by onChecking(), onForcing(), and onSubmerged().

bool Control::AUV::Diving::Task::increaseSpeed ( void  )
inline

Increase desired speed.

Returns
true if was able to increase speed, false otherwise

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().

void Control::AUV::Diving::Task::onActivation ( void  )
inline

On activation.

void Control::AUV::Diving::Task::onDeactivation ( void  )
inline

On deactivation.

void Control::AUV::Diving::Task::onForcing ( void  )
inline
void Control::AUV::Diving::Task::onIdle ( void  )
inline
void Control::AUV::Diving::Task::onResourceAcquisition ( void  )
inline
void Control::AUV::Diving::Task::onResourceInitialization ( void  )
inline

Initialize resources.

References reset().

void Control::AUV::Diving::Task::onResourceRelease ( void  )
inline

Release resources.

References m_counter_solo, and m_counter_step.

void Control::AUV::Diving::Task::onSubmerged ( void  )
inline
void Control::AUV::Diving::Task::reset ( void  )
inline

Member Data Documentation

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
bool Control::AUV::Diving::Task::m_braking

Braking flag.

Referenced by consume(), and task().

Time::Counter<float>* Control::AUV::Diving::Task::m_counter_solo
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
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

Got necessary data to proceed.

Referenced by reset(), and task().

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

Motor's rpms.

Referenced by consume(), onIdle(), reset(), and task().

uint32_t Control::AUV::Diving::Task::m_scope_ref

Control loops last reference.

Referenced by consume().

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().

Collaboration diagram for Control::AUV::Diving::Task:
Collaboration graph