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

observed player object class More...

#include <player_object.h>

Inheritance diagram for rcsc::PlayerObject:
Inheritance graph
[legend]
Collaboration diagram for rcsc::PlayerObject:
Collaboration graph
[legend]

Public Types

typedef std::list< PlayerObjectList
 type of the player object instance container
 
typedef std::vector< const PlayerObject * > Cont
 type of the player object pointer container
 
- Public Types inherited from rcsc::AbstractPlayerObject
typedef std::vector< const AbstractPlayerObject * > Cont
 type of pointer container
 

Public Member Functions

 PlayerObject ()
 initialize member variables.
 
 PlayerObject (const SideID side, const Localization::PlayerT &p)
 initialize member variables using observed info More...
 
 ~PlayerObject ()
 destructor. nothing to do
 
bool isGhost () const
 check if this player is ghost object or not More...
 
int ghostCount () const
 get the count of ghost check More...
 
int tackleCount () const
 get tackling status accuracy More...
 
bool isTackling () const
 check if player is tackling More...
 
bool posValid () const
 velify global position accuracy More...
 
bool velValid () const
 verify velocity accuracy More...
 
bool bodyValid () const
 verify angle accuracy More...
 
bool faceValid () const
 verify angle accuracy More...
 
const std::list< Vector2D > & posHistory () const
 get the history of estimated position. More...
 
bool isKickable (const double &buf=0.05) const
 check if player can kick the ball or not More...
 
void update ()
 update status only with intenal info
 
void setGhost ()
 increment ghost count
 
void setTeam (const SideID side, const int unum, const bool goalie)
 set player's team info More...
 
void updateBySee (const SideID side, const Localization::PlayerT &p)
 update status using localized player info More...
 
void updateByFullstate (const FullstateSensor::PlayerT &p, const Vector2D &self_pos, const Vector2D &ball_pos)
 update status using fullstate info More...
 
void updateByHear (const SideID heard_side, const int heard_unum, const bool goalie, const Vector2D &heard_pos)
 update staus using heard info More...
 
void updateByHear (const SideID heard_side, const int heard_unum, const bool goalie, const Vector2D &heard_pos, const double &heard_body)
 update staus using heard info More...
 
void updateSelfBallRelated (const Vector2D &self, const Vector2D &ball)
 update status related to other objects More...
 
void setCollisionEffect ()
 set collision effect to player's velocity
 
void forget ()
 reset accuracy info
 
- Public Member Functions inherited from rcsc::AbstractPlayerObject
 AbstractPlayerObject (const int id)
 initialize member variables.
 
 AbstractPlayerObject (const int id, const SideID side, const Localization::PlayerT &p)
 initialize member variables using observed info More...
 
virtual ~AbstractPlayerObject ()=default
 destructor. nothing to do
 
virtual bool isSelf () const
 check if this player is self or not More...
 
virtual bool isGhost () const
 check if this player is ghost object or not More...
 
virtual int ghostCount () const
 get the counter value as a ghost recognition More...
 
virtual bool isTackling () const =0
 check if player is tackling or not More...
 
virtual void setPlayerType (const int type)
 update player type id More...
 
void setCard (const Card card)
 update card state More...
 
void setBallReachStep (const int step)
 set the estimated minimum ball interception step. More...
 
int id () const
 get the ID number for this object More...
 
SideID side () const
 get team side id More...
 
int unum () const
 get player's uniform number More...
 
int unumCount () const
 get uniform number accuracy count More...
 
bool goalie () const
 get goalie flag More...
 
const PlayerTypeplayerTypePtr () const
 get the player type as a pointer. More...
 
Card card () const
 get card type More...
 
const Vector2Dpos () const
 get global position More...
 
int posCount () const
 get global position accuracy More...
 
const Vector2DseenPos () const
 get the last seen position More...
 
int seenPosCount () const
 get the number of cycles since last observation More...
 
const Vector2DheardPos () const
 get the last heard position More...
 
