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

RS::AgentView Class Reference

This view is used to keep track of the agent, its position, speed and other properties. More...

Inheritance diagram for RS::AgentView:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AgentView (const ViewId id)
 Create an Agent View with ViewId id.

virtual ~AgentView ()
 Destroys the agent view.

const AgentObjectgetAgentObject (const Int hist=NOW) const
 Get a constant object representing the agent hist cycles ago.

bool isAgentOutsideField (const Int hist=NOW) const
 Returns true iff the agent is outside the field.

AngleDegUE getRelativeNeckDirection (const Int hist=NOW) const
 Returns the neckdirection relative to the body of the player.

AngleDegUE getMinNeckDirection (const Int hist=NOW) const
 Get the minimum global neck direction.

AngleDegUE getMaxNeckDirection (const Int hist=NOW) const
 Get the maximum global neck direction.

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

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

PointUE getPosition (const Int hist=NOW) const
 Get the position of the agent hist cycles ago.

AngleDegUE getBodyDirection (const Int hist=NOW) const
 Get the (global) body direction of the agent hist cycles ago.

AngleDegUE getNeckDirection (const Int hist=NOW) const
 Get the (global) neck direction of the agent hist cycles ago.

FloatUE getEffort (const Int hist=NOW) const
 Get the effort of the agent hist cycles ago.

FloatUE getRecover (const Int hist) const
 Get the recovery of the agent hist cycles ago.

FloatUE getStamina (const Int hist=NOW) const
 Get the stamina of the agent hist cycles ago.

FloatUE getSpeed (const Int hist=NOW) const
 Get the amount of speed of the agent hist cycles ago.

VectorUE getSpeedVector (const Int hist=NOW) const
 Get the speed vector of the agent hist cycles ago.

ViewWidth getViewWidth (const Int hist=NOW) const
 Get the view width of the agent hist cycles ago.

ViewQuality getViewQuality (const Int hist=NOW) const
 Get the view quality of the agent hist cycles ago.

AngleDegUnknown getViewAngle (const Int hist=NOW) const
 Get the view angle of the agent hist cycles ago.

bool isGoalie () const
 Returns true iff the agent is the goal keeper.

UIntUnknown getUniformNumber () const
 Returns the uniform number of the agent.

AngleDeg getAngleForTurn (const AngleDeg &angle, const Int hist=NOW) const
 Calculates the actual degrees needed to make a turn.

AngleDeg getAngleForKick (const AngleDeg &angle, const Int hist=NOW) const
 Calculates the actual degrees needed to kick in absolute direction angle.

Float getPowerForDashToRelativePosition (const Point &point, const Int hist=NOW) const
 This method receives a relative position (x,y) to which the agent wants to move and returns the power that should be supplied to the dash command in order to come as close to this position as possible.

Float getPowerForDashToAbsolutePosition (const Point &point, const Int hist=NOW) const
 This method receives an absolute position (x,y) to which the agent wants to move and returns the power that should be supplied to the dash command in order to come as close to this position as possible.

UInt getDashes (const Int hist=NOW) const
 Returns the number of dashes made upto hist cycles ago.

UInt getKicks (const Int hist=NOW) const
 Returns the number of kicks made upto hist cycles ago.

UInt getSays (const Int hist=NOW) const
 Returns the number of says made upto hist cycles ago.

UInt getTurns (const Int hist=NOW) const
 Returns the number of turns made upto hist cycles ago.

UInt getTurnNecks (const Int hist=NOW) const
 Returns the number of turn necks made upto hist cycles ago.

const std::string & getCoachMessage (const Int hist=NOW) const
 Returns the last message sent by the coach.

const std::string & getOwnMessage (const Int hist=NOW) const
 Returns the last message sent by the agent itself.

const std::string & getTeammateMessage (const Int hist=NOW) const
 Returns the last message sent by a teammate.

const std::string & getOpponentMessage (const Int hist=NOW) const
 Returns the last message sent by a opponent.

