PlayerObject Class Reference

#include <Objects.h>

Inheritance diagram for PlayerObject:

Inheritance graph
[legend]

Public Member Functions

 PlayerObject ()
void show (ostream &os=cout)
void show (const char *strTeamName, ostream &os=cout)
bool setPossibleRange (ObjectT objMin, ObjectT objMax)
bool isInRange (ObjectT obj, bool bTeamFirst)
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
bool setGlobalBodyAngleLastSee (AngDeg ang)
AngDeg getGlobalBodyAngleLastSee () const
bool setHeteroPlayerType (int index)
int getHeteroPlayerType () const
bool setTimeTackle (Time time)
Time getTimeTackle () const
bool setGlobalArm (AngDeg ang, Time time)
AngDeg getGlobalArm () const
bool setTimeGlobalArm (Time time)
Time getTimeGlobalArm () const

Protected Attributes

bool isKnownPlayer
ObjectT objRangeMin
ObjectT objRangeMax
bool isGoalie
AngDeg angGlobalBodyAngle
AngDeg angGlobalNeckAngle
AngDeg angGlobalBodyAngleLastSee
Time timeGlobalAngles
int iHeteroPlayerType
Time m_timeTackle
AngDeg m_angGlobalArm
Time m_timeGlobalArm

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 190 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 461 of file Objects.cpp.

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


Member Function Documentation

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

Implements Object.

Reimplemented in AgentObject.

Definition at line 709 of file Objects.cpp.

References DEFAULT_TEAM_NAME.

Referenced by WorldModel::show().

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 718 of file Objects.cpp.

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.

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 623 of file Objects.cpp.

References objRangeMax, and objRangeMin.

Referenced by WorldModel::processNewObjectInfo().

bool PlayerObject::isInRange ( ObjectT  obj,
bool  bTeammatesFirst 
)

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 634 of file Objects.cpp.

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

ObjectT PlayerObject::getMinRange (  ) 

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

Returns:
minimal possible object type

Definition at line 654 of file Objects.cpp.

References objRangeMin.

ObjectT PlayerObject::getMaxRange (  ) 

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

Returns:
maximal possible object type

Definition at line 662 of file Objects.cpp.

References objRangeMax.

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 673 of file Objects.cpp.

References isKnownPlayer.

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

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 684 of file Objects.cpp.

References isKnownPlayer.

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

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 692 of file Objects.cpp.

References isGoalie.

Referenced by WorldModel::processPerfectHearInfo().

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 700 of file Objects.cpp.

References isGoalie.

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 479 of file Objects.cpp.

References angRelativeBodyAngle, and setTimeRelativeAngles().

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 491 of file Objects.cpp.

References angRelativeBodyAngle.

Referenced by WorldModel::updateDynamicObjectAfterSee().

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 501 of file Objects.cpp.

References angGlobalBodyAngle, and setTimeGlobalAngles().

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

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 511 of file Objects.cpp.

References angGlobalBodyAngle.

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

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 521 of file Objects.cpp.

References angRelativeNeckAngle, and setTimeRelativeAngles().

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 531 of file Objects.cpp.

References angRelativeNeckAngle.

Referenced by 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 541 of file Objects.cpp.

References angGlobalNeckAngle, and setTimeGlobalAngles().

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

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 551 of file Objects.cpp.

References angGlobalNeckAngle.

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

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 559 of file Objects.cpp.

References timeRelativeAngles.

Referenced by setRelativeBodyAngle(), and setRelativeNeckAngle().

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 568 of file Objects.cpp.

References timeRelativeAngles.

Referenced by WorldModel::updateDynamicObjectAfterSee().

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 576 of file Objects.cpp.

References timeGlobalAngles.

Referenced by setGlobalBodyAngle(), and setGlobalNeckAngle().

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 610 of file Objects.cpp.

References timeGlobalAngles.

Referenced by WorldModel::getTimeGlobalAngles().

bool PlayerObject::setGlobalBodyAngleLastSee ( AngDeg  ang  ) 

This method sets the global angle of the agent calculated after the last see message. The time of this information corresponds to 'getTimeChangeInformation', since the change information arrives always together with the body and neck information.

Returns:
global body angle derived from the last see message

Definition at line 588 of file Objects.cpp.

References angGlobalBodyAngleLastSee.

Referenced by WorldModel::updateDynamicObjectAfterSee().

AngDeg PlayerObject::getGlobalBodyAngleLastSee (  )  const

This method returns the global angle of the agent calculated after the last see message. The time of this information corresponds to 'getTimeChangeInformation', since the change information arrives always together with the body and neck information.

Returns:
global body angle derived from the last see message

Definition at line 601 of file Objects.cpp.

References angGlobalBodyAngleLastSee.

Referenced by WorldModel::getGlobalBodyAngleLastSee().

bool PlayerObject::setHeteroPlayerType ( int  index  ) 

This method sets the heterogeneous index number of this player object.

Parameters:
hetereogeneous index number
Returns:
bool indicating whether update was successful.

Definition at line 738 of file Objects.cpp.

References iHeteroPlayerType.

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

int PlayerObject::getHeteroPlayerType (  )  const

This method returns the heterogeneous index number of this player object.

Returns:
hetereogeneous index number

Definition at line 746 of file Objects.cpp.

References iHeteroPlayerType.

Referenced by WorldModel::getHeteroInfoPlayer(), and WorldModel::getHeteroPlayerType().

bool PlayerObject::setTimeTackle ( Time  time  ) 

This method sets the time related to the last tackle of this object.

Definition at line 753 of file Objects.cpp.

References m_timeTackle.

Time PlayerObject::getTimeTackle (  )  const

This method returns the time that is related to the last tackle of this object.

Definition at line 761 of file Objects.cpp.

References m_timeTackle.

Referenced by WorldModel::getTackleExpires().

bool PlayerObject::setGlobalArm ( AngDeg  ang,
Time  time 
)

This method sets the global direction in which the arm of this object has last been observed to point. The time related to this update is represented by time.

Definition at line 770 of file Objects.cpp.

References m_angGlobalArm, and setTimeGlobalArm().

AngDeg PlayerObject::getGlobalArm (  )  const

This method returns the global direction in which the arm of this object has last been observed to point.

Definition at line 778 of file Objects.cpp.

References m_angGlobalArm.

Referenced by WorldModel::getGlobalArmDirection().

bool PlayerObject::setTimeGlobalArm ( Time  time  ) 

This method sets the time that is related to the last time the arm of this object has been observed to point in the global direction returned by 'getGlobalArm'.

Definition at line 786 of file Objects.cpp.

References m_timeGlobalArm.

Referenced by setGlobalArm().

Time PlayerObject::getTimeGlobalArm (  )  const

This method returns the time that is related to the last time the arm of this object has been observed to point in the global direction returned by 'getGlobalArm'.

Definition at line 795 of file Objects.cpp.

References m_timeGlobalArm.

Referenced by WorldModel::getTimeGlobalArmDirection().


Field Documentation

bool PlayerObject::isKnownPlayer [protected]

are we sure about player number

Definition at line 193 of file Objects.h.

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

ObjectT PlayerObject::objRangeMin [protected]

Minimum in range of possible player obj

Definition at line 194 of file Objects.h.

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

ObjectT PlayerObject::objRangeMax [protected]

Maximum in range of possible player obj

Definition at line 195 of file Objects.h.

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

bool PlayerObject::isGoalie [protected]

is this object a goalie

Definition at line 196 of file Objects.h.

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

AngDeg PlayerObject::angGlobalBodyAngle [protected]

Global body angle

Definition at line 197 of file Objects.h.

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

AngDeg PlayerObject::angGlobalNeckAngle [protected]

Global neck angle

Definition at line 198 of file Objects.h.

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

AngDeg PlayerObject::angGlobalBodyAngleLastSee [protected]

Global body angle from last see msg

Definition at line 199 of file Objects.h.

Referenced by getGlobalBodyAngleLastSee(), and setGlobalBodyAngleLastSee().

Time PlayerObject::timeGlobalAngles [protected]

Server time of global angles

Definition at line 200 of file Objects.h.

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

int PlayerObject::iHeteroPlayerType [protected]

index of heterogeneous player type

Definition at line 201 of file Objects.h.

Referenced by getHeteroPlayerType(), PlayerObject(), and setHeteroPlayerType().

Time PlayerObject::m_timeTackle [protected]

time tackle command was observerd

Definition at line 203 of file Objects.h.

Referenced by getTimeTackle(), and setTimeTackle().

AngDeg PlayerObject::m_angGlobalArm [protected]

global pointing direction of arm

Definition at line 205 of file Objects.h.

Referenced by getGlobalArm(), and setGlobalArm().

Time PlayerObject::m_timeGlobalArm [protected]

time arm last seen

Definition at line 206 of file Objects.h.

Referenced by getTimeGlobalArm(), and setTimeGlobalArm().

AngDeg PlayerObject::angRelativeBodyAngle [private]

Relative body angle to main player

Definition at line 209 of file Objects.h.

Referenced by getRelativeBodyAngle(), PlayerObject(), and setRelativeBodyAngle().

AngDeg PlayerObject::angRelativeNeckAngle [private]

Relative neck angle to main player

Definition at line 210 of file Objects.h.

Referenced by getRelativeNeckAngle(), PlayerObject(), and setRelativeNeckAngle().

Time PlayerObject::timeRelativeAngles [private]

Server time of relative angles

Definition at line 211 of file Objects.h.

Referenced by getTimeRelativeAngles(), and setTimeRelativeAngles().


The documentation for this class was generated from the following files:
Generated on Thu Apr 26 22:45:31 2007 for GangOfSix(GOS)-RoboCupTeamProject by  doxygen 1.5.1-p1