int heardPosCount () const
 get the number of cycles since last observation More...
 
const Vector2Dvel () const
 get velocity More...
 
int velCount () const
 get velocity accuracy More...
 
const Vector2DseenVel () const
 get the last seen velocity More...
 
int seenVelCount () const
 get the number of cycles since last observation More...
 
const AngleDegbody () const
 get global body angle More...
 
int bodyCount () const
 get global body angle accuracy More...
 
const AngleDegface () const
 get global neck angle More...
 
int faceCount () const
 get global neck angle accuracy More...
 
const AngleDegpointtoAngle () const
 get global pointing angle More...
 
int pointtoCount () const
 get global pointing angle accuracy More...
 
bool isKicking () const
 get kicking state information More...
 
double dist2 (const AbstractPlayerObject &p) const
 get the squared distance from this player to the target player More...
 
double dist (const AbstractPlayerObject &p) const
 get the distance from this player to the target player More...
 
double distFromBall () const
 get distance from ball More...
 
const AngleDegangleFromBall () const
 get angle from ball More...
 
double distFromSelf () const
 get distance from self More...
 
const AngleDegangleFromSelf () const
 get global angle from self position More...
 
int ballReachStep () const
 get the estimated minimum ball interception step. More...
 
virtual double kickRate () const
 get current estimated kick power rate More...
 
Vector2D inertiaPoint (const int n_step) const
 estimate reach point More...
 
Vector2D inertiaFinalPoint () const
 estimate final reach point More...
 

Static Public Member Functions

static void set_count_thr (const int pos_thr, const int vel_thr, const int face_thr)
 set accuracy count threshold values. More...
 
static void reset_player_count ()
 reset player count to 0.
 
- Static Public Member Functions inherited from rcsc::AbstractPlayerObject
static double get_minimum_evaluation (const Cont &cont, const PlayerEvaluator *evaluator)
 get minimum evaluation value within the input container using evaluator More...
 
static double get_maximum_evaluation (const Cont &cont, const PlayerEvaluator *evaluator)
 get maximum evaluation value within the input container using evaluator More...
 

Additional Inherited Members

- Protected Attributes inherited from rcsc::AbstractPlayerObject
int M_id
 identical number as object ID
 
SideID M_side
 team side
 
int M_unum
 uniform number
 
int M_unum_count
 accuracy count
 
bool M_goalie
 goalie flag
 
const PlayerTypeM_player_type
 player type reference
 
Card M_card
 card information
 
Vector2D M_pos
 global coordinate
 
int M_pos_count
 main accuracy counter
 
Vector2D M_seen_pos
 last seen global coordinate
 
int M_seen_pos_count
 count since last observation
 
Vector2D M_heard_pos
 last heard global coordinate
 
int M_heard_pos_count
 count since last observation
 
Vector2D M_vel
 velocity
 
int M_vel_count
 accuracy count
 
Vector2D M_seen_vel
 last seen velocity
 
int M_seen_vel_count
 count since last observation
 
AngleDeg M_body
 global body angle
 
int M_body_count
 body angle accuracy
 
AngleDeg M_face
 global neck angle
 
int M_face_count
 face angle accuracy
 
AngleDeg M_pointto_angle
 global pointing angle
 
int M_pointto_count
 time count since the last pointto observation
 
bool M_kicking
 kicking state
 
double M_dist_from_ball
 distance from ball
 
AngleDeg M_angle_from_ball
 angle from ball
 
double M_dist_from_self
 distance from self
 
AngleDeg M_angle_from_self
 angle from self
 

Detailed Description

observed player object class

Constructor & Destructor Documentation

◆ PlayerObject()

rcsc::PlayerObject::PlayerObject ( const SideID  side,
const Localization::PlayerT p 
)

initialize member variables using observed info

Parameters
sideanalyzed side info
panalyzed seen player info

Member Function Documentation

◆ bodyValid()

