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

Field Class Reference

The class represents the field area. More...

#include <Field.h>

Inheritance diagram for Field:

Inheritance graph
[legend]
Collaboration diagram for Field:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Field ()
 Constructor.

bool isReallyInside (const Vector2< double > &v) const
 The function checks whether a point is inside the field.

double clip (Vector2< double > &v) const
 The function clips a point to the field.

Vector2< double > getClosestPoint (const Vector2< double > &v, LinesPercept::LineType type) const
 The function returns the point on a line of a certain type closest to given a point.

Vector2< double > getClosestPoint (const Pose2D &p, int numberOfRotations, LinesPercept::LineType type) const
 The function returns the point on a line of a certain type closest to given a point.

double getClosestDistance (const Vector2< double > &v, LinesPercept::LineType type) const
 The function returns the distance between a point and the closest point on a line of a certain type.

double getDistance (const Pose2D &pose, LinesPercept::LineType type) const
 The function returns the distance between a point and the closest point on a line of a certain type in a certain direction.

double getDistance (const Pose2D &pose, bool ignoreFieldLines=false) const
 The function returns the distance between a point and the closest point on a line in a certain direction.

double getDistanceToOwnPenaltyArea (const Pose2D &pose) const
 The function returns the distance to the robots own penalty area for a given pose.

double getObstacleDistance (const Pose2D &pose, ObstaclesPercept::ObstacleType &obstacleType) const
 The function returns the distance between a point and the closest obstacle point in a certain direction.

void placePlayers (const PlayerPoseCollection &ppc)
 The function places all robots as obstacles in an internal data structure.

Pose2D randomPose () const
 The function returns a random pose inside the field.

void draw (const Drawings::Color color, LinesPercept::LineType type) const
 The function draws all lines of a cetain type.


Private Member Functions

void initBoundary (Table &table)
void initLines (Table &table, Table &xTable, Table &yTable)
void initBorder (Table &table)
void initOpponentGoal (Table &table)
void initOwnGoal (Table &table)
void initSimpleLines (Table &table)
void addCoords (Table &table, int number, double *x, double *y)
void addCoords (Table &table, Table &xTable, Table &yTable, int number, double *x, double *y)
void addPlayer (const Pose2D &pose)

Private Attributes

Table boundary
Table lines [LinesPercept::numberOfLineTypes+4]

Detailed Description

The class represents the field area.

Definition at line 22 of file Field.h.


Constructor & Destructor Documentation

Field::Field  ) 
 

Constructor.

Definition at line 16 of file Field.cpp.

References Boundary< double >::add(), boundary, initBorder(), initBoundary(), initLines(), initOpponentGoal(), initOwnGoal(), initSimpleLines(), and lines.

Here is the call graph for this function:


Member Function Documentation

void Field::initBoundary Table table  )  [private]
 

Definition at line 29 of file Field.cpp.

References addCoords(), Field::Table::numberOfEntries, and Field::Table::setSize().

Referenced by Field().

Here is the call graph for this function:

void Field::initLines Table table,
Table xTable,
Table yTable
[private]
 

Definition at line 76 of file Field.cpp.

References addCoords(), Field::Table::index, Field::Table::numberOfEntries, and Field::Table::setSize().

Referenced by Field().

Here is the call graph for this function:

void Field::initBorder Table table  )  [private]
 

Definition at line 257 of file Field.cpp.

References addCoords(), and Field::Table::setSize().

Referenced by Field().

Here is the call graph for this function:

void Field::initOpponentGoal Table table  )  [private]
 

Definition at line 307 of file Field.cpp.

References addCoords(), Field::Table::numberOfEntries, and Field::Table::setSize().

Referenced by Field().

Here is the call graph for this function:

void Field::initOwnGoal Table table  )  [private]
 

Definition at line 328 of file Field.cpp.

References addCoords(), Field::Table::numberOfEntries, and Field::Table::setSize().

Referenced by Field().

Here is the call graph for this function:

void Field::initSimpleLines Table table  )  [private]
 

Definition at line 199 of file Field.cpp.

References addCoords(), and Field::Table::setSize().

Referenced by Field().

Here is the call graph for this function:

void Field::addCoords Table table,
int  number,
double *  x,
double *  y
[private]
 

Definition at line 349 of file Field.cpp.

References Vector2< V >::abs(), Field::Table::push(), Vector2< V >::x, and Vector2< V >::y.

Referenced by addPlayer(), initBorder(), initBoundary(), initLines(), initOpponentGoal(), initOwnGoal(), and initSimpleLines().

Here is the call graph for this function:

void Field::addCoords Table table,
Table xTable,
Table yTable,
int  number,
double *  x,
double *  y
[private]
 

Definition at line 361 of file Field.cpp.

References Vector2< V >::abs(), Field::Table::push(), Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

void Field::addPlayer const Pose2D pose  )  [private]
 

Definition at line 601 of file Field.cpp.

References addCoords(), RobotDimensions::bodyLength, getRobotConfiguration(), RobotConfiguration::getRobotDimensions(), RobotDimensions::lengthNeckToBodyCenter, lines, RobotDimensions::overallBodyWidth, Vector2< V >::x, and Vector2< V >::y.

Referenced by placePlayers().

Here is the call graph for this function:

bool Field::isReallyInside const Vector2< double > &  v  )  const
 

The function checks whether a point is inside the field.

Parameters:
v The point.
Returns:
Is the point inside?

Definition at line 377 of file Field.cpp.

References boundary, Field::Table::corner, Boundary< double >::isInside(), Field::Table::length, Field::Table::numberOfEntries, Pose2D::translation, Vector2< double >::x, and Vector2< double >::y.

Referenced by clip(), and randomPose().

Here is the call graph for this function:

double Field::clip Vector2< double > &  v  )  const
 

The function clips a point to the field.

Parameters:
v The point.
Returns:
How far was the point moved?

Definition at line 390 of file Field.cpp.

References Vector2< V >::abs(), boundary, Field::Table::corner, isReallyInside(), Field::Table::length, Field::Table::numberOfEntries, Pose2D::translation, and Vector2< V >::x.

Referenced by GT2004SelfLocator::calcPose().

Here is the call graph for this function:

Vector2< double > Field::getClosestPoint const Vector2< double > &  v,
LinesPercept::LineType  type
const
 

The function returns the point on a line of a certain type closest to given a point.

Parameters:
v The reference point.
type The type of the lines.
Returns:
The point on a line.

Definition at line 419 of file Field.cpp.

References Vector2< V >::abs(), Field::Table::corner, Field::Table::length, lines, Field::Table::numberOfEntries, Pose2D::translation, and Vector2< V >::x.

Referenced by ObservationTable< 280, 200, 25 >::create(), and getClosestDistance().

Here is the call graph for this function:

Vector2< double > Field::getClosestPoint const Pose2D p,
int  numberOfRotations,
LinesPercept::LineType  type
const
 

The function returns the point on a line of a certain type closest to given a point.

Parameters:
p The reference point and the rotation of the line.
numberOfRotations The number of discretizations of line rotations.
type The type of the lines.
Returns:
The point on a line.

Definition at line 446 of file Field.cpp.

References Vector2< V >::abs(), ASSERT, Field::Table::corner, Field::Table::length, lines, normalize(), Field::Table::numberOfEntries, pi2, pi_2, Pose2D::rotation, Pose2D::translation, and Vector2< V >::x.

Here is the call graph for this function:

double Field::getClosestDistance const Vector2< double > &  v,
LinesPercept::LineType  type
const
 

The function returns the distance between a point and the closest point on a line of a certain type.

Parameters:
v The reference point.
type The type of the lines.
Returns:
The distance.

Definition at line 494 of file Field.cpp.

References getClosestPoint().

Here is the call graph for this function:

double Field::getDistance const Pose2D pose,
LinesPercept::LineType  type
const
 

