Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

PlayerObject Class Reference

#include <Objects.h>

Inheritance diagram for PlayerObject:

Inheritance graph
[legend]
Collaboration diagram for PlayerObject:

Collaboration graph
[legend]
List of all members.

Public Methods

 PlayerObject ()
void show (ostream &os=cout)
void show (const char *strTeamName, ostream &os=cout)
bool setPossibleRange (ObjectT objMin, ObjectT objMax)
bool isInRange (ObjectT obj)
ObjectT getMinRange ()
ObjectT getMaxRange ()
bool setIsKnownPlayer (bool b)
bool getIsKnownPlayer () const
bool setIsGoalie (bool b)
bool getIsGoalie () const
bool setRelativeBodyAngle (AngDeg ang, Time time)
AngDeg getRelativeBodyAngle () const
bool setGlobalBodyAngle (AngDeg ang, Time time)
AngDeg getGlobalBodyAngle () const
bool setRelativeNeckAngle (AngDeg ang, Time time)
AngDeg getRelativeNeckAngle () const
bool setGlobalNeckAngle (AngDeg ang, Time time)
AngDeg getGlobalNeckAngle () const
bool setTimeRelativeAngles (Time time)
Time getTimeRelativeAngles () const
bool setTimeGlobalAngles (Time time)
Time getTimeGlobalAngles () const

Protected Attributes

bool isKnownPlayer
ObjectT objRangeMin
ObjectT objRangeMax
bool isGoalie
AngDeg angGlobalBodyAngle
AngDeg angGlobalNeckAngle
Time timeGlobalAngles

Private Attributes

AngDeg angRelativeBodyAngle
AngDeg angRelativeNeckAngle
Time timeRelativeAngles

Detailed Description

Class PlayerObject contains RoboCup information that is available for players. Different variables are added to the superclass DynamicObject

Definition at line 183 of file Objects.h.


Constructor & Destructor Documentation

PlayerObject::PlayerObject  
 

This is the constructor for PlayerObject. A PlayerObject is created with all variables initialized to (illegal) default values

Definition at line 440 of file Objects.C.

References angGlobalBodyAngle, angGlobalNeckAngle, angRelativeBodyAngle, angRelativeNeckAngle, isGoalie, isKnownPlayer, and UnknownAngleValue.


Member Function Documentation

AngDeg PlayerObject::getGlobalBodyAngle   const
 

This method returns the global body angle of this object. This information is from the server time that is returned by getTimeGlobalAngles().

Returns:
global body angle of this object

Definition at line 486 of file Objects.C.

References AngDeg.

Referenced by WorldModel::getAgentGlobalBodyAngle(), WorldModel::getGlobalBodyAngle(), and show().

AngDeg PlayerObject::getGlobalNeckAngle   const
 

This method returns the global neck angle of this object. This information is from the time that is returned by getTimeGlobalAngles().

Returns:
global neck angle of this object

Definition at line 526 of file Objects.C.

References AngDeg.

Referenced by WorldModel::calculateStatePlayer(), WorldModel::getAgentGlobalNeckAngle(), and WorldModel::getGlobalNeckAngle().

bool PlayerObject::getIsGoalie   const
 

This method returns whether the current object is a goalie or not.

Returns:
bool indicating whether this dynamic object is a goalie or not

Definition at line 649 of file Objects.C.

References isGoalie.

Referenced by WorldModel::getOppGoalieType(), and WorldModel::getOwnGoalieType().

bool PlayerObject::getIsKnownPlayer   const
 

This method returns whether the current object is a known player or not. A known player is a player of which we know the number. If we don't know the player number of a player, the player is put at the index of a player that isn't seen in a while and the isKnownPlayer attribute is set to false.

Returns:
bool indicating whether player number is known

Definition at line 633 of file Objects.C.

References isKnownPlayer.

Referenced by WorldModel::isKnownPlayer(), and WorldModel::processPerfectHearInfo().

ObjectT PlayerObject::getMaxRange  
 

This method returns the maximal possible object type as set by 'setPossibleRange'.

Returns:
maximal possible object type

Definition at line 611 of file Objects.C.

References ObjectT, and objRangeMax.

ObjectT PlayerObject::getMinRange  
 

This method returns the minimal possible object type as set by 'setPossibleRange'.

Returns:
minimal possible object type

Definition at line 603 of file Objects.C.

References ObjectT, and objRangeMin.

AngDeg PlayerObject::getRelativeBodyAngle   const
 

This method returns the relative body angle of this object. This information is from the server time that is returned by getTimeRelativeAngles().

Returns:
relative body angle of this object

