gusimplewhiteboard
guWhiteboard::VisionBall Class Reference

Whiteboard Class used by vision to report detect ball Reports balls detected in top or bottom camera, including position and size. More...

#include <VisionBall.hpp>

Collaboration diagram for guWhiteboard::VisionBall:

Public Member Functions

 VisionBall ()
 Default Constructor. More...
 
VisionBalloperator= (const VisionBall &a)
 Equals Operator sets the frame number as well as contents of top and bottom ball and there visibility. More...
 
 VisionBall (const VisionBall &ball)
 Const reference constructor, copys contents of passed object. More...
 
std::bitset< 2 > getMask () const
 DEPRICATED. More...
 
void setBall (SimpleCircle ballInfo, VisionCamera camera)
 Set the ball for this message for a specified camera. More...
 
void setBall (wb_ball ballInfo, VisionCamera camera)
 Set the ball for this message for a specified camera. More...
 
int16_t topRadius () const
 Radius of the top ball. More...
 
int16_t topX () const
 Center X Position of the top ball. More...
 
int16_t topY () const
 Center Y Position of the top ball. More...
 
int16_t bottomRadius () const
 Radius of the bottom ball. More...
 
int16_t bottomX () const
 Center X Position of the bottom ball. More...
 
int16_t bottomY () const
 Center Y Position of the bottom ball. More...
 
bool visible ()
 Return true if either the top or bottom ball is visible in this message. More...
 
int16_t radius () const
 Return the radius one of the balls. More...
 
int16_t x () const
 Return the center x coordinate of one of the balls. More...
 
int16_t y () const
 Return the center y coordinate of one of the balls. More...
 
void Reset ()
 Set the top and bottom visible flags to false. More...
 
 VisionBall (std::string s)
 String constructor. More...
 
 VisionBall (const char *s)
 Const char array constructor. More...
 
void from_string (std::string s)
 Parse as string and set this object to the tokenized contents. More...
 
std::string description ()
 Description of the VisionBall object. More...
 

Static Public Attributes

static const char SEPARATOR_IS_AT = '@'
 USED INTERNALLY FOR STRING PARSER. More...
 

Detailed Description

Whiteboard Class used by vision to report detect ball Reports balls detected in top or bottom camera, including position and size.

Examples

Get

Definition at line 32 of file VisionBall.hpp.

Constructor & Destructor Documentation

◆ VisionBall() [1/4]

guWhiteboard::VisionBall::VisionBall ( )
inline

Default Constructor.

Definition at line 47 of file VisionBall.hpp.

◆ VisionBall() [2/4]

guWhiteboard::VisionBall::VisionBall ( const VisionBall ball)
inline

Const reference constructor, copys contents of passed object.

Parameters
ballThe ball whose contents is copied

Definition at line 65 of file VisionBall.hpp.

◆ VisionBall() [3/4]

guWhiteboard::VisionBall::VisionBall ( std::string  s)
inline

String constructor.

Parameters
sThe tokenized string to parse

Definition at line 222 of file VisionBall.hpp.

References from_string().

◆ VisionBall() [4/4]

guWhiteboard::VisionBall::VisionBall ( const char *  s)
inline

Const char array constructor.

Parameters
sThe tokenized const char array to parse

Definition at line 230 of file VisionBall.hpp.

References from_string().

Member Function Documentation

◆ bottomRadius()

int16_t guWhiteboard::VisionBall::bottomRadius ( ) const
inline

Radius of the bottom ball.

Undefined if !bottomVisible

Returns
the radius

Definition at line 144 of file VisionBall.hpp.

◆ bottomX()

int16_t guWhiteboard::VisionBall::bottomX ( ) const
inline

Center X Position of the bottom ball.

Undefined if !bottomVisible

Returns
Center X Position

Definition at line 150 of file VisionBall.hpp.

◆ bottomY()

int16_t guWhiteboard::VisionBall::bottomY ( ) const
inline

Center Y Position of the bottom ball.

Undefined if !bottomVisible

Returns
Center Y Position

