gusimplewhiteboard
guWhiteboard::BallPosition Class Reference

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

#include <BallPosition.hpp>

Inheritance diagram for guWhiteboard::BallPosition:
Collaboration diagram for guWhiteboard::BallPosition:

Public Member Functions

 BallPosition (int16_t t_x=0, int16_t t_y=0, int16_t t_pitchInDegrees=0, int16_t t_yawInDegrees=0, int16_t t_rollInDegrees=0, uint8_t t_confidence=0)
 Create a new BallPosition. More...
 
 BallPosition (const BallPosition &t_other)
 Copy Constructor. More...
 
 BallPosition (const struct wb_ball_position &t_other)
 Copy Constructor. More...
 
BallPositionoperator= (const BallPosition &t_other)
 Copy Assignment Operator. More...
 
BallPositionoperator= (const struct wb_ball_position &t_other)
 Copy Assignment Operator. More...
 
bool operator== (const BallPosition &t_other) const
 
bool operator!= (const BallPosition &t_other) const
 
bool operator== (const wb_ball_position &t_other) const
 
bool operator!= (const wb_ball_position &t_other) const
 
int16_t & x ()
 
const int16_t & x () const
 
void set_x (const int16_t &t_newValue)
 
int16_t & y ()
 
const int16_t & y () const
 
void set_y (const int16_t &t_newValue)
 
int16_t & pitchInDegrees ()
 
const int16_t & pitchInDegrees () const
 
void set_pitchInDegrees (const int16_t &t_newValue)
 
int16_t & yawInDegrees ()
 
const int16_t & yawInDegrees () const
 
void set_yawInDegrees (const int16_t &t_newValue)
 
int16_t & rollInDegrees ()
 
const int16_t & rollInDegrees () const
 
void set_rollInDegrees (const int16_t &t_newValue)
 
uint8_t & confidence ()
 
const uint8_t & confidence () const
 
void set_confidence (const uint8_t &t_newValue)
 
 BallPosition (const std::string &t_str)
 String Constructor. More...
 
std::string description ()
 
std::string to_string ()
 
void from_string (const std::string &t_str)
 
double confidencePercent () const
 WHITEBOARD_POSTER_STRING_CONVERSION. More...
 
void set_confidencePercent (const double newValue)
 Converts and stores a percentage floating point value in BallPosition.confidence. More...
 

Additional Inherited Members

- Public Attributes inherited from wb_ball_position
int16_t x
 The x coordinate. More...
 
int16_t y
 The y coordinate. More...
 
int16_t pitchInDegrees
 The pitch orientation. More...
 
int16_t yawInDegrees
 The yaw orientation. More...
 
int16_t rollInDegrees
 The roll orientation. More...
 
uint8_t confidence
 The confidence that the ball is at this position. More...
 

Detailed Description

Provides a C++ wrapper around wb_ball_position.

Definition at line 83 of file BallPosition.hpp.

Constructor & Destructor Documentation

◆ BallPosition() [1/4]

guWhiteboard::BallPosition::BallPosition ( int16_t  t_x = 0,
int16_t  t_y = 0,
int16_t  t_pitchInDegrees = 0,
int16_t  t_yawInDegrees = 0,
int16_t  t_rollInDegrees = 0,
uint8_t  t_confidence = 0 
)
inline

Create a new BallPosition.

Definition at line 104 of file BallPosition.hpp.

Referenced by operator==().

◆ BallPosition() [2/4]

guWhiteboard::BallPosition::BallPosition ( const BallPosition t_other)
inline

Copy Constructor.

Definition at line 111 of file BallPosition.hpp.

References confidence(), pitchInDegrees(), rollInDegrees(), x(), y(), and yawInDegrees().

◆ BallPosition() [3/4]

guWhiteboard::BallPosition::BallPosition ( const struct wb_ball_position t_other)
inline

◆ BallPosition() [4/4]

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

String Constructor.

Definition at line 257 of file BallPosition.hpp.

References from_string().

Member Function Documentation

◆ confidence() [1/2]

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

◆ confidence() [2/2]

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

Definition at line 243 of file BallPosition.hpp.

References wb_ball_position::confidence.

◆ confidencePercent()

double guWhiteboard::BallPosition::confidencePercent ( ) const
inline

WHITEBOARD_POSTER_STRING_CONVERSION.

Converts BallPosition.confidence() to its corresponding floating point percentage representation.

Returns
A double representing BallPosition.confidence() as a percentage where 0 represents 0.0 and 255 represents 1.0.

Definition at line 446 of file BallPosition.hpp.

References confidence().

◆ description()

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

USE_WB_BALL_POSITION_C_CONVERSION

Definition at line 262 of file BallPosition.hpp.

References BALL_POSITION_DESC_BUFFER_SIZE, confidence(), pitchInDegrees(), rollInDegrees(), wb_ball_position_description(), x(), y(), and yawInDegrees().

◆ from_string()

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

USE_WB_BALL_POSITION_C_CONVERSION

