gusimplewhiteboard
guWhiteboard::VisionRobots Class Reference

Class to post information about Robot posts detected from vision This class contains information the dimension of Robot posts. More...

#include <VisionRobots.hpp>

Collaboration diagram for guWhiteboard::VisionRobots:

Public Member Functions

 VisionRobots ()
 Default Constructor. More...
 
 VisionRobots (std::string s)
 String Constructor Converts a serialized string to a VisionRobot object. More...
 
void from_string (std::string &s)
 
void setRobot (wb_robot robotInfo, VisionCamera camera)
 Add a the Robot to this VisionRobot message. More...
 
const wb_robotrobots (VisionCamera camera, int idx) const
 Get the current Robots for this message. More...
 
wb_robotrobots (VisionCamera camera, int idx)
 Get the current Robots for this message. More...
 
void Reset ()
 Reset the visible flag for all four different posts to false. More...
 
void setFrameNumber (size_t fn)
 Sets the frame number this information in this message was observed. More...
 
size_t frameNumber () const
 Get the frame number the information in this message was observed. More...
 
std::string description ()
 Converts this message into a serialized string. More...
 

Detailed Description

Class to post information about Robot posts detected from vision This class contains information the dimension of Robot posts.

The message contains information for left and right Robot post on top and bottom camera's

Examples

Retrieve the current information about the Robots in the top camera

VisionRobot v = VisionRobot_t.get(); //get the Robot message off the whiteboard
std::vector<wb_robot> r = v.robots(Top); //get the robots from the top camera
 if( !r.empty() ) {
     bool visible = r[0].visible(); //get the visibile flag for the robot
     int x1 = r[0].bottomLeft_X(); //get the bottom left x coordinate for the robot
 }

Definition at line 39 of file VisionRobots.hpp.

Constructor & Destructor Documentation

◆ VisionRobots() [1/2]

guWhiteboard::VisionRobots::VisionRobots ( )
inline

Default Constructor.

Definition at line 48 of file VisionRobots.hpp.

◆ VisionRobots() [2/2]

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

String Constructor Converts a serialized string to a VisionRobot object.

Parameters
sThe String to convert

Definition at line 56 of file VisionRobots.hpp.

References from_string().

Member Function Documentation

◆ description()

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

Converts this message into a serialized string.

Returns
The serialized string

Definition at line 181 of file VisionRobots.hpp.

◆ frameNumber()

size_t guWhiteboard::VisionRobots::frameNumber ( ) const
inline

Get the frame number the information in this message was observed.

Returns
The frame number

Definition at line 173 of file VisionRobots.hpp.

◆ from_string()

void guWhiteboard::VisionRobots::from_string ( std::string &  s)
inline

Definition at line 60 of file VisionRobots.hpp.

References Bottom, setRobot(), and Top.

Referenced by VisionRobots().

◆ Reset()

void guWhiteboard::VisionRobots::Reset ( )
inline

Reset the visible flag for all four different posts to false.

Definition at line 149 of file VisionRobots.hpp.

References BOTTOMLIMIT, and TOPLIMIT.

◆ robots() [1/2]

wb_robot & guWhiteboard::VisionRobots::robots ( VisionCamera  camera,
int  idx 
)
inline

Get the current Robots for this message.

Parameters
cameraThe camera to get Robot post information from
idxThe index of the robot (must be between 0 and TOP or BOTTOMLIMIT)
Returns
The Robot post information.

Definition at line 132 of file VisionRobots.hpp.

References BOTTOMLIMIT, Top, and TOPLIMIT.

◆ robots() [2/2]

const wb_robot & guWhiteboard::VisionRobots::robots ( VisionCamera  camera,
int  idx 
) const
inline

Get the current Robots for this message.

Parameters
cameraThe camera to get Robot post information from
idxThe index of the robot (must be between 0 and TOP or BOTTOMLIMIT)
Returns
The Robot post information.

Definition at line 112 of file VisionRobots.hpp.

References BOTTOMLIMIT, Top, and TOPLIMIT.

◆ setFrameNumber()

void guWhiteboard::VisionRobots::setFrameNumber ( size_t  fn)
inline

Sets the frame number this information in this message was observed.

Parameters
fnThe frame number

Definition at line 165 of file VisionRobots.hpp.

◆ setRobot()

void guWhiteboard::VisionRobots::setRobot ( wb_robot  robotInfo,
VisionCamera  camera 
)
inline

Add a the Robot to this VisionRobot message.

Parameters
robotInfoThe post information to be set
cameraThe camera this post was seen on

Definition at line 95 of file VisionRobots.hpp.

References BOTTOMLIMIT, Top, and TOPLIMIT.

Referenced by from_string().


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