Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RS::PlayerObject Class Reference

Class used to represent a player. More...

Inheritance diagram for RS::PlayerObject:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PlayerObject (const PointUE &def_point=PointUE(), const TimeUnknown &def_time=TimeUnknown(), const VectorUE &def_speed=VectorUE(), const TimeUnknown &def_speed_time=TimeUnknown(), const AngleDegUE &def_body_dir=AngleDegUE(), const AngleDegUE &def_neck_dir=AngleDegUE(), const AngleDegUE &def_point_dir=AngleDegUE(), const bool def_tackling=false, const bool def_goalie=false, const Team def_team=T_UNKNOWN, const Side def_side=S_UNKNOWN, const TimeUnknown &def_team_time=TimeUnknown(), const UIntUnknown def_u_number=UIntUnknown(), const TimeUnknown &def_unum_time=TimeUnknown(), const VectorUE &def_acceleration=VectorUE())
 Default constructor, the players parameters are unknown as default.

 PlayerObject (const PlayerObject &obj)
 Copyconstructor.

PlayerObject & operator= (const PlayerObject &obj)
 Assignment operator.

void setBodyDirection (const AngleDegUE &ang)
 Set the (global) bodydirection of the player.

AngleDegUE getBodyDirection () const
 Get the (global) bodydirection of the player.

AngleDegUE getRelativeBodyDirectionToPoint (const PointUE &point) const
 Return the relative direction to point, i.e.

AngleDegUE getRelativeBodyDirectionTo (const AngleDegUE &dir) const
 Return the relative direction to dir, i.e.

VectorUE getRelativeVectorTo (const PointUE &point) const
 Return the relative vector to point, i.e.

FuzzyBool isPointInFrontOf (const PointUE &point) const
 Return true iff point is in front of the player, with respect to the body direction of the player.

FuzzyBool isPointBehind (const PointUE &point) const
 Return true iff point is behind the player, with respect to the body direction of the player.

FuzzyBool isRelativePointBehind (const PointUE &point) const
 Return true iff point relative to the player is behind the player, with respect to the body direction of the player.

void setNeckDirection (const AngleDegUE &ang)
 Set the (global) neckdirection of the player.

AngleDegUE getNeckDirection () const
 Get the (global) neckdirection of the player.

AngleDegUE getRelativeNeckDirection () const
 Returns the neckdirection relative to the body of the player.

AngleDegUE getMinNeckDirection () const
 Get the minimum global neck direction.

AngleDegUE getMaxNeckDirection () const
 Get the maximum global neck direction.

AngleDegUE getRelativeNeckDirectionToPoint (const PointUE &point) const
 Return the relative neck direction to point, i.e.

AngleDegUE getRelativeNeckDirectionToDirection (const AngleDegUE &dir) const
 Return the relative neck direction to dir, i.e.

void setPointDirection (const AngleDegUE &ang)
 Set the point direction of the player.

AngleDegUE getPointDirection () const
 Get the point direction of the player.

void setTackling (const bool tackle)
 Set the tackling status of the player.

bool getTackling () const
 Get the tackling status of the player.

void setTeam (const Team tm)
 Set the players team Values are T_OUR_TEAM, T_THEIR_TEAM and T_UNKNOWN.

void setTeam (const Side our_side)
 Set the players team based on what side it plays for.

Team getTeam () const
 Returns the players team.

void setGoalie (const bool goalie_)
 Set to true if the player is a goalie.

bool isGoalie () const
 Returns true if the player is a goalie.

void setSide (const Side new_side)
 Set the players side Values are S_LEFT, S_RIGHT, S_NEUTRAL, S_UNKNOWN.

Side getSide () const
 Returns the players side Values are S_LEFT, S_RIGHT, S_NEUTRAL, S_UNKNOWN.

void setTeamObservationTime (const TimeUnknown &def_team_time)
 Set the time for last observation of players team.

TimeUnknown getTeamObservationTime () const
 Get the last observation of the players team time.

void setUniformNumber (const UIntUnknown u_num)
 Set the players uniformnumber.

UIntUnknown getUniformNumber () const
 Return the players uniformnumber.

void setUniformNumberObservationTime (const TimeUnknown &def_unum_time)
 Set the time for last observation of players uniformnumber.

TimeUnknown getUniformNumberObservationTime () const
 Return the time when we last observed the players uniformnumber.


Protected Attributes

AngleDegUE bodyDir
 Representation of the players (global) bodydirection.

AngleDegUE neckDir
 Representation of the players (global) neckdirection.

AngleDegUE pointDir
 Representation of the players pointed to direction.

bool tackling
 Representation of tackling status.

Team team
 The team.

bool goalie
 Is goalie?

Side side
 The current side the player is playing for.

TimeUnknown teamObservationTime
 Time of last observation of team.

UIntUnknown uNumber
 Representation of the players uniformnumber.

TimeUnknown uNumberObservationTime
 Time of last observation of uniformnumber.


Detailed Description

Class used to represent a player.

Todo:
Make a toString and operator<<
Unit:
Library
Revision
1.4
Author
frehe
Date
2006/10/05 07:35:21