AngleDegUE getTeammateMessageDirection (const Int hist=NOW) const
AngleDegUE getOpponentMessageDirection (const Int hist=NOW) const
UInt getTeammateSpeaker (const Int hist=NOW) const
const std::vector< UInt > & getTeammateSpeakers (const Int hist=NOW) const
UInt getNumberOfOpponentSpeakers (const Int hist=NOW) const

Protected Member Functions

Update fuctions.
virtual void myNewCycle ()
 Called when the sensor interface detects a new cycle.

virtual void myUpdateAfterCoachMessage ()
 Called after a new message from the coach has been recieved.

virtual void myUpdateAfterInit ()
 Called after an init message has been received.

virtual void myUpdateAfterSee ()
 Called after an visual (see) message has been received.

virtual void myUpdateAfterHear ()
 Called after an aural (hear) message has been received.

virtual void myUpdateAfterSense ()
 Called after a sense body message has been received.

virtual void myUpdateAfterCommand ()
 Called after a command has been executed.


Detailed Description

This view is used to keep track of the agent, its position, speed and other properties.

Todo:
Is the view needed?

More information.

Unit:
Framework/view
Revision
1.17
Author
frehe
Date
2007/09/03 08:15:08

Definition at line 127 of file AgentView.h.


Member Function Documentation

AngleDegUE RS::AgentView::getRelativeNeckDirection const Int    hist = NOW const
 

Returns the neckdirection relative to the body of the player.

relneckdirection = neck_direction - body_direction

Definition at line 125 of file AgentView.cc.

References getAgentObject(), and RS::PlayerObject::getRelativeNeckDirection().

Referenced by RS::AlignNeckToBody::generateStep().

AngleDegUE RS::AgentView::getMinNeckDirection const Int    hist = NOW const
 

Get the minimum global neck direction.

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

Definition at line 129 of file AgentView.cc.

References getAgentObject(), and RS::PlayerObject::getMinNeckDirection().

AngleDegUE RS::AgentView::getMaxNeckDirection const Int    hist = NOW const
 

Get the maximum global neck direction.

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

Definition at line 133 of file AgentView.cc.

References getAgentObject(), and RS::PlayerObject::getMaxNeckDirection().

AngleDegUE RS::AgentView::getRelativeNeckDirectionToPoint const PointUE &    point,
const Int    hist = NOW
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 137 of file AgentView.cc.

References getAgentObject(), and RS::PlayerObject::getRelativeNeckDirectionToPoint().

AngleDegUE RS::AgentView::getRelativeNeckDirectionToDirection const AngleDegUE &    dir,
const Int    hist = NOW
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 141 of file AgentView.cc.

References getAgentObject(), and RS::PlayerObject::getRelativeNeckDirectionToDirection().

Float RS::AgentView::getPowerForDashToRelativePosition const Point   point,
const Int    hist = NOW
const
 

This method receives a relative position (x,y) to which the agent wants to move and returns the power that should be supplied to the dash command in order to come as close to this position as possible.

Parameters:
point The relative position
Returns:
The power that should be supplied to the dash command to come as close as possible to this point. If the point is behind the agent then a negative dash power should be returned.

Definition at line 153 of file AgentView.cc.

References RS::Float, getAgentObject(), and RS::AgentObject::getPowerForDashToRelativePosition().

Float RS::AgentView::getPowerForDashToAbsolutePosition const Point   point,
const Int    hist = NOW
const
 

This method receives an absolute position (x,y) to which the agent wants to move and returns the power that should be supplied to the dash command in order to come as close to this position as possible.

Parameters:
point The absolute position
Returns:
The power that should be supplied to the dash command to come as close as possible to this point. If the point is behind the agent then a negative dash power should be returned.

Definition at line 157 of file AgentView.cc.

References RS::Float, getAgentObject(), and RS::AgentObject::getPowerForDashToAbsolutePosition().

void RS::AgentView::myNewCycle   [inline, protected, virtual]
 

Called when the sensor interface detects a new cycle.

It is called *before* the values in SensorInterface are erased, so this is the last chance to use them.

Implements RS::View.

Definition at line 196 of file AgentView.icc.


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