The function returns the distance between a point and the closest point on a line of a certain type in a certain direction.

Parameters:
pose The reference point and direction.
type The type of the lines.
Returns:
The distance. It is -1 if no line of that type exists in the certain direction.

Definition at line 500 of file Field.cpp.

References Field::Table::corner, Field::Table::length, lines, Field::Table::numberOfEntries, Vector2< V >::x, and Vector2< V >::y.

Referenced by TemplateTable< 50000 >::create(), getDistance(), and getObstacleDistance().

double Field::getDistance const Pose2D pose,
bool  ignoreFieldLines = false
const
 

The function returns the distance between a point and the closest point on a line in a certain direction.

Parameters:
pose The reference point and direction.
ignoreFieldLines The field lines are ignored during the search.
Returns:
The distance. It is -1 if no line of that type exists in the certain direction.

Definition at line 521 of file Field.cpp.

References getDistance().

Here is the call graph for this function:

double Field::getDistanceToOwnPenaltyArea const Pose2D pose  )  const
 

The function returns the distance to the robots own penalty area for a given pose.

Parameters:
pose The reference point and direction (robot pose).
Returns:
The distance. It is -1 if no line of that type exists in the certain direction.

Definition at line 537 of file Field.cpp.

References Field::Table::corner, Field::Table::length, lines, Vector2< V >::x, and Vector2< V >::y.

Referenced by GT2004ObstaclesLocator::setObstaclesModel().

double Field::getObstacleDistance const Pose2D pose,
ObstaclesPercept::ObstacleType obstacleType
const
 

The function returns the distance between a point and the closest obstacle point in a certain direction.

Parameters:
pose The reference point and direction.
obstacleType The Obstacletype to be determined.
Returns:
The distance. It is -1 if no line of that type exists in the certain direction.

Definition at line 558 of file Field.cpp.

References getDistance(), and LinesPercept::LineType.

Here is the call graph for this function:

void Field::placePlayers const PlayerPoseCollection ppc  ) 
 

The function places all robots as obstacles in an internal data structure.

Parameters:
ppc The poses of all other players on the field.

Definition at line 591 of file Field.cpp.

References addPlayer(), PlayerPoseCollection::getOpponentPlayerPose(), PlayerPoseCollection::getOwnPlayerPose(), PlayerPose::getPose(), lines, PlayerPoseCollection::numberOfOpponentPlayers, PlayerPoseCollection::numberOfOwnPlayers, and Field::Table::setSize().

Here is the call graph for this function:

Pose2D Field::randomPose  )  const
 

The function returns a random pose inside the field.

Returns:
The random pose.

Definition at line 617 of file Field.cpp.

References isReallyInside(), pi, Pose2D::random(), and Pose2D::translation.

Referenced by TemplateTable< 50000 >::create(), GT2004SelfLocator::getTemplate(), and GT2004SelfLocator::GT2004SelfLocator().

Here is the call graph for this function:

void Field::draw const Drawings::Color  color,
LinesPercept::LineType  type
const
 

The function draws all lines of a cetain type.

It is use to control the correctness of the model.

Parameters:
color The color the lines will be drawn in.
type The type of the lines.

Definition at line 626 of file Field.cpp.

References boundary, Field::Table::corner, Field::Table::length, LINE, lines, Field::Table::numberOfEntries, Pose2D::translation, Vector2< V >::x, Vector2< V >::y, and Vector2< double >::y.


Member Data Documentation

Table Field::boundary [private]
 

Definition at line 73 of file Field.h.

Referenced by clip(), draw(), Field(), and isReallyInside().

Table Field::lines[LinesPercept::numberOfLineTypes + 4] [private]
 

Definition at line 73 of file Field.h.

Referenced by addPlayer(), draw(), Field(), getClosestPoint(), getDistance(), getDistanceToOwnPenaltyArea(), and placePlayers().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:06:07 2004 for GT2004 by doxygen 1.3.6