bool rcsc::PlayerObject::bodyValid ( ) const
inline

verify angle accuracy

Returns
true if angle has enoubh accuracy

◆ faceValid()

bool rcsc::PlayerObject::faceValid ( ) const
inline

verify angle accuracy

Returns
true if angle has enoubh accuracy

◆ ghostCount()

int rcsc::PlayerObject::ghostCount ( ) const
inlinevirtual

get the count of ghost check

Returns
count of ghost check

Reimplemented from rcsc::AbstractPlayerObject.

◆ isGhost()

bool rcsc::PlayerObject::isGhost ( ) const
inlinevirtual

check if this player is ghost object or not

Returns
true if this player may be ghost object

Reimplemented from rcsc::AbstractPlayerObject.

◆ isKickable()

bool rcsc::PlayerObject::isKickable ( const double &  buf = 0.05) const

check if player can kick the ball or not

buf kickable area buffer

Returns
true if player can kick the ball

◆ isTackling()

bool rcsc::PlayerObject::isTackling ( ) const
virtual

check if player is tackling

Returns
true if tackle accuracy is less than tackle cycles in ServerParam

Implements rcsc::AbstractPlayerObject.

◆ posHistory()

const std::list< Vector2D > & rcsc::PlayerObject::posHistory ( ) const
inline

get the history of estimated position.

Returns
position list. the front element is the position at the previous cycle.

◆ posValid()

bool rcsc::PlayerObject::posValid ( ) const
inline

velify global position accuracy

Returns
true if position has enough accuracy

◆ set_count_thr()

static void rcsc::PlayerObject::set_count_thr ( const int  pos_thr,
const int  vel_thr,
const int  face_thr 
)
static

set accuracy count threshold values.

Parameters
pos_thrthreshold value for M_pos
vel_thrthreshold value for M_vel
face_thrthreshold value for M_body and M_face

◆ setTeam()

void rcsc::PlayerObject::setTeam ( const SideID  side,
const int  unum,
const bool  goalie 
)
inline

set player's team info

Parameters
sideplayer's team side
unumplayer's uniform number
goaliegoalie flag

◆ tackleCount()

int rcsc::PlayerObject::tackleCount ( ) const
inline

get tackling status accuracy

Returns
count from last observation

◆ updateByFullstate()

void rcsc::PlayerObject::updateByFullstate ( const FullstateSensor::PlayerT p,
const Vector2D self_pos,
const Vector2D ball_pos 
)

update status using fullstate info

Parameters
pfullstate player info
self_posglobal self position
ball_posglobal ball position

◆ updateByHear() [1/2]

void rcsc::PlayerObject::updateByHear ( const SideID  heard_side,
const int  heard_unum,
const bool  goalie,
const Vector2D heard_pos 
)

update staus using heard info

Parameters
heard_sideheard side info
heard_unumheard uniform number
goalieupdate goalie info, only if this value is true.
heard_posheard global position

◆ updateByHear() [2/2]

void rcsc::PlayerObject::updateByHear ( const SideID  heard_side,
const int  heard_unum,
const bool  goalie,
const Vector2D heard_pos,
const double &  heard_body 
)

update staus using heard info

Parameters
heard_sideheard side info
heard_unumheard uniform number
goalieupdate goalie info, only if this value is true.
heard_posheard global position
heard_bodyheard body angle

◆ updateBySee()

void rcsc::PlayerObject::updateBySee ( const SideID  side,
const Localization::PlayerT p 
)

update status using localized player info

Parameters
sideanalyzed side info
plocalized player info

◆ updateSelfBallRelated()

void rcsc::PlayerObject::updateSelfBallRelated ( const Vector2D self,
const Vector2D ball 
)

update status related to other objects

Parameters
selfself position
ballball position

This method is called just before decide action

◆ velValid()

bool rcsc::PlayerObject::velValid ( ) const
inline

verify velocity accuracy

Returns
true if accuracy has enough accuracy

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