DUNE: Uniform Navigational Environment
2019.02.1
|
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onUpdateParameters (void) |
void | onResourceAcquisition (void) |
void | onResourceRelease (void) |
void | onResourceInitialization (void) |
void | onRequestActivation (void) |
void | onActivation (void) |
void | onDeactivation (void) |
void | checkActivationProgress (void) |
void | consume (const IMC::SoundSpeed *msg) |
uint8_t | getIndex (uint8_t value, const uint8_t *table, uint8_t table_size) |
void | setRange (void) |
void | setStartGain (void) |
void | setAbsorption (float absorption) |
void | setStepSize (void) |
void | setProfile (void) |
void | setDataBits (void) |
void | setDataPoints (void) |
void | setProfileMinRange (void) |
void | setSwitchDelay (void) |
void | setFrequency (uint16_t frequency) |
void | updateState (float heading) |
void | setSectorWidth (void) |
void | setTrainAngle (void) |
void | testComms (void) |
void | onMain (void) |
Public Member Functions inherited from DUNE::Tasks::Task | |
Task (const std::string &name, Context &context) | |
virtual | ~Task (void) |
const char * | getName (void) const |
const char * | getSystemName (void) const |
unsigned int | getSystemId (void) const |
unsigned int | getEntityId (void) const |
unsigned int | resolveEntity (const std::string &label) const |
std::string | resolveEntity (unsigned int id) const |
DebugLevel | getDebugLevel (void) const |
uint16_t | getActivationTime (void) const |
uint16_t | getDeactivationTime (void) const |
unsigned int | resolveSystemName (const std::string &name) const |
const char * | resolveSystemId (unsigned int id) const |
void | loadConfig (void) |
void | setPriority (unsigned int value) |
unsigned int | getPriority (void) const |
void | inf (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void | war (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void | err (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void | cri (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void | debug (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void | trace (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void void | spew (const char *format,...) DUNE_PRINTF_FORMAT(2 |
void void void void void void void void | dispatch (IMC::Message *msg, unsigned int flags=0) |
void | dispatch (IMC::Message &msg, unsigned int flags=0) |
void | dispatchReply (const IMC::Message &original, IMC::Message &msg, unsigned int flags=0) |
void | receive (const IMC::Message *msg) |
void | reserveEntities (void) |
void | resolveEntities (void) |
void | acquireResources (void) |
void | releaseResources (void) |
void | initializeResources (void) |
void | updateParameters (bool act_deact=true) |
void | writeParamsXML (std::ostream &os) const |
const char * | getEntityLabel (void) const |
void | setEntityLabel (const std::string &label) |
Public Member Functions inherited from DUNE::Tasks::AbstractTask | |
AbstractTask (void) | |
virtual | ~AbstractTask (void) |
Public Member Functions inherited from DUNE::Concurrency::Thread | |
Thread (void) | |
virtual | ~Thread (void) |
int | getProcessorUsage (void) |
Public Member Functions inherited from DUNE::Concurrency::Runnable | |
Runnable (void) | |
virtual | ~Runnable (void) |
void | start (void) |
void | stop (void) |
void | join (void) |
void | stopAndJoin (void) |
void | setPriority (Scheduler::Policy policy, unsigned priority) |
unsigned | getPriority (void) |
State | getState (void) |
bool | isCreated (void) |
bool | isStopping (void) |
bool | isRunning (void) |
bool | isStarting (void) |
bool | isDead (void) |
Public Attributes | |
SerialPort * | m_uart |
Parser | m_parser |
IMC::Distance | m_distance |
IMC::SonarData | m_sonar |
IMC::DeviceState | m_device_state |
uint8_t | m_sdata [c_sdata_size] |
double | m_sound_speed |
IMC::PowerChannelControl | m_power_channel_control |
Counter< double > | m_countdown |
Counter< double > | m_wdog |
Arguments | m_args |
Additional Inherited Members | |
Public Types inherited from DUNE::Concurrency::Runnable | |
Protected Member Functions inherited from DUNE::Tasks::Task | |
void | setEntityState (IMC::EntityState::StateEnum state, Status::Code code) |
void | setEntityState (IMC::EntityState::StateEnum state, const std::string &description) |
IMC::EntityState::StateEnum | getEntityState (void) const |
unsigned int | reserveEntity (const std::string &label) |
template<typename E > | |
E * | reserveEntity (const std::string &label) |
Entities::BasicEntity * | getLocalEntity (const std::string &label) |
bool | stopping (void) |
bool | isActive (void) const |
bool | isActivating (void) const |
bool | isDeactivating (void) const |
void | waitForMessages (double timeout) |
void | consumeMessages (void) |
template<typename T > | |
Parameter & | param (const std::string &name, T &var) |
template<typename Y , typename T > | |
Parameter & | param (const std::string &name, T &var) |
template<typename T > | |
bool | paramChanged (T &var) |
void | paramActive (Parameter::Scope def_scope, Parameter::Visibility def_visibility, bool def_value=false) |
void | setParamSectionEditor (const std::string &name) |
template<typename M , typename T > | |
void | bind (T *task_obj, void(T::*consumer)(const M *)=&T::consume) |
template<typename T > | |
void | bind (T *task_obj, const std::vector< uint32_t > &list) |
template<typename T , typename M > | |
void | bind (T *task_obj, const std::vector< uint32_t > &list, void(T::*consumer)(const M *)=&T::consume) |
template<typename T > | |
void | bind (T *task_obj, const std::vector< std::string > &list) |
void | requestActivation (void) |
void | requestDeactivation (void) |
void | activate (void) |
void | activationFailed (const std::string &reason) |
void | deactivate (void) |
void | deactivationFailed (const std::string &reason) |
virtual bool | onWriteParamsXML (std::ostream &os) const |
virtual void | onEntityReservation (void) |
virtual void | onEntityResolution (void) |
virtual void | onReportEntityState (void) |
virtual void | onRequestDeactivation (void) |
virtual void | onQueryEntityParameters (const IMC::QueryEntityParameters *msg) |
virtual void | onSetEntityParameters (const IMC::SetEntityParameters *msg) |
virtual void | onPushEntityParameters (const IMC::PushEntityParameters *msg) |
virtual void | onPopEntityParameters (const IMC::PopEntityParameters *msg) |
Protected Member Functions inherited from DUNE::Concurrency::Thread | |
void | startImpl (void) |
void | stopImpl (void) |
void | joinImpl (void) |
void | setPriorityImpl (Scheduler::Policy policy, unsigned priority) |
unsigned | getPriorityImpl (void) |
Protected Attributes inherited from DUNE::Tasks::Task | |
Context & | m_ctx |
std::vector< Entities::BasicEntity * > | m_entities |
|
inline |
Constructor.
[in] | name | task name. |
[in] | ctx | context. |
References Sensors::Imagenex881A::Arguments::absorption, Sensors::Imagenex881A::Arguments::data_bits, Sensors::Imagenex881A::Arguments::data_points, Sensors::Imagenex881A::Arguments::frequency, Sensors::Imagenex881A::Arguments::invert, Sensors::Imagenex881A::Arguments::position, Sensors::Imagenex881A::Arguments::power_channel, Sensors::Imagenex881A::Arguments::profile, Sensors::Imagenex881A::Arguments::profile_min_range, Sensors::Imagenex881A::Arguments::range, Sensors::Imagenex881A::SD_BAUD_RATE, Sensors::Imagenex881A::SD_HDR_1, Sensors::Imagenex881A::SD_HDR_2, Sensors::Imagenex881A::SD_HEAD_ID, Sensors::Imagenex881A::SD_MASTER_SLAVE, Sensors::Imagenex881A::SD_TERMINATOR, Sensors::Imagenex881A::Arguments::sector_width, Sensors::Imagenex881A::Arguments::sspeed, Sensors::Imagenex881A::Arguments::sspeed_dyn, Sensors::Imagenex881A::Arguments::start_gain, Sensors::Imagenex881A::Arguments::step_size, Sensors::Imagenex881A::Arguments::switch_delay, Sensors::Imagenex881A::Arguments::train_angle, Sensors::Imagenex881A::Arguments::uart_dev, and Sensors::Imagenex881A::Arguments::use_default.
|
inline |
|
inline |
|
inline |
Get index from table according with given value.
[in] | value | value to be checked in the table. |
[in] | table | vector with parameters. |
[in] | table_size | size of the vector. |
|
inlinevirtual |
Called when the task starts/resumes normal execution.
Reimplemented from DUNE::Tasks::Task.
|
inlinevirtual |
Called when the task stops normal execution and enters an idleness state.
Reimplemented from DUNE::Tasks::Task.
|
inlinevirtual |
Main loop.
Implements DUNE::Tasks::Task.
References Sensors::Imagenex881A::Parser::getDataPointsCount(), Sensors::Imagenex881A::Parser::getHeadPosition(), Sensors::Imagenex881A::Parser::getProfileRange(), Sensors::Imagenex881A::Parser::getRange(), Sensors::Imagenex881A::Arguments::invert, Sensors::Imagenex881A::Parser::parse(), and Sensors::Imagenex881A::Arguments::sspeed_dyn.
|
inlinevirtual |
Called when an external activation request is received.
Derived classes that need to perform extra steps to prepare normal execution should replace the default behaviour of immediate activation with calls to activate() when the request is completed or activationFailed() if the request cannot be honoured.
Reimplemented from DUNE::Tasks::Task.
|
inlinevirtual |
Acquire resources.
Reimplemented from DUNE::Tasks::Task.
References Sensors::Imagenex881A::Arguments::uart_dev.
|
inlinevirtual |
Called when the task is instructed to initialize resources acquired previously or whose initialization depends on run-time parameters.
Reimplemented from DUNE::Tasks::Task.
|
inlinevirtual |
Release resources.
Reimplemented from DUNE::Tasks::Task.
|
inlinevirtual |
Update internal state with new parameter values.
Reimplemented from DUNE::Tasks::Task.
References Sensors::Imagenex881A::Arguments::absorption, Sensors::Imagenex881A::Arguments::frequency, Sensors::Imagenex881A::Arguments::position, Sensors::Imagenex881A::Arguments::power_channel, Sensors::Imagenex881A::Arguments::range, Sensors::Imagenex881A::Arguments::sspeed, Sensors::Imagenex881A::Arguments::uart_dev, and Sensors::Imagenex881A::Arguments::use_default.
|
inline |
Set switch data absorption.
[in] | absorption | absorption level. |
References DUNE::Math::abs(), and Sensors::Imagenex881A::SD_ABSORPTION.
|
inline |
Set switch data number of bits per data point.
References Sensors::Imagenex881A::Arguments::data_bits, and Sensors::Imagenex881A::SD_DATA_BITS.
|
inline |
Set switch data number of data points.
References Sensors::Imagenex881A::Arguments::data_points, and Sensors::Imagenex881A::SD_DATA_POINTS.
|
inline |
Set switch data frequency.
[in] | frequency | operation frequency. |
References Sensors::Imagenex881A::Arguments::frequency, and Sensors::Imagenex881A::SD_FREQUENCY.
|
inline |
Set switch data profile mode.
References Sensors::Imagenex881A::Arguments::profile, and Sensors::Imagenex881A::SD_PROFILE.
|
inline |
Set switch data profile minimum range.
References Sensors::Imagenex881A::Arguments::profile_min_range, and Sensors::Imagenex881A::SD_PROFILE_MIN_RANGE.
|
inline |
Set switch data range.
References Sensors::Imagenex881A::Arguments::range, Sensors::Imagenex881A::SD_PULSE_LEN, and Sensors::Imagenex881A::SD_RANGE.
|
inline |
Set switch data sector width.
References Sensors::Imagenex881A::SD_SECTOR_WIDTH, and Sensors::Imagenex881A::Arguments::sector_width.
|
inline |
Set switch data start gain.
References Sensors::Imagenex881A::SD_START_GAIN, and Sensors::Imagenex881A::Arguments::start_gain.
|
inline |
Set switch data step size.
References Sensors::Imagenex881A::SD_STEP_SIZE, and Sensors::Imagenex881A::Arguments::step_size.
|
inline |
Set switch data delay.
References Sensors::Imagenex881A::SD_SWITCH_DELAY, and Sensors::Imagenex881A::Arguments::switch_delay.
|
inline |
Set switch data train angle.
References Sensors::Imagenex881A::SD_TRAIN_ANGLE, and Sensors::Imagenex881A::Arguments::train_angle.
|
inline |
Test communication with device.
|
inline |
Update state.
[in] | heading | beam orientation. |
Counter<double> Sensors::Imagenex881A::Task::m_countdown |
Activation/deactivation timer.
IMC::DeviceState Sensors::Imagenex881A::Task::m_device_state |
Device State message.
IMC::Distance Sensors::Imagenex881A::Task::m_distance |
Distance message.
Parser Sensors::Imagenex881A::Task::m_parser |
Response frame parser.
IMC::PowerChannelControl Sensors::Imagenex881A::Task::m_power_channel_control |
Power channel control.
uint8_t Sensors::Imagenex881A::Task::m_sdata[c_sdata_size] |
IMC::SonarData Sensors::Imagenex881A::Task::m_sonar |
Profile message.
double Sensors::Imagenex881A::Task::m_sound_speed |
Last valid sound speed value.
SerialPort* Sensors::Imagenex881A::Task::m_uart |
Serial port handle.
Counter<double> Sensors::Imagenex881A::Task::m_wdog |
Watchdog.