DUNE: Uniform Navigational Environment
2019.02.0
|
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 |
Frame837 * | m_frame837 |
Frame83P * | m_frame83P |
IMC::SonarData * | m_data |
ExternalControl * | m_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 |
|
inline |
Constructor.
References Sensors::Imagenex837B::Arguments::absorption, Sensors::Imagenex837B::Arguments::addr, Sensors::Imagenex837B::Arguments::auto_gain, Sensors::Imagenex837B::Arguments::auto_gain_value, Sensors::Imagenex837B::Arguments::data_points, Sensors::Imagenex837B::Arguments::def_range, Sensors::Imagenex837B::Arguments::file_name, m_args, m_sdata, Sensors::Imagenex837B::Arguments::mod, Sensors::Imagenex837B::Arguments::mod_add, Sensors::Imagenex837B::Arguments::mod_mul, Sensors::Imagenex837B::Arguments::mod_timer, Sensors::Imagenex837B::Arguments::nadir, Sensors::Imagenex837B::Arguments::offset, Sensors::Imagenex837B::Arguments::output_format, Sensors::Imagenex837B::Arguments::port, Sensors::Imagenex837B::Arguments::power_channel, Sensors::Imagenex837B::SD_FREQUENCY, Sensors::Imagenex837B::Arguments::start_gain, Sensors::Imagenex837B::Arguments::switch_delay, Sensors::Imagenex837B::Arguments::tilt_angle, Sensors::Imagenex837B::Arguments::timeout_error, and Sensors::Imagenex837B::Arguments::xdcr.
|
inline |
References Sensors::Imagenex837B::Arguments::addr, DUNE::Time::Counter< T >::getRemaining(), m_args, m_countdown, m_ec, m_tcp, m_udp, DUNE::Time::Counter< T >::overflow(), and Sensors::Imagenex837B::Arguments::port.
Referenced by onMain().
|
inline |
Check current water column.
References m_args, m_estate, Sensors::Imagenex837B::Arguments::mod_add, Sensors::Imagenex837B::Arguments::mod_mul, and setRange().
Referenced by checkRange().
|
inline |
Check sonar range.
References checkAltitude(), m_args, m_range_counter, Sensors::Imagenex837B::Arguments::mod, DUNE::Time::Counter< T >::overflow(), and DUNE::Time::Counter< T >::reset().
Referenced by onMain().
|
inline |
Close current log file.
References m_log_file, and m_log_path.
Referenced by consume(), onDeactivation(), onResourceInitialization(), and openLog().
|
inline |
References m_estate.
|
inline |
References closeLog(), Sensors::Imagenex837B::Arguments::file_name, m_args, m_frame837, m_frame83P, and openLog().
|
inline |
|
inline |
Request get echo using External Control frame.
References Sensors::Imagenex837B::Frame::getData(), Sensors::Imagenex837B::Frame83P::getMaxSize(), Sensors::Imagenex837B::Frame83P::getMessageData(), Sensors::Imagenex837B::Frame83P::getMessageSize(), Sensors::Imagenex837B::Frame83P::getRange(), m_data, m_frame83P, m_udp, sendExternalControl(), and Sensors::Imagenex837B::Frame83P::verifyReturn().
Referenced by request().
|
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. |
Referenced by setRange().
|
inline |
|
inline |
References m_wdog.
|
inline |
References closeLog(), m_power_channel_control, m_tcp, and m_udp.
|
inline |
References checkActivationProgress(), checkRange(), m_tcp, m_udp, m_wdog, process(), and request().
|
inline |
References m_countdown, m_power_channel_control, and DUNE::Time::Counter< T >::reset().
|
inline |
References closeLog().
|
inline |
References m_data, m_ec, m_frame837, and m_frame83P.
|
inline |
Update task parameters.
References Sensors::Imagenex837B::Arguments::absorption, Sensors::Imagenex837B::Arguments::addr, Sensors::Imagenex837B::Arguments::auto_gain, Sensors::Imagenex837B::Arguments::auto_gain_value, Sensors::Imagenex837B::Arguments::data_points, Sensors::Imagenex837B::Arguments::def_range, Sensors::Imagenex837B::Frame83P::getMessageSize(), initializeSonarData(), m_args, m_countdown, m_data, m_ec, m_frame837, m_frame83P, m_power_channel_control, m_range_counter, m_wdog, Sensors::Imagenex837B::Arguments::mod_timer, Sensors::Imagenex837B::Arguments::nadir, Sensors::Imagenex837B::Arguments::output_format, Sensors::Imagenex837B::Arguments::port, Sensors::Imagenex837B::Arguments::power_channel, setAbsorption(), setAutoGainValue(), setAutoMode(), setDataPoints(), setNadirAngle(), Sensors::Imagenex837B::Frame::setProfileTiltAngle(), Sensors::Imagenex837B::ExternalControl::setProfileTiltAngle(), setRange(), setStartGain(), setSwitchDelay(), DUNE::Time::Counter< T >::setTop(), Sensors::Imagenex837B::Arguments::start_gain, Sensors::Imagenex837B::Arguments::switch_delay, Sensors::Imagenex837B::Arguments::tilt_angle, and Sensors::Imagenex837B::Arguments::timeout_error.
|
inline |
Open a log file to hold 837 or 83P files.
[in] | path | desired log path. |
References closeLog(), m_log_file, and m_log_path.
Referenced by consume().
|
inline |
Request device to ping.
[in] | data_point | data index. |
References Sensors::Imagenex837B::Frame837::getMessageData(), m_data, m_frame837, m_rdata_ftr, m_rdata_hdr, m_sdata, m_tcp, and Sensors::Imagenex837B::SD_PACKET_NUM.
Referenced by request().
|
inline |
Process return data.
References m_data, m_frame837, m_frame83P, m_wdog, and writeToFile().
Referenced by onMain().
|
inline |
|
inline |
References Sensors::Imagenex837B::ExternalControl::getData(), Sensors::Imagenex837B::ExternalControl::getSize(), m_ec, and m_udp.
Referenced by getEcho().
|
inline |
Define switch command data absorption value.
[in] | value | absorption value. |
References m_sdata, and Sensors::Imagenex837B::SD_ABSORPTION.
Referenced by onUpdateParameters().
|
inline |
Define switch command data auto gain threshold.
[in] | value | auto gain threshold. |
References m_sdata, and Sensors::Imagenex837B::SD_AGC_THRESHOLD.
Referenced by onUpdateParameters().
|
inline |
Define switch command data auto mode.
References m_sdata, and Sensors::Imagenex837B::SD_RUN_MODE.
Referenced by onUpdateParameters().
|
inline |
Define switch command data number of data points.
[in] | value | number of data points. |
References m_frame837, m_sdata, Sensors::Imagenex837B::SD_DATA_POINTS, and Sensors::Imagenex837B::Frame837::setExtendedDataPoints().
Referenced by onUpdateParameters().
|
inline |
Define switch command data number nadir angle.
[in] | angle | nadir angle. |
References m_args, m_ec, m_frame837, m_sdata, Sensors::Imagenex837B::SD_NADIR_HI, Sensors::Imagenex837B::SD_NADIR_LO, Sensors::Imagenex837B::ExternalControl::setDisplayMode(), Sensors::Imagenex837B::Frame837::setDisplayMode(), and Sensors::Imagenex837B::Arguments::xdcr.
Referenced by onUpdateParameters(), and update().
|
inline |
Define switch command data range.
[in] | value | range. |
References getIndex(), m_data, m_ec, m_frame837, m_frame83P, m_sdata, Sensors::Imagenex837B::SD_PULSE_LEN, Sensors::Imagenex837B::SD_RANGE, Sensors::Imagenex837B::Frame837::setPulseLength(), Sensors::Imagenex837B::ExternalControl::setRange(), and Sensors::Imagenex837B::Frame::setRange().
Referenced by checkAltitude(), and onUpdateParameters().
|
inline |
Define switch command data start gain.
[in] | value | start gain. |
References m_ec, m_frame837, m_sdata, Sensors::Imagenex837B::SD_START_GAIN, Sensors::Imagenex837B::ExternalControl::setGain(), and Sensors::Imagenex837B::Frame837::setStartGain().
Referenced by onUpdateParameters().
|
inline |
Define switch command data switch delay.
[in] | value | switch delay. |
References m_sdata, and Sensors::Imagenex837B::SD_SWITCH_DELAY.
Referenced by onUpdateParameters().
|
inline |
Update state (to be logged in 837/83P file formats).
References m_args, m_estate, m_frame837, m_frame83P, Sensors::Imagenex837B::Arguments::nadir, Sensors::Imagenex837B::Arguments::offset, Sensors::Imagenex837B::Frame::setCourse(), Sensors::Imagenex837B::Frame::setGpsData(), Sensors::Imagenex837B::Frame::setHeading(), setNadirAngle(), Sensors::Imagenex837B::Frame::setPitch(), Sensors::Imagenex837B::Frame::setRoll(), and Sensors::Imagenex837B::Frame::setSpeed().
Referenced by writeToFile().
|
inline |
Handle sonar data to 837/83P file formats.
References Sensors::Imagenex837B::Frame::getData(), Sensors::Imagenex837B::Frame83P::getSize(), Sensors::Imagenex837B::Frame837::getSize(), m_frame837, m_frame83P, m_log_file, m_rdata_hdr, Sensors::Imagenex837B::Frame::setDateTime(), Sensors::Imagenex837B::Frame837::setFirmwareVersion(), Sensors::Imagenex837B::Frame837::setRepRate(), Sensors::Imagenex837B::Frame837::setSerialStatus(), and update().
Referenced by process().
Arguments Sensors::Imagenex837B::Task::m_args |
Configuration parameters.
Referenced by checkActivationProgress(), checkAltitude(), checkRange(), consume(), onUpdateParameters(), request(), setNadirAngle(), Task(), and update().
Counter<double> Sensors::Imagenex837B::Task::m_countdown |
Activation/deactivation timer.
Referenced by checkActivationProgress(), onRequestActivation(), and onUpdateParameters().
IMC::SonarData* Sensors::Imagenex837B::Task::m_data |
Sonar Return Data.
Referenced by getEcho(), initializeSonarData(), onResourceRelease(), onUpdateParameters(), ping(), process(), and setRange().
ExternalControl* Sensors::Imagenex837B::Task::m_ec |
External Control frame.
Referenced by checkActivationProgress(), consume(), onResourceRelease(), onUpdateParameters(), request(), sendExternalControl(), setNadirAngle(), setRange(), and setStartGain().
IMC::EstimatedState Sensors::Imagenex837B::Task::m_estate |
Estimated state.
Referenced by checkAltitude(), consume(), and update().
Frame837* Sensors::Imagenex837B::Task::m_frame837 |
837 Frame.
Referenced by consume(), onResourceRelease(), onUpdateParameters(), ping(), process(), setDataPoints(), setNadirAngle(), setRange(), setStartGain(), update(), and writeToFile().
Frame83P* Sensors::Imagenex837B::Task::m_frame83P |
83P Frame.
Referenced by consume(), getEcho(), onResourceRelease(), onUpdateParameters(), process(), setRange(), update(), and writeToFile().
std::ofstream Sensors::Imagenex837B::Task::m_log_file |
Log file.
Referenced by closeLog(), openLog(), and writeToFile().
Path Sensors::Imagenex837B::Task::m_log_path |
Log filename.
Referenced by closeLog(), and openLog().
IMC::PowerChannelControl Sensors::Imagenex837B::Task::m_power_channel_control |
Power channel control.
Referenced by onDeactivation(), onRequestActivation(), and onUpdateParameters().
Counter<double> Sensors::Imagenex837B::Task::m_range_counter |
Range adaptive modifier counter.
Referenced by checkRange(), and onUpdateParameters().
uint8_t Sensors::Imagenex837B::Task::m_rdata_ftr[c_rdata_ftr_size] |
Footer Return data.
Referenced by ping().
uint8_t Sensors::Imagenex837B::Task::m_rdata_hdr[c_rdata_hdr_size] |
Header Return data.
Referenced by ping(), and writeToFile().
uint8_t Sensors::Imagenex837B::Task::m_sdata[c_sdata_size] |
Output switch data.
Referenced by ping(), setAbsorption(), setAutoGainValue(), setAutoMode(), setDataPoints(), setNadirAngle(), setRange(), setStartGain(), setSwitchDelay(), and Task().
TCPSocket* Sensors::Imagenex837B::Task::m_tcp |
TCP socket.
Referenced by checkActivationProgress(), onDeactivation(), onMain(), and ping().
UDPSocket* Sensors::Imagenex837B::Task::m_udp |
UDP socket.
Referenced by checkActivationProgress(), getEcho(), onDeactivation(), onMain(), and sendExternalControl().
Time::Counter<float> Sensors::Imagenex837B::Task::m_wdog |
Watchdog.
Referenced by onActivation(), onMain(), onUpdateParameters(), and process().