DUNE: Uniform Navigational Environment  2024.09.0
Sensors::WaterLinkedDVL::Driver Class Reference

Public Member Functions

 Driver (Tasks::Task *task, IMC::Distance &alt_dvl, IMC::Distance &alt_flt)
 
void setBeamFilter (Navigation::BeamFilter *beam_filter)
 
void setIOHandle (IO::Handle *io, bool is_serial)
 
void sendCommand (const std::string cmd, const std::string param_name="", const std::string param_value="")
 
bool waitResponse (const std::string &cmd)
 
bool readData ()
 
void parseTCP (std::string &data)
 
uint8_t getLastStatus ()
 
bool getBottomLock ()
 
void parseTCPReport (const nlohmann::json &msg)
 
void parseTCPDeadReckoning (nlohmann::json &msg)
 
void parseTCPConfig (const nlohmann::json &msg)
 
void parseSerial (std::string &data)
 
void checkFragment (std::vector< std::string > &list)
 
void getConfig (void)
 
void setAcoustics (const bool enable)
 
void setSoundSpeed (double sound_speed)
 
void setRange (const std::string spec)
 
void setRotation (const double angle)
 
ConfigurationgetLastConfig ()
 

Constructor & Destructor Documentation

◆ Driver()

Sensors::WaterLinkedDVL::Driver::Driver ( Tasks::Task *  task,
IMC::Distance &  alt_dvl,
IMC::Distance &  alt_flt 
)
inline

Member Function Documentation

◆ checkFragment()

void Sensors::WaterLinkedDVL::Driver::checkFragment ( std::vector< std::string > &  list)
inline

Check for message fragments.

Parameters
[in]listmessage list.

Referenced by readData().

◆ getBottomLock()

bool Sensors::WaterLinkedDVL::Driver::getBottomLock ( )
inline

◆ getConfig()

void Sensors::WaterLinkedDVL::Driver::getConfig ( void  )
inline

Get device configuration.

References sendCommand().

Referenced by setAcoustics(), setRange(), setRotation(), and setSoundSpeed().

◆ getLastConfig()

Configuration& Sensors::WaterLinkedDVL::Driver::getLastConfig ( )
inline

◆ getLastStatus()

uint8_t Sensors::WaterLinkedDVL::Driver::getLastStatus ( )
inline

◆ parseSerial()

void Sensors::WaterLinkedDVL::Driver::parseSerial ( std::string &  data)
inline

Parser to interpret incoming data through serial connection.

Parameters
[in]dataJSON data string.

Referenced by readData().

◆ parseTCP()

void Sensors::WaterLinkedDVL::Driver::parseTCP ( std::string &  data)
inline

Parser for incoming TPC data.

Parameters
[in]dataJSON data string

References parseTCPConfig(), parseTCPDeadReckoning(), and parseTCPReport().

Referenced by readData().

◆ parseTCPConfig()

void Sensors::WaterLinkedDVL::Driver::parseTCPConfig ( const nlohmann::json &  msg)
inline

◆ parseTCPDeadReckoning()

void Sensors::WaterLinkedDVL::Driver::parseTCPDeadReckoning ( nlohmann::json &  msg)
inline

Parse Dead Reckoning report.

Referenced by parseTCP().

◆ parseTCPReport()

void Sensors::WaterLinkedDVL::Driver::parseTCPReport ( const nlohmann::json &  msg)
inline

Parse velocity-and-transducer report.

Parameters
[in]msgparsed JSON data.

Referenced by parseTCP().

◆ readData()

bool Sensors::WaterLinkedDVL::Driver::readData ( )
inline

Read data from sensor.

Returns
true if data is read, false otherwise.

References checkFragment(), parseSerial(), and parseTCP().

Referenced by waitResponse().

◆ sendCommand()

void Sensors::WaterLinkedDVL::Driver::sendCommand ( const std::string  cmd,
const std::string  param_name = "",
const std::string  param_value = "" 
)
inline

Send command to device.

Parameters
[in]cmdcommand type.
[in]param_nameparameter name, only used for "set_config" command. If empty only cmd is used.
[in]param_valueparameter value, only used for "set_config" command. If empty only cmd is used.

References waitResponse().

Referenced by getConfig(), setAcoustics(), setRange(), setRotation(), and setSoundSpeed().

◆ setAcoustics()

void Sensors::WaterLinkedDVL::Driver::setAcoustics ( const bool  enable)
inline

Enable or disable device acoustics.

Parameters
[in]enabletrue to enable, false to disable.

References Sensors::WaterLinkedDVL::Configuration::acoustic_enabled, getConfig(), and sendCommand().

◆ setBeamFilter()

void Sensors::WaterLinkedDVL::Driver::setBeamFilter ( Navigation::BeamFilter *  beam_filter)
inline

◆ setIOHandle()

void Sensors::WaterLinkedDVL::Driver::setIOHandle ( IO::Handle *  io,
bool  is_serial 
)
inline

◆ setRange()

void Sensors::WaterLinkedDVL::Driver::setRange ( const std::string  spec)
inline

Set range mode.

Modes table: Mode Min alt (m) Max alt (m) 0 0.05 0.6 1 0.3 3.0 2 1.5 14 3 7.7 36 4 15 max

Parameters
[in]specRange specifier option: auto - The DVL will search for bottom lock in it's full operational area (Default) =a - The DVL is locked to range mode a where a is a number from 0-4 a<=b - The DVL will search for bottom lock within range mode a and b

References getConfig(), Sensors::WaterLinkedDVL::Configuration::range_mode, and sendCommand().

◆ setRotation()

void Sensors::WaterLinkedDVL::Driver::setRotation ( const double  angle)
inline

Set device rotation angle.

Parameters
[in]anglemounting rotation angle in degrees.

References getConfig(), Sensors::WaterLinkedDVL::Configuration::mounting_rotation_offset, and sendCommand().

◆ setSoundSpeed()

void Sensors::WaterLinkedDVL::Driver::setSoundSpeed ( double  sound_speed)
inline

Enable or disable device acoustics.

Parameters
[in]enabletrue to enable, false to disable.

References getConfig(), sendCommand(), and Sensors::WaterLinkedDVL::Configuration::speed_of_sound.

◆ waitResponse()

bool Sensors::WaterLinkedDVL::Driver::waitResponse ( const std::string &  cmd)
inline

Wait command response.

Returns
true if successful response, false otherwise

References readData().

Referenced by sendCommand().

Collaboration diagram for Sensors::WaterLinkedDVL::Driver:
Collaboration graph