Definition at line 466 of file Objects.C.

References AngDeg.

Referenced by WorldModel::updateDynamicObjectAfterSee().

AngDeg PlayerObject::getRelativeNeckAngle   const
 

This method returns the relative neck angle of this object. This information is from the time that is returned by getTimeRelativeAngles().

Returns:
relative neck angle of this object

Definition at line 506 of file Objects.C.

References AngDeg.

Referenced by WorldModel::updateDynamicObjectAfterSee().

Time PlayerObject::getTimeGlobalAngles   const
 

This method returns the server time in which the global body and neck angle of this object were calculated.

Returns:
time of the global neck and body information

Definition at line 560 of file Objects.C.

References timeGlobalAngles.

Referenced by WorldModel::getTimeGlobalAngles().

Time PlayerObject::getTimeRelativeAngles   const
 

This method returns the server time in which the relative body and neck angle of this object were calculated.

Returns:
time of the relative neck and body information

Definition at line 543 of file Objects.C.

References timeRelativeAngles.

Referenced by WorldModel::updateDynamicObjectAfterSee().

bool PlayerObject::isInRange ObjectT    obj
 

This method returns a boolean indicating whether the supplied object type, is in the range of possible object types set by 'setPossibleRange'.

Parameters:
obj  Object type that should be checked
Returns:
boolean indicating whether 'obj' is located in the range.

Definition at line 584 of file Objects.C.

References SoccerTypes::getIndex(), SoccerTypes::isOpponent(), ObjectT, objRangeMax, and objRangeMin.

Referenced by WorldModel::getFirstEmptySpotInSet(), and WorldModel::mapUnknownPlayers().

bool PlayerObject::setGlobalBodyAngle AngDeg    ang,
Time    time
 

This method sets the facing direction of the body and the time of this information (all global).

Parameters:
ang  new global facing direction of body
time  time corresponding to the facing direction
Returns:
bool indicating whether the values were set

Definition at line 476 of file Objects.C.

References AngDeg, angGlobalBodyAngle, and setTimeGlobalAngles().

Referenced by WorldModel::processSeeGlobalInfo(), and WorldModel::updateDynamicObjectAfterSee().

bool PlayerObject::setGlobalNeckAngle AngDeg    ang,
Time    time
 

This method returns the facing direction of the neck and the time of this information (all global).

Parameters:
ang  new global facing direction of neck
iTime  time facing direction was received
Returns:
bool indicating whether the values were set

Definition at line 516 of file Objects.C.

References AngDeg, angGlobalNeckAngle, and setTimeGlobalAngles().

Referenced by WorldModel::processSeeGlobalInfo(), and WorldModel::updateDynamicObjectAfterSee().

bool PlayerObject::setIsGoalie bool    b
 

This method sets whether this dynamic object is a goalie or not.

Parameters:
b  bool indicating whether this dynamic object is a goalie
Returns:
bool indicating whether value was set.

Definition at line 641 of file Objects.C.

References isGoalie.

Referenced by WorldModel::processPerfectHearInfo().

bool PlayerObject::setIsKnownPlayer bool    b
 

This method sets whether this dynamic object is a known player or not. A known player is a player of which we know the number. If we don't know the player number of a player, the player is put at the index of a player that isn't seen in a while and the isKnownPlayer attribute is set to false.

Parameters:
b  bool indicating whether player number is known
Returns:
bool indicating whether value was set.

Definition at line 622 of file Objects.C.

References isKnownPlayer.

Referenced by WorldModel::processPerfectHearInfo(), WorldModel::processSeeGlobalInfo(), and WorldModel::setIsKnownPlayer().

bool PlayerObject::setPossibleRange ObjectT    objMin,
ObjectT    objMax
 

This method sets the possible range from which this object must originate from. Since the ordening of objects in a 'see' message is always the same (first teammates then opponents and always sorted by player number), it is possible to derive the range of objects from which the supplied information must originate.

Parameters:
objMin  minimum object type
objMax  maximum object type
Returns:
bool indicating whether update was successful.

Definition at line 573 of file Objects.C.

References ObjectT, objRangeMax, and objRangeMin.

bool PlayerObject::setRelativeBodyAngle AngDeg    ang,
Time    time
 

This method sets the facing direction of the body and the time of this information (all relative to the agent).

Parameters:
ang  new relative facing direction of body
time  time corresponding to the facing direction
Returns:
bool indicating whether the values were set

Definition at line 456 of file Objects.C.

References AngDeg, angRelativeBodyAngle, and setTimeRelativeAngles().

bool PlayerObject::setRelativeNeckAngle AngDeg    ang,
Time    time
 