Definition at line 156 of file VisionBall.hpp.

◆ description()

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

Description of the VisionBall object.

Returns
The string description

Definition at line 278 of file VisionBall.hpp.

References SEPARATOR_IS_AT.

◆ from_string()

void guWhiteboard::VisionBall::from_string ( std::string  s)
inline

Parse as string and set this object to the tokenized contents.

Parameters
sThe string to parse

Definition at line 239 of file VisionBall.hpp.

References Bottom, Reset(), SEPARATOR_IS_AT, setBall(), Top, and u_int16_t.

Referenced by VisionBall().

◆ getMask()

std::bitset< 2 > guWhiteboard::VisionBall::getMask ( ) const
inline

DEPRICATED.

Definition at line 74 of file VisionBall.hpp.

References Bottom, and Top.

◆ operator=()

VisionBall & guWhiteboard::VisionBall::operator= ( const VisionBall a)
inline

Equals Operator sets the frame number as well as contents of top and bottom ball and there visibility.

Definition at line 53 of file VisionBall.hpp.

◆ radius()

int16_t guWhiteboard::VisionBall::radius ( ) const
inline

Return the radius one of the balls.

Returns
The top ball radius if it is visible else the bottom ball radius if it is visible else 0

Definition at line 168 of file VisionBall.hpp.

◆ Reset()

void guWhiteboard::VisionBall::Reset ( )
inline

Set the top and bottom visible flags to false.

Definition at line 206 of file VisionBall.hpp.

Referenced by from_string().

◆ setBall() [1/2]

void guWhiteboard::VisionBall::setBall ( SimpleCircle  ballInfo,
VisionCamera  camera 
)
inline

Set the ball for this message for a specified camera.

Parameters
ballInfothe ball to set
camerathe camera this ball was seen on

Definition at line 85 of file VisionBall.hpp.

References Bottom, and Top.

Referenced by from_string().

◆ setBall() [2/2]

void guWhiteboard::VisionBall::setBall ( wb_ball  ballInfo,
VisionCamera  camera 
)
inline

Set the ball for this message for a specified camera.

Parameters
ballInfothe ball to set
camerathe camera this ball was seen on

Definition at line 106 of file VisionBall.hpp.

References Bottom, and Top.

◆ topRadius()

int16_t guWhiteboard::VisionBall::topRadius ( ) const
inline

Radius of the top ball.

Undefined if !topVisible

Returns
the radius

Definition at line 126 of file VisionBall.hpp.

◆ topX()

int16_t guWhiteboard::VisionBall::topX ( ) const
inline

Center X Position of the top ball.

Undefined if !topVisible

Returns
Center X Position

Definition at line 132 of file VisionBall.hpp.

◆ topY()

int16_t guWhiteboard::VisionBall::topY ( ) const
inline

Center Y Position of the top ball.

Undefined if !topVisible

Returns
Center Y Position

Definition at line 138 of file VisionBall.hpp.

◆ visible()

bool guWhiteboard::VisionBall::visible ( )
inline

Return true if either the top or bottom ball is visible in this message.

Returns
True if top or bottom is visible

Definition at line 162 of file VisionBall.hpp.

◆ x()

int16_t guWhiteboard::VisionBall::x ( ) const
inline

Return the center x coordinate of one of the balls.

Returns
The top ball x coordinate if it is visible else the bottom ball x coordinate if it is visible else 0

Definition at line 181 of file VisionBall.hpp.

◆ y()

int16_t guWhiteboard::VisionBall::y ( ) const
inline

Return the center y coordinate of one of the balls.

Returns
The top ball y coordinate if it is visible else the bottom ball y coordinate if it is visible else 0

Definition at line 194 of file VisionBall.hpp.

Member Data Documentation

◆ SEPARATOR_IS_AT

const char guWhiteboard::VisionBall::SEPARATOR_IS_AT = '@'
static

USED INTERNALLY FOR STRING PARSER.

Definition at line 214 of file VisionBall.hpp.

Referenced by description(), and from_string().


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