gusimplewhiteboard
guWhiteboard::Location Class Reference

Provides a C++ wrapper around wb_location. More...

#include <Location.hpp>

Inheritance diagram for guWhiteboard::Location:
Collaboration diagram for guWhiteboard::Location:

Public Member Functions

 Location (int16_t t_direction=0, uint16_t t_distance=0, uint8_t t_confidence=0, uint32_t t_distanceVariance=0, uint32_t t_directionVariance=0)
 Create a new Location. More...
 
 Location (const Location &t_other)
 Copy Constructor. More...
 
 Location (const struct wb_location &t_other)
 Copy Constructor. More...
 
Locationoperator= (const Location &t_other)
 Copy Assignment Operator. More...
 
Locationoperator= (const struct wb_location &t_other)
 Copy Assignment Operator. More...
 
bool operator== (const Location &t_other) const
 
bool operator!= (const Location &t_other) const
 
bool operator== (const wb_location &t_other) const
 
bool operator!= (const wb_location &t_other) const
 
int16_t & direction ()
 
const int16_t & direction () const
 
void set_direction (const int16_t &t_newValue)
 
uint16_t & distance ()
 
const uint16_t & distance () const
 
void set_distance (const uint16_t &t_newValue)
 
uint8_t & confidence ()
 
const uint8_t & confidence () const
 
void set_confidence (const uint8_t &t_newValue)
 
uint32_t & distanceVariance ()
 
const uint32_t & distanceVariance () const
 
void set_distanceVariance (const uint32_t &t_newValue)
 
uint32_t & directionVariance ()
 
const uint32_t & directionVariance () const
 
void set_directionVariance (const uint32_t &t_newValue)
 
 Location (const std::string &t_str)
 String Constructor. More...
 
std::string description ()
 
std::string to_string ()
 
void from_string (const std::string &t_str)
 
 Location (const GU::RelativeCoordinate &t_other)
 WHITEBOARD_POSTER_STRING_CONVERSION. More...
 
 Location (const GU::RelativeCoordinate &t_other, const uint8_t t_confidence)
 Create a new Location by converting the values from a GU::RelativeCoordinate. More...
 
 Location (const GU::RelativeCoordinate &t_other, const uint8_t t_confidence, const uint32_t t_distanceVariance, uint32_t t_directionVariance)
 Create a new Location by converting the values from a GU::RelativeCoordinate. More...
 
GU::RelativeCoordinate relativeCoordinate () const
 Convert this location to a GU::RelativeCoordinate. More...
 
GU::OptionalRelativeCoordinate optionalRelativeCoordinate (const uint8_t minimumConfidence) const
 Convert this location to a GU::RelativeCoordinate only if the confidence of the location is greater than or equal to the specified minimum confidence. More...
 
std::optional< GU::RelativeCoordinate > relativeCoordinate (const uint8_t minimumConfidence) const
 Convert this location to a GU::RelativeCoordinate only if the confidence of the location is greater than or equal to the specified minimum confidence. More...
 

Additional Inherited Members

- Public Attributes inherited from wb_location
int16_t direction
 degrees, relative to the center of the nao torso. More...
 
uint16_t distance
 CM distance to the center point of the sighting. More...
 
uint8_t confidence
 The type of sighting. More...
 
uint32_t distanceVariance
 The variance of the distance. More...
 
uint32_t directionVariance
 The variance of the direction. More...
 

Detailed Description

Provides a C++ wrapper around wb_location.

Definition at line 90 of file Location.hpp.

Constructor & Destructor Documentation

◆ Location() [1/7]

guWhiteboard::Location::Location ( int16_t  t_direction = 0,
uint16_t  t_distance = 0,
uint8_t  t_confidence = 0,
uint32_t  t_distanceVariance = 0,
uint32_t  t_directionVariance = 0 
)
inline

Create a new Location.

Definition at line 110 of file Location.hpp.

Referenced by operator==().

◆ Location() [2/7]

guWhiteboard::Location::Location ( const Location t_other)
inline

Copy Constructor.

Definition at line 117 of file Location.hpp.

References confidence(), direction(), directionVariance(), distance(), and distanceVariance().

◆ Location() [3/7]