This method returns the facing direction of the neck and the time of this information (all relative to the agent).

Parameters:
ang  new relative facing direction of neck
time  time facing direction was received
Returns:
bool indicating whether the values were set

Definition at line 496 of file Objects.C.

References AngDeg, angRelativeNeckAngle, and setTimeRelativeAngles().

bool PlayerObject::setTimeGlobalAngles Time    time
 

This method sets the time the facing direction was calculated.

Parameters:
time  time the facing direction was received
Returns:
bool indicating whether the values were set

Definition at line 551 of file Objects.C.

References timeGlobalAngles.

Referenced by setGlobalBodyAngle(), and setGlobalNeckAngle().

bool PlayerObject::setTimeRelativeAngles Time    time
 

This method sets the time the facing direction was calculated.

Parameters:
time  time the facing direction was received
Returns:
bool indicating whether the values were set

Definition at line 534 of file Objects.C.

References timeRelativeAngles.

Referenced by setRelativeBodyAngle(), and setRelativeNeckAngle().

void PlayerObject::show const char *    strTeamName,
ostream &    os = cout
 

This method prints the information about this PlayerObject to the specified output stream. The variables are printed with the specified team name.

Parameters:
strTeamName  team name of this player object
os  output stream to which output is written

Reimplemented in AgentObject.

Definition at line 667 of file Objects.C.

References angGlobalNeckAngle, Object::getConfidence(), getGlobalBodyAngle(), SoccerTypes::getObjectStr(), isKnownPlayer, MAX_TEAM_NAME_LENGTH, Object::objectType, Object::posGlobal, timeGlobalAngles, Object::timeGlobalPosition, DynamicObject::timeGlobalVelocity, Object::timeLastSeen, and DynamicObject::vecGlobalVelocity.

void PlayerObject::show ostream &    os = cout [virtual]
 

This method prints the information about this PlayerObject to the specified output stream. The variables are printed with the default team name.

Parameters:
os  output stream to which output is written

Reimplemented from Object.

Reimplemented in AgentObject.

Definition at line 658 of file Objects.C.

References DEFAULT_TEAM_NAME.

Referenced by WorldModel::show().


Member Data Documentation

AngDeg PlayerObject::angGlobalBodyAngle [protected]
 

Global body angle

Definition at line 190 of file Objects.h.

Referenced by PlayerObject(), setGlobalBodyAngle(), and AgentObject::setGlobalNeckAngle().

AngDeg PlayerObject::angGlobalNeckAngle [protected]
 

Global neck angle

Definition at line 191 of file Objects.h.

Referenced by AgentObject::AgentObject(), PlayerObject(), AgentObject::setGlobalNeckAngle(), setGlobalNeckAngle(), AgentObject::show(), and show().

AngDeg PlayerObject::angRelativeBodyAngle [private]
 

Relative body angle to main player

Definition at line 195 of file Objects.h.

Referenced by PlayerObject(), and setRelativeBodyAngle().

AngDeg PlayerObject::angRelativeNeckAngle [private]
 

Relative neck angle to main player

Definition at line 196 of file Objects.h.

Referenced by PlayerObject(), and setRelativeNeckAngle().

bool PlayerObject::isGoalie [protected]
 

is this object a goalie

Definition at line 189 of file Objects.h.

Referenced by getIsGoalie(), PlayerObject(), and setIsGoalie().

bool PlayerObject::isKnownPlayer [protected]
 

are we sure about player number

Definition at line 186 of file Objects.h.

Referenced by getIsKnownPlayer(), PlayerObject(), setIsKnownPlayer(), and show().

ObjectT PlayerObject::objRangeMax [protected]
 

Maximum in range of possible player obj

Definition at line 188 of file Objects.h.

Referenced by getMaxRange(), isInRange(), and setPossibleRange().

ObjectT PlayerObject::objRangeMin [protected]
 

Minimum in range of possible player obj

Definition at line 187 of file Objects.h.

Referenced by getMinRange(), isInRange(), and setPossibleRange().

Time PlayerObject::timeGlobalAngles [protected]
 

Server time of global angles

Definition at line 192 of file Objects.h.

Referenced by getTimeGlobalAngles(), setTimeGlobalAngles(), and show().

Time PlayerObject::timeRelativeAngles [private]
 

Server time of relative angles

Definition at line 197 of file Objects.h.

Referenced by getTimeRelativeAngles(), and setTimeRelativeAngles().


The documentation for this class was generated from the following files:
Generated on Tue Jul 2 10:19:20 2002 for UvA Trilearn 2002 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001