Definition at line 95 of file PlayerObject.h.


Member Function Documentation

AngleDegUE RS::PlayerObject::getRelativeBodyDirectionToPoint const PointUE &    point const
 

Return the relative direction to point, i.e.

the moment needed to turn the body in order to face the point point.

Definition at line 140 of file PlayerObject.cc.

References RS::MobileObject::getPosition(), and getRelativeBodyDirectionTo().

Referenced by isPointBehind(), and isPointInFrontOf().

AngleDegUE RS::PlayerObject::getRelativeBodyDirectionTo const AngleDegUE &    dir const
 

Return the relative direction to dir, i.e.

the moment needed to turn the body in order to have the absolute direction

dir.

Definition at line 147 of file PlayerObject.cc.

References getBodyDirection().

Referenced by getRelativeBodyDirectionToPoint().

VectorUE RS::PlayerObject::getRelativeVectorTo const PointUE &    point const
 

Return the relative vector to point, i.e.

the vector needed to move the body of the agent in order to be at the point point.

Definition at line 154 of file PlayerObject.cc.

References getBodyDirection(), and RS::MobileObject::getPosition().

FuzzyBool RS::PlayerObject::isPointInFrontOf const PointUE &    point const
 

Return true iff point is in front of the player, with respect to the body direction of the player.

If the point is in line with the player then it is not in front of. If either the body direction or the point is unknown return unknown.

Definition at line 162 of file PlayerObject.cc.

References RS::abs(), and getRelativeBodyDirectionToPoint().

FuzzyBool RS::PlayerObject::isPointBehind const PointUE &    point const
 

Return true iff point is behind the player, with respect to the body direction of the player.

If the point is in line with the player then it is not behind. If either the body direction or the point is unknown return unknown.

Definition at line 172 of file PlayerObject.cc.

References RS::abs(), and getRelativeBodyDirectionToPoint().

Referenced by RS::AgentObject::getPowerForDashToAbsolutePosition(), and isRelativePointBehind().

FuzzyBool RS::PlayerObject::isRelativePointBehind const PointUE &    point const
 

Return true iff point relative to the player is behind the player, with respect to the body direction of the player.

If the point is in line with the player then it is not behind. If either the body direction or the point is unknown return unknown.

Definition at line 182 of file PlayerObject.cc.

References RS::MobileObject::getPosition(), and isPointBehind().

AngleDegUE RS::PlayerObject::getRelativeNeckDirection   const [inline]
 

Returns the neckdirection relative to the body of the player.

relneckdirection = neck_direction - body_direction

Definition at line 86 of file PlayerObject.icc.

References bodyDir, and neckDir.

Referenced by RS::TurnNeckToBall::generateStep(), and RS::AgentView::getRelativeNeckDirection().

AngleDegUE RS::PlayerObject::getMinNeckDirection   const
 

Get the minimum global neck direction.

min_neck_dir = min(SP_minneckang + body_direction, SP_maxneckang + body_direction)

Definition at line 188 of file PlayerObject.cc.

Referenced by RS::TurnNeckToPoint::generateStep(), RS::TurnNeckToBall::generateStep(), RS::TurnNeckToAbsoluteDirection::generateStep(), and RS::AgentView::getMinNeckDirection().

AngleDegUE RS::PlayerObject::getMaxNeckDirection   const
 

Get the maximum global neck direction.

max_neck_dir = max(SP_minneckang + body_direction, SP_maxneckang + body_direction)

Definition at line 195 of file PlayerObject.cc.

Referenced by RS::TurnNeckToPoint::generateStep(), RS::TurnNeckToBall::generateStep(), RS::TurnNeckToAbsoluteDirection::generateStep(), and RS::AgentView::getMaxNeckDirection().

AngleDegUE RS::PlayerObject::getRelativeNeckDirectionToPoint const PointUE &    point const
 

Return the relative neck direction to point, i.e.

the moment needed to turn the neck in order to face the point point.

Definition at line 202 of file PlayerObject.cc.

References getNeckDirection(), and RS::MobileObject::getPosition().

Referenced by RS::TurnNeckToPoint::generateStep(), RS::TurnNeckToBall::generateStep(), RS::AgentView::getRelativeNeckDirectionToPoint(), and RS::AgentObject::inViewCone().

AngleDegUE RS::PlayerObject::getRelativeNeckDirectionToDirection const AngleDegUE &    dir const
 

Return the relative neck direction to dir, i.e.

the moment needed to turn the neck in order to have the absolute direction dir.

Definition at line 210 of file PlayerObject.cc.

References getNeckDirection().

Referenced by RS::TurnNeckToAbsoluteDirection::generateStep(), and RS::AgentView::getRelativeNeckDirectionToDirection().

Team RS::PlayerObject::getTeam   const [inline]
 

Returns the players team.

Values are T_OUR_TEAM, T_THEIR_TEAM and T_UNKNOWN

Definition at line 110 of file PlayerObject.icc.

References team, and RS::Team.


The documentation for this class was generated from the following files:
Generated on Mon Aug 29 08:24:29 2011 for RoboSoc by doxygen1.3-rc3