guWhiteboard::Location::Location ( const struct wb_location t_other)
inline

◆ Location() [4/7]

guWhiteboard::Location::Location ( const std::string &  t_str)
inline

String Constructor.

Definition at line 247 of file Location.hpp.

References from_string().

◆ Location() [5/7]

guWhiteboard::Location::Location ( const GU::RelativeCoordinate &  t_other)
inline

WHITEBOARD_POSTER_STRING_CONVERSION.

Create a new Location by converting the values from a GU::RelativeCoordinate.

Parameters
[in]t_otherThe GU::RelativeCoordinate which is being converted.
Warning
Since a confidence, distanceVariance and directionVariance are not provided, the default values will be used.

Definition at line 427 of file Location.hpp.

◆ Location() [6/7]

guWhiteboard::Location::Location ( const GU::RelativeCoordinate &  t_other,
const uint8_t  t_confidence 
)
inline

Create a new Location by converting the values from a GU::RelativeCoordinate.

Parameters
[in]t_otherThe GU::RelativeCoordinate which is being converted.
[in]t_confidenceThe percentage of certainty of the location.
Warning
Since a distanceVariance and directionVariance are not provided, the default values will be used.

Definition at line 446 of file Location.hpp.

◆ Location() [7/7]

guWhiteboard::Location::Location ( const GU::RelativeCoordinate &  t_other,
const uint8_t  t_confidence,
const uint32_t  t_distanceVariance,
uint32_t  t_directionVariance 
)
inline

Create a new Location by converting the values from a GU::RelativeCoordinate.

Parameters
[in]t_otherThe GU::RelativeCoordinate which is being converted.
[in]t_confidenceThe percentage of certainty of the location.
[in]t_distanceVarianceThe variance of the distance.
[in]t_directionVarianceThe variance of the direction.

Definition at line 467 of file Location.hpp.

Member Function Documentation

◆ confidence() [1/2]

uint8_t & guWhiteboard::Location::confidence ( )
inline

◆ confidence() [2/2]

const uint8_t & guWhiteboard::Location::confidence ( ) const
inline

Definition at line 203 of file Location.hpp.

References wb_location::confidence.

◆ description()

std::string guWhiteboard::Location::description ( )
inline

◆ direction() [1/2]

int16_t & guWhiteboard::Location::direction ( )
inline

Definition at line 168 of file Location.hpp.

References wb_location::direction.

Referenced by Location(), description(), operator=(), operator==(), and to_string().

◆ direction() [2/2]

const int16_t & guWhiteboard::Location::direction ( ) const
inline

Definition at line 173 of file Location.hpp.

References wb_location::direction.

◆ directionVariance() [1/2]

uint32_t & guWhiteboard::Location::directionVariance ( )
inline

Definition at line 228 of file Location.hpp.

References wb_location::directionVariance.

Referenced by Location(), description(), operator=(), operator==(), and to_string().

◆ directionVariance() [2/2]

const uint32_t & guWhiteboard::Location::directionVariance ( ) const
inline

Definition at line 233 of file Location.hpp.

References wb_location::directionVariance.

◆ distance() [1/2]

uint16_t & guWhiteboard::Location::distance ( )
inline

Definition at line 183 of file Location.hpp.

References wb_location::distance.

Referenced by Location(), description(), operator=(), operator==(), and to_string().

◆ distance() [2/2]

const uint16_t & guWhiteboard::Location::distance ( ) const
inline

Definition at line 188 of file Location.hpp.

References wb_location::distance.

◆ distanceVariance() [1/2]

uint32_t & guWhiteboard::Location::distanceVariance ( )
inline

Definition at line 213 of file Location.hpp.

References wb_location::distanceVariance.

Referenced by Location(), description(), operator=(), operator==(), and to_string().

◆ distanceVariance() [2/2]

const uint32_t & guWhiteboard::Location::distanceVariance ( ) const
inline

Definition at line 218 of file Location.hpp.

References wb_location::distanceVariance.

◆ from_string()

void guWhiteboard::Location::from_string ( const std::string &  t_str)
inline

USE_WB_LOCATION_C_CONVERSION

Definition at line 298 of file Location.hpp.

