DUNE: Uniform Navigational Environment  2024.09.0
DUNE::Navigation::UsblTools::Target Class Reference

Detailed Description

USBL tools handler ticket.

Public Member Functions

 Target (std::string name, bool fix, bool inverted, uint16_t period)
 
bool trigger ()
 
bool compare (const std::string &name) const
 
void reset (bool fix, bool inverted, uint16_t period)
 
std::string getName () const
 
bool wantsFix () const
 
bool isInverted () const
 
bool hasFailed ()
 
void resetErrors ()
 
void setOrigin (const IMC::GpsFix *msg)
 
bool getOrigin (IMC::GpsFix &msg)
 
void setRelativePosition (const IMC::UsblPositionExtended *msg)
 
bool getRelativePosition (IMC::UsblPositionExtended &msg)
 

Constructor & Destructor Documentation

◆ Target()

DUNE::Navigation::UsblTools::Target::Target ( std::string  name,
bool  fix,
bool  inverted,
uint16_t  period 
)
inline

Constructor.

Parameters
[in]nametarget's name.
[in]fixabsolute fix or relative positioning
[in]periodtarget's desired periodicity.

Member Function Documentation

◆ compare()

bool DUNE::Navigation::UsblTools::Target::compare ( const std::string &  name) const
inline

Compare name with target name.

Parameters
[in]namename of target.
Returns
true if target's name is matched.

◆ getName()

std::string DUNE::Navigation::UsblTools::Target::getName ( void  ) const
inline

Get target's name.

Returns
target's name.

◆ getOrigin()

bool DUNE::Navigation::UsblTools::Target::getOrigin ( IMC::GpsFix msg)
inline

Get target's absolute position.

Parameters
[out]msgGpsFix message of target's position.
Returns
true if message is valid and has been filled, false otherwise.

◆ getRelativePosition()

bool DUNE::Navigation::UsblTools::Target::getRelativePosition ( IMC::UsblPositionExtended msg)
inline

Get target's relative position.

Parameters
[out]msgUsblPositionExtended message of target's position.
Returns
true if message is valid and has been filled, false otherwise.

◆ hasFailed()

bool DUNE::Navigation::UsblTools::Target::hasFailed ( )
inline

Check if the target node has failed.

Returns
true if target has reached threshold, false otherwise.

References DUNE::Navigation::UsblTools::c_max_comm_timeout.

◆ isInverted()

bool DUNE::Navigation::UsblTools::Target::isInverted ( ) const
inline

Check if target is for inverted mode.

Returns
true if target is set as inverted, false otherwise.

◆ reset()

void DUNE::Navigation::UsblTools::Target::reset ( bool  fix,
bool  inverted,
uint16_t  period 
)
inline

Reset variables of target.

Parameters
[in]fixreturn absolute fixes or relative position.
[in]invertedinverted mode flag.
[in]perioddesired periodicity.

◆ resetErrors()

void DUNE::Navigation::UsblTools::Target::resetErrors ( )
inline

Reset count of errors.

◆ setOrigin()

void DUNE::Navigation::UsblTools::Target::setOrigin ( const IMC::GpsFix msg)
inline

Set target's absolute position.

Parameters
[in]msgGpsFix message of target's position.

◆ setRelativePosition()

void DUNE::Navigation::UsblTools::Target::setRelativePosition ( const IMC::UsblPositionExtended msg)
inline

Set target's relative position.

Parameters
[in]msgUsblPositionExtended message of target's position.

◆ trigger()

bool DUNE::Navigation::UsblTools::Target::trigger ( )
inline

Time to track target.

Returns
true, if timer has overflown.

◆ wantsFix()

bool DUNE::Navigation::UsblTools::Target::wantsFix ( ) const
inline

Check if target node wants absolute fix.

Returns
true if target's wants absolute fix, false otherwise.
Collaboration diagram for DUNE::Navigation::UsblTools::Target:
Collaboration graph