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

RS::BallView Class Reference

This view is used to keep track of the ball. More...

Inheritance diagram for RS::BallView:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BallView (const ViewId id)
 Create a ball view with ViewId id.

virtual ~BallView ()
 Destroys the ball view.

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

TimeUnknown getLastObservationTime (const Int hist=NOW) const
 Get the time of the last observation of the ball.

FloatUE getRelativeDistance (const Int hist=NOW) const
 Get the distance to the ball hist cycles ago.

AngleDegUE getRelativeDirection (const Int hist=NOW) const
 Get the relative direction to the ball hist cycles ago in relation to the agents body direction.

VectorUE getRelativeVector (const Int hist=NOW) const
 Get the relative vector to the ball hist cycles ago in relation to the agents body direction.

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

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

VectorUE getRelativeSpeedVector (const Int hist=NOW) const
 Get the relative speed vector of the ball hist cycles ago.

bool isBallKickable (const Int hist=NOW) const
 Returns true iff the ball is kickable.

bool isBallCatchable (const Int hist=NOW) const
 Returns true iff the ball is catchable.


Protected Member Functions

Update functions.
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.


Protected Attributes

AgentViewagentView
 A pointer to the agent view.

const WorldFactsfacts
 The known facts of the world.


Detailed Description

This view is used to keep track of the ball.

Todo:
Is the view needed?

Information from kickview could be included.

Unit:
Framework/view
Revision
1.8
Author
petan
Date
2004/08/13 11:47:35

Definition at line 94 of file BallView.h.


Member Function Documentation

VectorUE RS::BallView::getSpeedVector const Int    hist = NOW const [inline]
 

Get the absolute speed vector of the ball hist cycles ago.

I.e. absolute amount of speed and speed direction.

Definition at line 107 of file BallView.icc.

References getBallObject(), and RS::MobileObject::getSpeedVector().

Referenced by RS::KickBallCloseToBody::applicable(), RS::FreezeBall::applicable(), RS::AccelerateBallToVelocity::applicable(), RS::AmIFirstToBall::evaluate(), RS::KickBallCloseToBody::generateStep(), RS::FreezeBall::generateStep(), RS::AccelerateBallToVelocity::generateStep(), getRelativeSpeedVector(), and RS::PassView::partnerBodyDirection().

VectorUE RS::BallView::getRelativeSpeedVector const Int    hist = NOW const [inline]
 

Get the relative speed vector of the ball hist cycles ago.

I.e. absolute amount of speed and relative speed direction.

Definition at line 111 of file BallView.icc.

References agentView, RS::AgentView::getSpeedVector(), and getSpeedVector().

bool RS::BallView::isBallKickable const Int    hist = NOW const
 

Returns true iff the ball is kickable.

Obsolete: it should be made into a predicate!

Definition at line 125 of file BallView.cc.

References facts, getRelativeDistance(), getRelativeVector(), and RS::WorldFacts::SP_kickable_area.

Referenced by RS::KickBallCloseToBody::applicable(), RS::FreezeBall::applicable(), and RS::AccelerateBallToVelocity::applicable().

bool RS::BallView::isBallCatchable const Int    hist = NOW const
 

Returns true iff the ball is catchable.

Obsolete: it should be made into a predicate!

Definition at line 118 of file BallView.cc.

References facts, getRelativeVector(), and RS::WorldFacts::SP_catchable_area_l.

Referenced by RS::CatchBall::applicable().

void RS::BallView::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 117 of file BallView.icc.


Member Data Documentation

const WorldFacts* RS::BallView::facts [protected]
 

The known facts of the world.

(old ParamenterView)

Definition at line 145 of file BallView.h.

Referenced by isBallCatchable(), and isBallKickable().


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