References LOCATION_DESC_BUFFER_SIZE, set_confidence(), set_direction(), set_directionVariance(), set_distance(), and set_distanceVariance().

Referenced by Location().

◆ operator!=() [1/2]

bool guWhiteboard::Location::operator!= ( const Location t_other) const
inline

Definition at line 153 of file Location.hpp.

◆ operator!=() [2/2]

bool guWhiteboard::Location::operator!= ( const wb_location t_other) const
inline

Definition at line 163 of file Location.hpp.

◆ operator=() [1/2]

Location & guWhiteboard::Location::operator= ( const Location t_other)
inline

Copy Assignment Operator.

Definition at line 131 of file Location.hpp.

References confidence(), direction(), directionVariance(), distance(), and distanceVariance().

◆ operator=() [2/2]

Location & guWhiteboard::Location::operator= ( const struct wb_location t_other)
inline

◆ operator==() [1/2]

bool guWhiteboard::Location::operator== ( const Location t_other) const
inline

◆ operator==() [2/2]

bool guWhiteboard::Location::operator== ( const wb_location t_other) const
inline

Definition at line 158 of file Location.hpp.

References Location().

◆ optionalRelativeCoordinate()

GU::OptionalRelativeCoordinate guWhiteboard::Location::optionalRelativeCoordinate ( const uint8_t  minimumConfidence) const
inline

Convert this location to a GU::RelativeCoordinate only if the confidence of the location is greater than or equal to the specified minimum confidence.

Parameters
[in]minimumConfidenceThe minimim confidence value the confidence() has to be in order for GU::OptionalRelativeCoordinate::has_value to be true.
Returns
A new GU::OptionalRelativeCoordinate converted from this location where GU::OptionalRelativeCoordinate::has_value is only true when confidence() >= minimumConfidence.

Definition at line 501 of file Location.hpp.

References wb_location_to_opt_rr_coord().

◆ relativeCoordinate() [1/2]

GU::RelativeCoordinate guWhiteboard::Location::relativeCoordinate ( ) const
inline

Convert this location to a GU::RelativeCoordinate.

Returns
A new GU::RelativeCoordinate converted from this location.

Definition at line 483 of file Location.hpp.

References wb_location_to_rr_coord().

Referenced by relativeCoordinate().

◆ relativeCoordinate() [2/2]

std::optional< GU::RelativeCoordinate > guWhiteboard::Location::relativeCoordinate ( const uint8_t  minimumConfidence) const
inline

Convert this location to a GU::RelativeCoordinate only if the confidence of the location is greater than or equal to the specified minimum confidence.

Parameters
[in]minimumConfidenceThe minimim confidence value the confidence() has to be in order for std::optional<GU::RelativeCoordinate>::has_value to be true.
Returns
A new std::optional<GU::RelativeCoordinate> converted from this location where std::optional<GU::RelativeCoordinate>::has_value is only true when confidence() >= minimumConfidence.

Definition at line 520 of file Location.hpp.

References confidence(), and relativeCoordinate().

◆ set_confidence()

void guWhiteboard::Location::set_confidence ( const uint8_t &  t_newValue)
inline

Definition at line 208 of file Location.hpp.

References wb_location::confidence.

Referenced by from_string().

◆ set_direction()

void guWhiteboard::Location::set_direction ( const int16_t &  t_newValue)
inline

Definition at line 178 of file Location.hpp.

References wb_location::direction.

Referenced by from_string().

◆ set_directionVariance()

void guWhiteboard::Location::set_directionVariance ( const uint32_t &  t_newValue)
inline

Definition at line 238 of file Location.hpp.

References wb_location::directionVariance.

Referenced by from_string().

◆ set_distance()

void guWhiteboard::Location::set_distance ( const uint16_t &  t_newValue)
inline

Definition at line 193 of file Location.hpp.

References wb_location::distance.

Referenced by from_string().

◆ set_distanceVariance()

void guWhiteboard::Location::set_distanceVariance ( const uint32_t &  t_newValue)
inline

Definition at line 223 of file Location.hpp.

References wb_location::distanceVariance.

Referenced by from_string().

◆ to_string()

std::string guWhiteboard::Location::to_string ( )
inline

The documentation for this class was generated from the following file: