LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Static Public Attributes | List of all members
rcsc::DebugClient Class Reference

Debug Server Interface class. More...

#include <debug_client.h>

Public Member Functions

 DebugClient ()
 init and/or reserve member variables
 
 ~DebugClient ()
 close connection and files.
 
void connect (const std::string &hostname, const int port)
 connect to the debug server More...
 
bool open (const std::string &log_dir, const std::string &teamname, const int unum)
 open debug server message log file. More...
 
void writeAll (const WorldModel &world, const ActionEffector &effector)
 output to stream or socket More...
 
void clear ()
 clear all data
 
void addMessage (const char *msg,...)
 add formatted string to buffer More...
 
void addMessage (const std::string &msg)
 add message string to buffer More...
 
void addSelfComment (const char *msg,...)
 add formatred message for self More...
 
void addComment (const PlayerObject *player, const char *msg,...)
 add formatred message for the player More...
 
void setTarget (const int unum)
 set target player More...
 
void setTarget (const Vector2D &p)
 set target point More...
 
void addLine (const Vector2D &from, const Vector2D &to, const char *color="")
 set line info to be drawn More...
 
void addTriangle (const Vector2D &v1, const Vector2D &v2, const Vector2D &v3, const char *color="")
 set triangle info to be drawn More...
 
void addTriangle (const Triangle2D &tri, const char *color="")
 set triangle info to be drawn More...
 
void addRectangle (const Rect2D &rect, const char *color="")
 set rectangle info to be drawn More...
 
void addCircle (const Vector2D &center, const double &radius, const char *color="")
 set circle info to be drawn More...
 
void addCircle (const Circle2D &circle, const char *color="")
 set circle info to be drawn More...
 

Static Public Attributes

static const std::size_t MAX_LINE = 50
 maximum number of lines in one message.
 
static const std::size_t MAX_TRIANGLE = 50
 maximum number of triangles in one message.
 
static const std::size_t MAX_RECT = 50
 maximum number of rectangles in one message.
 
static const std::size_t MAX_CIRCLE = 50
 maximum number of circles in one message.
 

Detailed Description

Debug Server Interface class.

Current supported debug servers:

Member Function Documentation

◆ addCircle() [1/2]

void rcsc::DebugClient::addCircle ( const Circle2D circle,
const char *  color = "" 
)

set circle info to be drawn

Parameters
circlecircle object

◆ addCircle() [2/2]

void rcsc::DebugClient::addCircle ( const Vector2D center,
const double &  radius,
const char *  color = "" 
)
inline

set circle info to be drawn

Parameters
centercenter coordinate
radiusradius value

◆ addComment()

void rcsc::DebugClient::addComment ( const PlayerObject player,
const char *  msg,
  ... 
)

add formatred message for the player

Parameters
playerpointer to the target player
msgformatted text

◆ addLine()

void rcsc::DebugClient::addLine ( const Vector2D from,
const Vector2D to,
const char *  color = "" 
)

set line info to be drawn

Parameters
fromline start point
toline end point

◆ addMessage() [1/2]

void rcsc::DebugClient::addMessage ( const char *  msg,
  ... 
)

add formatted string to buffer

Parameters
msgformatted text

◆ addMessage() [2/2]

void rcsc::DebugClient::addMessage ( const std::string &  msg)

add message string to buffer

Parameters
msgmessage string

◆ addRectangle()

void rcsc::DebugClient::addRectangle ( const Rect2D rect,
const char *  color = "" 
)

set rectangle info to be drawn

Parameters
rectrectanble object

◆ addSelfComment()

void rcsc::DebugClient::addSelfComment ( const char *  msg,
  ... 
)

add formatred message for self

Parameters
msgformatted text

◆ addTriangle() [1/2]

void rcsc::DebugClient::addTriangle ( const Triangle2D tri,
const char *  color = "" 
)

set triangle info to be drawn

Parameters
tritriangle object

◆ addTriangle() [2/2]

void rcsc::DebugClient::addTriangle ( const Vector2D v1,
const Vector2D v2,
const Vector2D v3,
const char *  color = "" 
)
inline

set triangle info to be drawn

Parameters
v1vertex 1
v2vertex 2
v3vertex 3

◆ connect()

void rcsc::DebugClient::connect ( const std::string &  hostname,
const int  port 
)

connect to the debug server

Parameters
hostnamehost name string thatdebug server is running
portport number for debug server connection

◆ open()

bool rcsc::DebugClient::open ( const std::string &  log_dir,
const std::string &  teamname,
const int  unum 
)

open debug server message log file.

Parameters
log_dirdirectry path name.
teamnameteam name.
unumplayer's uniform number.

◆ setTarget() [1/2]

void rcsc::DebugClient::setTarget ( const int  unum)
inline

set target player

Parameters
unumtarget player's uniform number

◆ setTarget() [2/2]

void rcsc::DebugClient::setTarget ( const Vector2D p)
inline

set target point

Parameters
ptarget point

◆ writeAll()

void rcsc::DebugClient::writeAll ( const WorldModel world,
const ActionEffector effector 
)

output to stream or socket

Parameters
worldconst reference to the world model object
effectorconst reference to the action effector object

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