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.

bool getClosestPoint (Vector2< double > &point, 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 initBoundaryForHugeField (Table &table)
void initLines (Table &table, Table &xTable, Table &yTable)
void initBorder (Table &table)
void initBorderForHugeField (Table &table)
void initOpponentGoal (Table &table)
void initOwnGoal (Table &table)
void initSimpleLines (Table &table)
void initSimpleLinesForHugeField (Table &table)
void addCoords (Table &table, int number, double *x, double *y, bool rotate=false)
void addCoords (Table &table, Table &xTable, Table &yTable, int number, double *x, double *y, bool rotate=false)
void addPlayer (const Pose2D &pose)

Private Attributes

Table lines [LinesPercept::numberOfLineTypes+5]

Detailed Description

The class represents the field area.

Definition at line 23 of file Field.h.


Constructor & Destructor Documentation

Field::Field  ) 
 

Constructor.

Definition at line 15 of file Field.cpp.

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

Here is the call graph for this function:


Member Function Documentation

void Field::initBoundary Table table  )  [private]
 

Definition at line 39 of file Field.cpp.

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

Referenced by Field().

Here is the call graph for this function:

void Field::initBoundaryForHugeField Table table  )  [private]
 

Definition at line 86 of file Field.cpp.

References addCoords(), 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 109 of file Field.cpp.

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

Referenced by Field().

Here is the call graph for this function:

void Field::initBorder Table table  )  [private]
 

Definition at line 516 of file Field.cpp.

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

Referenced by Field().

Here is the call graph for this function:

void Field::initBorderForHugeField Table table  )  [private]
 

Definition at line 566 of file Field.cpp.

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

Referenced by Field().

Here is the call graph for this function:

void Field::initOpponentGoal Table table  )  [private]
 

Definition at line 627 of file Field.cpp.

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

Referenced by Field().

Here is the call graph for this function:

void Field::initOwnGoal Table table  )  [private]
 

Definition at line 648 of file Field.cpp.

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

Referenced by Field().

Here is the call graph for this function:

void Field::initSimpleLines Table table  )  [private]
 

Definition at line 400 of file Field.cpp.

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

Referenced by Field().

Here is the call graph for this function:

void Field::initSimpleLinesForHugeField Table table  )  [private]
 

Definition at line 458 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,
bool  rotate = false
[private]
 

Definition at line 669 of file Field.cpp.

References Field::Table::push().

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

Here is the call graph for this function:

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

Definition at line 683 of file Field.cpp.

References Field::Table::push().

Here is the call graph for this function:

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

Definition at line 924 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 701 of file Field.cpp.

References Boundary< double >::isInside(), lines, 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 716 of file Field.cpp.

References Vector2< V >::abs(), isReallyInside(), lines, Field::Table::numberOfEntries, and Vector2< V >::x.

Referenced by GT2004SelfLocator::calcPose(), SlamSelfLocator::calcPoseFromSubCube(), GT2005StableSelfLocator::calcPoseFromSubCube(), and GT2005SelfLocator::calcPoseFromSubCube().

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 745 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 LinesTables2005::ObservationTable< xSize, ySize, cellSize, pointRes >::create(), ObservationTable< 320, 240, 25, 25 >::create(), and getClosestDistance().

Here is the call graph for this function:

bool Field::getClosestPoint Vector2< double > &  point,
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.
point The point on a line.
Returns:
whether there is a matching point in that direction

Definition at line 772 of file Field.cpp.

References Vector2< V >::abs(), ASSERT, Field::Table::corner, Field::Table::length, lines, 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 815 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 821 of file Field.cpp.

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

Referenced by LinesTables2005::TemplateTable< TEMPLATES_MAX, POINT_RES >::create(), TemplateTable< 65000, 25 >::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 842 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 855 of file Field.cpp.

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

Referenced by GT2005ObstaclesLocator::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 881 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 914 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 940 of file Field.cpp.

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

Referenced by LinesTables2005::TemplateTable< TEMPLATES_MAX, POINT_RES >::create(), TemplateTable< 65000, 25 >::create(), SlamSelfLocator::execute(), SlamSampleTemplateGenerator::getTemplate(), GT2005StableSampleTemplateGenerator::getTemplate(), GT2005SampleTemplateGenerator::getTemplate(), GT2004SelfLocator::getTemplate(), GT2004SelfLocator::GT2004SelfLocator(), GT2005StableSelfLocator::GT2005StableSelfLocator(), GT2005SelfLocator::resample(), GT2005SelfLocator::resetSamples(), GT2005SelfLocator::resetSamplesWhenPenalized(), and SlamSelfLocator::SlamSelfLocator().

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 949 of file Field.cpp.

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


Member Data Documentation

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

Definition at line 74 of file Field.h.

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


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:12:13 2006 for GT2005 by doxygen 1.3.6