DUNE: Uniform Navigational Environment  2019.02.1
Sensors::Imagenex837B::Task Struct Reference

Detailed Description

Task.

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
void onUpdateParameters (void)
 
void initializeSonarData (unsigned data_size)
 
void onResourceInitialization (void)
 
void onResourceRelease (void)
 
void onRequestActivation (void)
 
void onActivation (void)
 
void onDeactivation (void)
 
void checkActivationProgress (void)
 
void openLog (const Path &path)
 
void closeLog (void)
 
void consume (const IMC::EstimatedState *msg)
 
void consume (const IMC::LoggingControl *msg)
 
void consume (const IMC::SoundSpeed *msg)
 
unsigned getIndex (unsigned value, const unsigned *table, unsigned table_size)
 
void setRange (unsigned value)
 
void setStartGain (unsigned value)
 
void setSwitchDelay (unsigned value)
 
void setAbsorption (unsigned value)
 
void setDataPoints (unsigned value)
 
void setAutoMode (bool auto_mode)
 
void setNadirAngle (float angle)
 
void setAutoGainValue (unsigned value)
 
bool ping (unsigned data_point)
 
void sendExternalControl (Address addr, unsigned port)
 
bool getEcho (void)
 
void writeToFile (void)
 
void update (void)
 
void checkAltitude (void)
 
bool request (void)
 
void process (void)
 
void checkRange (void)
 
void onMain (void)
 

Public Attributes

TCPSocket * m_tcp
 
UDPSocket * m_udp
 
Frame837m_frame837
 
Frame83Pm_frame83P
 
IMC::SonarData * m_data
 
ExternalControlm_ec
 
uint8_t m_sdata [c_sdata_size]
 
uint8_t m_rdata_hdr [c_rdata_hdr_size]
 
uint8_t m_rdata_ftr [c_rdata_ftr_size]
 
IMC::EstimatedState m_estate
 
std::ofstream m_log_file
 
Path m_log_path
 
IMC::PowerChannelControl m_power_channel_control
 
Counter< double > m_countdown
 
Counter< double > m_range_counter
 
Time::Counter< float > m_wdog
 
Arguments m_args
 

Constructor & Destructor Documentation

Member Function Documentation

void Sensors::Imagenex837B::Task::checkActivationProgress ( void  )
inline
void Sensors::Imagenex837B::Task::checkAltitude ( void  )
inline
void Sensors::Imagenex837B::Task::checkRange ( void  )
inline

Check sonar range.

References Sensors::Imagenex837B::Arguments::mod.

void Sensors::Imagenex837B::Task::closeLog ( void  )
inline

Close current log file.

void Sensors::Imagenex837B::Task::consume ( const IMC::EstimatedState *  msg)
inline
void Sensors::Imagenex837B::Task::consume ( const IMC::LoggingControl *  msg)
inline
void Sensors::Imagenex837B::Task::consume ( const IMC::SoundSpeed *  msg)
inline
unsigned Sensors::Imagenex837B::Task::getIndex ( unsigned  value,
const unsigned *  table,
unsigned  table_size 
)
inline

Get index from table according with given value.

Parameters
[in]valuevalue to be checked in the table.
[in]tablevector with parameters.
[in]table_sizesize of the vector.
Returns
index of the vector.
void Sensors::Imagenex837B::Task::initializeSonarData ( unsigned  data_size)
inline

Initialize IMC sonar data holder.

void Sensors::Imagenex837B::Task::onActivation ( void  )
inline
void Sensors::Imagenex837B::Task::onDeactivation ( void  )
inline
void Sensors::Imagenex837B::Task::onMain ( void  )
inline
void Sensors::Imagenex837B::Task::onRequestActivation ( void  )
inline
void Sensors::Imagenex837B::Task::onResourceInitialization ( void  )
inline
void Sensors::Imagenex837B::Task::onResourceRelease ( void  )
inline
void Sensors::Imagenex837B::Task::openLog ( const Path &  path)
inline

Open a log file to hold 837 or 83P files.

Parameters
[in]pathdesired log path.
bool Sensors::Imagenex837B::Task::ping ( unsigned  data_point)
inline

