DUNE: Uniform Navigational Environment  2022.04.0
DUNE::Navigation::UsblTools::Modem Class Reference

Detailed Description

USBL tools handler.

Public Member Functions

 Modem (Tasks::Task *task)
 
bool waitingForSystem (std::string name)
 
bool run (std::string &name, float time)
 
bool wantsFix (std::string name)
 
bool isInverted (std::string name, std::vector< uint8_t > &data)
 
bool parse (uint16_t imc_src, const IMC::UamRxFrame *msg, std::vector< uint8_t > &data)
 
bool consume (const IMC::UsblPositionExtended *msg)
 
bool consume (const IMC::GpsFix *msg)
 
bool invertedFix (std::string target, IMC::UsblFixExtended &fix)
 
bool encode (const IMC::UsblFixExtended *msg, std::vector< uint8_t > &data)
 
bool encode (const IMC::UsblPositionExtended *msg, std::vector< uint8_t > &data)
 
bool encode (const IMC::UsblAnglesExtended *msg, std::vector< uint8_t > &data)
 

Constructor & Destructor Documentation

◆ Modem()

DUNE::Navigation::UsblTools::Modem::Modem ( Tasks::Task task)
inline

Constructor.

Member Function Documentation

◆ consume() [1/2]

bool DUNE::Navigation::UsblTools::Modem::consume ( const IMC::UsblPositionExtended msg)
inline

Set target's relative position.

Parameters
[in]msgUsblPositionExtended message of target's position.
Returns
true if position set, false otherwise.

References DUNE::IMC::UsblPositionExtended::target.

Referenced by parse().

◆ consume() [2/2]

bool DUNE::Navigation::UsblTools::Modem::consume ( const IMC::GpsFix msg)
inline

Set target's absolute position.

Parameters
[in]msgGpsFix message of target's position.
Returns
true if position set, false otherwise.

◆ encode() [1/3]

bool DUNE::Navigation::UsblTools::Modem::encode ( const IMC::UsblFixExtended msg,
std::vector< uint8_t > &  data 
)
inline

◆ encode() [2/3]

◆ encode() [3/3]

◆ invertedFix()

bool DUNE::Navigation::UsblTools::Modem::invertedFix ( std::string  target,
IMC::UsblFixExtended fix 
)
inline

Compute absolute fix of system from absolute and relative positions of target.

Parameters
[in]targetTarget's name.
[out]fixself fix message.
Returns
true if able to compute fix and fill message, false otherwise.

References DUNE::IMC::UsblFixExtended::target, and DUNE::Navigation::UsblTools::toFix().

◆ isInverted()

bool DUNE::Navigation::UsblTools::Modem::isInverted ( std::string  name,
std::vector< uint8_t > &  data 
)
inline

Get if target's is set for inverted mode.

Returns
true if target wants an absolute fix, false if it wants a relative position.

References DUNE::Navigation::UsblTools::CODE_INV.

◆ parse()

bool DUNE::Navigation::UsblTools::Modem::parse ( uint16_t  imc_src,
const IMC::UamRxFrame msg,
std::vector< uint8_t > &  data 
)
inline

◆ run()

bool DUNE::Navigation::UsblTools::Modem::run ( std::string &  name,
float  time 
)
inline

Trigger through all targets.

Parameters
[out]nametarget's name to be tracked.
[in]timeto wait for target system's reply.
Returns
true, if we have a system to track now.

◆ waitingForSystem()

bool DUNE::Navigation::UsblTools::Modem::waitingForSystem ( std::string  name)
inline

This function verifies if we are waiting for the target's reply.

Parameters
[in]namename of the target.
Returns
true if we are waiting, false otherwise.

◆ wantsFix()

bool DUNE::Navigation::UsblTools::Modem::wantsFix ( std::string  name)
inline

Get if target's wants an absolute fix.

Returns
true if target wants an absolute fix, false if it wants a relative position.
Collaboration diagram for DUNE::Navigation::UsblTools::Modem:
Collaboration graph