DUNE: Uniform Navigational Environment
2.6.0-rc4
|
Task.
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
void | onUpdateParameters (void) |
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 | setFrequency (void) |
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) |
void | ping (unsigned data_point) |
void | handleSonarData (void) |
void | updateState (void) |
void | checkAltitude (void) |
void | task (void) |
Public Attributes | |
TCPSocket * | m_sock |
Frame | m_frame |
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::SonarData | m_ping |
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 |
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_837, Sensors::Imagenex837B::Arguments::fill_state, m_args, m_ping, m_sdata, Sensors::Imagenex837B::Arguments::nadir, Sensors::Imagenex837B::Arguments::offset, Sensors::Imagenex837B::Arguments::port, Sensors::Imagenex837B::Arguments::power_channel, Sensors::Imagenex837B::Arguments::range_modifier, Sensors::Imagenex837B::Arguments::range_modifier_add_k, Sensors::Imagenex837B::Arguments::range_modifier_mul_k, Sensors::Imagenex837B::Arguments::range_modifier_timer, Sensors::Imagenex837B::Arguments::save_to_file, setFrequency(), Sensors::Imagenex837B::Arguments::start_gain, Sensors::Imagenex837B::Arguments::switch_delay, Sensors::Imagenex837B::Arguments::tilt_angle, and Sensors::Imagenex837B::Arguments::xdcr.
|
inline |
|
inline |
Check current water column.
References m_args, m_estate, Sensors::Imagenex837B::Arguments::range_modifier_add_k, Sensors::Imagenex837B::Arguments::range_modifier_mul_k, and setRange().
Referenced by task().
|
inline |
References m_log_file, and m_log_path.
Referenced by consume(), onDeactivation(), onResourceInitialization(), and openLog().
|
inline |
References m_estate.
|
inline |
|
inline |
References m_frame, and Sensors::Imagenex837B::Frame::setSoundVelocity().
|
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 |
Handle sonar data to 837 file format.
References Sensors::Imagenex837B::Frame::getData(), Sensors::Imagenex837B::Frame::getSize(), m_frame, m_log_file, m_rdata_hdr, Sensors::Imagenex837B::Frame::setDateTime(), Sensors::Imagenex837B::Frame::setFirmwareVersion(), Sensors::Imagenex837B::Frame::setSerialStatus(), and updateState().
Referenced by task().
|
inline |
|
inline |
References closeLog(), m_power_channel_control, and m_sock.
|
inline |
References m_countdown, m_power_channel_control, and DUNE::Time::Counter< T >::reset().
|
inline |
References closeLog().
|
inline |
|
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::Arguments::fill_state, m_args, m_countdown, m_frame, m_ping, m_power_channel_control, m_range_counter, Sensors::Imagenex837B::Arguments::nadir, Sensors::Imagenex837B::Arguments::port, Sensors::Imagenex837B::Arguments::power_channel, Sensors::Imagenex837B::Arguments::range_modifier, Sensors::Imagenex837B::Arguments::range_modifier_timer, setAbsorption(), setAutoGainValue(), setAutoMode(), setDataPoints(), setNadirAngle(), Sensors::Imagenex837B::Frame::setProfileTiltAngle(), setRange(), setStartGain(), setSwitchDelay(), DUNE::Time::Counter< T >::setTop(), Sensors::Imagenex837B::Arguments::start_gain, Sensors::Imagenex837B::Arguments::switch_delay, and Sensors::Imagenex837B::Arguments::tilt_angle.
|
inline |
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::Frame::getMessageData(), m_args, m_frame, m_ping, m_rdata_ftr, m_rdata_hdr, m_sdata, m_sock, Sensors::Imagenex837B::Arguments::save_to_file, and Sensors::Imagenex837B::SD_PACKET_NUM.
Referenced by task().
|
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_frame, m_sdata, Sensors::Imagenex837B::SD_DATA_POINTS, and Sensors::Imagenex837B::Frame::setExtendedDataPoints().
Referenced by onUpdateParameters().
|
inline |
Define switch command data frequency value.
References m_ping, m_sdata, and Sensors::Imagenex837B::SD_FREQUENCY.
Referenced by Task().
|
inline |
Define switch command data number nadir angle.
[in] | angle | nadir angle. |
References m_args, m_frame, m_sdata, Sensors::Imagenex837B::SD_NADIR_HI, Sensors::Imagenex837B::SD_NADIR_LO, Sensors::Imagenex837B::Frame::setDisplayMode(), and Sensors::Imagenex837B::Arguments::xdcr.
Referenced by onUpdateParameters(), and updateState().
|
inline |
Define switch command data range.
[in] | value | range. |
References getIndex(), m_frame, m_ping, m_sdata, Sensors::Imagenex837B::SD_PULSE_LEN, Sensors::Imagenex837B::SD_RANGE, Sensors::Imagenex837B::Frame::setPulseLength(), Sensors::Imagenex837B::Frame::setRange(), and Sensors::Imagenex837B::Frame::setRepRate().
Referenced by checkAltitude(), and onUpdateParameters().
|
inline |
Define switch command data start gain.
[in] | value | start gain. |
References m_frame, m_sdata, Sensors::Imagenex837B::SD_START_GAIN, and Sensors::Imagenex837B::Frame::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 |
References checkActivationProgress(), checkAltitude(), Sensors::Imagenex837B::Arguments::data_points, handleSonarData(), m_args, m_ping, m_range_counter, m_sock, DUNE::Time::Counter< T >::overflow(), ping(), Sensors::Imagenex837B::Arguments::range_modifier, DUNE::Time::Counter< T >::reset(), and Sensors::Imagenex837B::Arguments::save_to_file.
|
inline |
Update vehicle state in 837 files.
References Sensors::Imagenex837B::Arguments::fill_state, m_args, m_estate, m_frame, 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 handleSonarData().
Arguments Sensors::Imagenex837B::Task::m_args |
Configuration parameters.
Referenced by checkActivationProgress(), checkAltitude(), consume(), onUpdateParameters(), ping(), setNadirAngle(), Task(), task(), and updateState().
Counter<double> Sensors::Imagenex837B::Task::m_countdown |
Activation/deactivation timer.
Referenced by checkActivationProgress(), onRequestActivation(), and onUpdateParameters().
IMC::EstimatedState Sensors::Imagenex837B::Task::m_estate |
Estimated state.
Referenced by checkAltitude(), consume(), and updateState().
Frame Sensors::Imagenex837B::Task::m_frame |
837 Frame.
Referenced by consume(), handleSonarData(), onUpdateParameters(), ping(), setDataPoints(), setNadirAngle(), setRange(), setStartGain(), and updateState().
std::ofstream Sensors::Imagenex837B::Task::m_log_file |
Log file.
Referenced by closeLog(), handleSonarData(), and openLog().
Path Sensors::Imagenex837B::Task::m_log_path |
Log filename.
Referenced by closeLog(), and openLog().
IMC::SonarData Sensors::Imagenex837B::Task::m_ping |
Single sidescan ping.
Referenced by onUpdateParameters(), ping(), setFrequency(), setRange(), Task(), and task().
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 onUpdateParameters(), and task().
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 handleSonarData(), and ping().
uint8_t Sensors::Imagenex837B::Task::m_sdata[c_sdata_size] |
Output switch data.
Referenced by ping(), setAbsorption(), setAutoGainValue(), setAutoMode(), setDataPoints(), setFrequency(), setNadirAngle(), setRange(), setStartGain(), setSwitchDelay(), and Task().
TCPSocket* Sensors::Imagenex837B::Task::m_sock |
TCP socket.
Referenced by checkActivationProgress(), onDeactivation(), ping(), and task().