Definition at line 312 of file BallPosition.hpp.

References BALL_POSITION_DESC_BUFFER_SIZE, set_confidence(), set_pitchInDegrees(), set_rollInDegrees(), set_x(), set_y(), and set_yawInDegrees().

Referenced by BallPosition().

◆ operator!=() [1/2]

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

Definition at line 148 of file BallPosition.hpp.

◆ operator!=() [2/2]

bool guWhiteboard::BallPosition::operator!= ( const wb_ball_position t_other) const
inline

Definition at line 158 of file BallPosition.hpp.

◆ operator=() [1/2]

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

Copy Assignment Operator.

Definition at line 125 of file BallPosition.hpp.

References confidence(), pitchInDegrees(), rollInDegrees(), x(), y(), and yawInDegrees().

◆ operator=() [2/2]

BallPosition & guWhiteboard::BallPosition::operator= ( const struct wb_ball_position t_other)
inline

◆ operator==() [1/2]

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

Definition at line 138 of file BallPosition.hpp.

References confidence(), pitchInDegrees(), rollInDegrees(), x(), y(), and yawInDegrees().

◆ operator==() [2/2]

bool guWhiteboard::BallPosition::operator== ( const wb_ball_position t_other) const
inline

Definition at line 153 of file BallPosition.hpp.

References BallPosition().

◆ pitchInDegrees() [1/2]

int16_t & guWhiteboard::BallPosition::pitchInDegrees ( )
inline

◆ pitchInDegrees() [2/2]

const int16_t & guWhiteboard::BallPosition::pitchInDegrees ( ) const
inline

Definition at line 198 of file BallPosition.hpp.

References wb_ball_position::pitchInDegrees.

◆ rollInDegrees() [1/2]

int16_t & guWhiteboard::BallPosition::rollInDegrees ( )
inline

◆ rollInDegrees() [2/2]

const int16_t & guWhiteboard::BallPosition::rollInDegrees ( ) const
inline

Definition at line 228 of file BallPosition.hpp.

References wb_ball_position::rollInDegrees.

◆ set_confidence()

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

Definition at line 248 of file BallPosition.hpp.

References wb_ball_position::confidence.

Referenced by from_string(), and set_confidencePercent().

◆ set_confidencePercent()

void guWhiteboard::BallPosition::set_confidencePercent ( const double  newValue)
inline

Converts and stores a percentage floating point value in BallPosition.confidence.

Parameters
[in]newValueThe floating point percentage value which will be converted to the integer representations such that 0.0 equals 0 and 1.0 equals 255.

Definition at line 459 of file BallPosition.hpp.

References set_confidence().

◆ set_pitchInDegrees()

void guWhiteboard::BallPosition::set_pitchInDegrees ( const int16_t &  t_newValue)
inline

Definition at line 203 of file BallPosition.hpp.

References wb_ball_position::pitchInDegrees.

Referenced by from_string().

◆ set_rollInDegrees()

void guWhiteboard::BallPosition::set_rollInDegrees ( const int16_t &  t_newValue)
inline

Definition at line 233 of file BallPosition.hpp.

References wb_ball_position::rollInDegrees.

Referenced by from_string().

◆ set_x()

void guWhiteboard::BallPosition::set_x ( const int16_t &  t_newValue)
inline

Definition at line 173 of file BallPosition.hpp.

References wb_ball_position::x.

Referenced by from_string().

◆ set_y()

void guWhiteboard::BallPosition::set_y ( const int16_t &  t_newValue)
inline

Definition at line 188 of file BallPosition.hpp.

References wb_ball_position::y.

Referenced by from_string().

◆ set_yawInDegrees()

void guWhiteboard::BallPosition::set_yawInDegrees ( const int16_t &  t_newValue)
inline

Definition at line 218 of file BallPosition.hpp.

References wb_ball_position::yawInDegrees.

Referenced by from_string().

◆ to_string()

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

◆ x() [1/2]

int16_t & guWhiteboard::BallPosition::x ( )
inline

Definition at line 163 of file BallPosition.hpp.

References wb_ball_position::x.

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

◆ x() [2/2]

const int16_t & guWhiteboard::BallPosition::x ( ) const
inline

Definition at line 168 of file BallPosition.hpp.

References wb_ball_position::x.

◆ y() [1/2]

int16_t & guWhiteboard::BallPosition::y ( )
inline

Definition at line 178 of file BallPosition.hpp.

References wb_ball_position::y.

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

◆ y() [2/2]

const int16_t & guWhiteboard::BallPosition::y ( ) const
inline

Definition at line 183 of file BallPosition.hpp.

References wb_ball_position::y.

◆ yawInDegrees() [1/2]

int16_t & guWhiteboard::BallPosition::yawInDegrees ( )
inline

◆ yawInDegrees() [2/2]

const int16_t & guWhiteboard::BallPosition::yawInDegrees ( ) const
inline

Definition at line 213 of file BallPosition.hpp.

References wb_ball_position::yawInDegrees.


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