Request device to ping.

Parameters
[in]data_pointdata index.

References Sensors::Imagenex837B::Frame837::getMessageData(), and Sensors::Imagenex837B::SD_PACKET_NUM.

void Sensors::Imagenex837B::Task::process ( void  )
inline

Process return data.

bool Sensors::Imagenex837B::Task::request ( void  )
inline

Request sonar data.

Returns
true if return is successful, false otherwise.

References Sensors::Imagenex837B::Arguments::data_points.

void Sensors::Imagenex837B::Task::sendExternalControl ( Address  addr,
unsigned  port 
)
inline
void Sensors::Imagenex837B::Task::setAbsorption ( unsigned  value)
inline

Define switch command data absorption value.

Parameters
[in]valueabsorption value.

References Sensors::Imagenex837B::SD_ABSORPTION.

void Sensors::Imagenex837B::Task::setAutoGainValue ( unsigned  value)
inline

Define switch command data auto gain threshold.

Parameters
[in]valueauto gain threshold.

References Sensors::Imagenex837B::SD_AGC_THRESHOLD.

void Sensors::Imagenex837B::Task::setAutoMode ( bool  auto_mode)
inline

Define switch command data auto mode.

References Sensors::Imagenex837B::SD_RUN_MODE.

void Sensors::Imagenex837B::Task::setDataPoints ( unsigned  value)
inline

Define switch command data number of data points.

Parameters
[in]valuenumber of data points.

References Sensors::Imagenex837B::SD_DATA_POINTS, and Sensors::Imagenex837B::Frame837::setExtendedDataPoints().

void Sensors::Imagenex837B::Task::setNadirAngle ( float  angle)
inline
void Sensors::Imagenex837B::Task::setRange ( unsigned  value)
inline
void Sensors::Imagenex837B::Task::setStartGain ( unsigned  value)
inline

Define switch command data start gain.

Parameters
[in]valuestart gain.

References Sensors::Imagenex837B::SD_START_GAIN, Sensors::Imagenex837B::ExternalControl::setGain(), and Sensors::Imagenex837B::Frame837::setStartGain().

void Sensors::Imagenex837B::Task::setSwitchDelay ( unsigned  value)
inline

Define switch command data switch delay.

Parameters
[in]valueswitch delay.

References Sensors::Imagenex837B::SD_SWITCH_DELAY.

Member Data Documentation

Arguments Sensors::Imagenex837B::Task::m_args

Configuration parameters.

Counter<double> Sensors::Imagenex837B::Task::m_countdown

Activation/deactivation timer.

IMC::SonarData* Sensors::Imagenex837B::Task::m_data

Sonar Return Data.

ExternalControl* Sensors::Imagenex837B::Task::m_ec

External Control frame.

IMC::EstimatedState Sensors::Imagenex837B::Task::m_estate

Estimated state.

Frame837* Sensors::Imagenex837B::Task::m_frame837

837 Frame.

Frame83P* Sensors::Imagenex837B::Task::m_frame83P

83P Frame.

std::ofstream Sensors::Imagenex837B::Task::m_log_file

Log file.

Path Sensors::Imagenex837B::Task::m_log_path

Log filename.

IMC::PowerChannelControl Sensors::Imagenex837B::Task::m_power_channel_control

Power channel control.

Counter<double> Sensors::Imagenex837B::Task::m_range_counter

Range adaptive modifier counter.

uint8_t Sensors::Imagenex837B::Task::m_rdata_ftr[c_rdata_ftr_size]

Footer Return data.

uint8_t Sensors::Imagenex837B::Task::m_rdata_hdr[c_rdata_hdr_size]

Header Return data.

uint8_t Sensors::Imagenex837B::Task::m_sdata[c_sdata_size]

Output switch data.

TCPSocket* Sensors::Imagenex837B::Task::m_tcp

TCP socket.

UDPSocket* Sensors::Imagenex837B::Task::m_udp

UDP socket.

Time::Counter<float> Sensors::Imagenex837B::Task::m_wdog

Watchdog.

Collaboration diagram for Sensors::Imagenex837B::Task:
Collaboration graph