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

# GTStandardConverter Class Reference

A class to use the PotentialfieldComposition inside the GT2004 architecture. More...

`#include <GTStandardConverter.h>`

Collaboration diagram for GTStandardConverter:

[legend]
List of all members.

## Public Member Functions
| GTStandardConverter (const char *fileName)
| Constructor.
| GTStandardConverter ()
| Constructor.
void | load (const char *filename)
| Loads a configuration file.
void | execute (const RobotPose &robotPose, const BallModel &ballPosition, const PlayerPoseCollection &playerPoseCollection, const ObstaclesModel &obstaclesModel, const TeamMessageCollection &teamMessageCollection, PotentialfieldResult &result)
| Calls the potential fields with data from the world model and returns an action.
void | execute (const RobotPose &robotPose, const BallModel &ballPosition, const PlayerPoseCollection &playerPoseCollection, const ObstaclesModel &obstaclesModel, const TeamMessageCollection &teamMessageCollection, const Pose2D &specialDestination1, const Pose2D &specialDestination2, const int &numberOfSpecialDestinations, PotentialfieldResult &result)
| Calls the potential fields with data from the world model and returns an action.
void | getValueArray (const RobotPose &robotPose, const BallModel &ballPosition, const PlayerPoseCollection &playerPoseCollection, const ObstaclesModel &obstaclesModel, const TeamMessageCollection &teamMessageCollection, const std::string &fieldname, double x1, double y1, double x2, double y2, int xSteps, int ySteps, double value[], double &max)
| Computes an array of field values, used by visualization.
void | getDirectionArray (const RobotPose &robotPose, const BallModel &ballPosition, const PlayerPoseCollection &playerPoseCollection, const ObstaclesModel &obstaclesModel, const TeamMessageCollection &teamMessageCollection, const std::string &fieldname, double x1, double y1, double x2, double y2, int xSteps, int ySteps, PfVec directions[])
| Computes an array of gradient directions, used by visualization.
void | getFieldNames (std::vector< std::string > &fieldNames)
| Returns the names of all fields within the potential field composition.
## Private Member Functions
void | setData (const RobotPose &robotPose, const BallModel &ballPosition, const PlayerPoseCollection &playerPoseCollection, const ObstaclesModel &obstaclesModel, const TeamMessageCollection &teamMessageCollection)
| Updates the potentialfields with data from the world model.
## Private Attributes
PotentialfieldComposition | potentialfields
| An instance of the potential field implementation.
ObjectStateDescription | seenBallDesc
| Information about the ball.
ObjectStateDescription | ballDesc
| Information about the ball.
ObjectStateDescription | selfDesc
| Information about the robot, needed by some behaviors.
ObjectStateDescription | goalieDesc
| Information about the own team.
ObjectStateDescription | player2Desc
| Information about the own team.
ObjectStateDescription | player3Desc
| Information about the own team.
ObjectStateDescription | player4Desc
| Information about the own team.
ObjectStateDescription | unknownTeammate1Desc
ObjectStateDescription | unknownTeammate2Desc
ObjectStateDescription | unknownTeammate3Desc
ObjectStateDescription | unknownTeammate4Desc
ObjectStateDescription | opponent1Desc
| Information about the other team.
ObjectStateDescription | opponent2Desc
| Information about the other team.
ObjectStateDescription | opponent3Desc
| Information about the other team.
ObjectStateDescription | opponent4Desc
| Information about the other team.
ObjectStateDescription | opponent5Desc
| Information about the other team.
ObjectStateDescription | opponent6Desc
| Information about the other team.
ObjectStateDescription | destination1Desc
| Information about special destinations.
ObjectStateDescription | destination2Desc
| Information about special destinations.
ObjectStateDescription | obstacleFrontDesc
| Information about obstacles.
ObjectStateDescription | obstacleLeftDesc
| Information about obstacles.
ObjectStateDescription | obstacleRightDesc
| Information about obstacles.
ObjectStateDescription | obstacleFrontLeftDesc
| Information about obstacles.
ObjectStateDescription | obstacleFrontRightDesc
| Information about obstacles.
ObjectStateDescription | freeGoalDesc
| Information about the free part of the goal.
ObjectStateDescription | goalieLookingPositionDesc
| Position to look be looked at by goalie.
ObjectStateDescription | goaliePositionDesc
| The goalie position.
double | angleToFrontObstacle
| Angles to obstacles.
double | angleToLeftObstacle
| Angles to obstacles.
double | angleToRightObstacle
| Angles to obstacles.
double | angleToFrontLeftObstacle
| Angles to obstacles.
double | angleToFrontRightObstacle
| Angles to obstacles.
double | openingAngle
| Opening angle of an obstacle sector.

## Detailed Description

A class to use the PotentialfieldComposition inside the GT2004 architecture.

Definition at line 30 of file GTStandardConverter.h.

## Constructor & Destructor Documentation

GTStandardConverter::GTStandardConverter | ( | const char * | fileName | ) |

  | Constructor. Parameters:
  fileName | The name of a file containing a configuration for a PotentialFieldComposition.
Definition at line 21 of file GTStandardConverter.cpp. References load().

Here is the call graph for this function:

GTStandardConverter::GTStandardConverter | ( |  | ) |

| Constructor. Definition at line 27 of file GTStandardConverter.cpp.

## Member Function Documentation

void GTStandardConverter::load | ( | const char * | filename | ) |

  | Loads a configuration file. Parameters:
  filename | The name of the file
Definition at line 32 of file GTStandardConverter.cpp. References angleToFrontLeftObstacle, angleToFrontObstacle, angleToFrontRightObstacle, angleToLeftObstacle, angleToRightObstacle, ballDesc, destination1Desc, destination2Desc, freeGoalDesc, fromDegrees(), PotentialfieldComposition::getIdFromObjectStateSymbol(), goalieDesc, goalieLookingPositionDesc, goaliePositionDesc, ObjectStateDescription::isActive, PotentialfieldComposition::load(), ObjectStateDescription::objectId, ObjectStateDescription::objectName, obstacleFrontDesc, obstacleFrontLeftDesc, obstacleFrontRightDesc, obstacleLeftDesc, obstacleRightDesc, openingAngle, opponent1Desc, opponent2Desc, opponent3Desc, opponent4Desc, opponent5Desc, opponent6Desc, player2Desc, player3Desc, player4Desc, potentialfields, seenBallDesc, selfDesc, unknownTeammate1Desc, unknownTeammate2Desc, unknownTeammate3Desc, and unknownTeammate4Desc. Referenced by GT2005PotentialFieldBasicBehavior::GT2005PotentialFieldBasicBehavior(), and GTStandardConverter().

Here is the call graph for this function:

void GTStandardConverter::execute | ( | const RobotPose & | robotPose,
|  | const BallModel & | ballPosition,
|  | const PlayerPoseCollection & | playerPoseCollection,
|  | const ObstaclesModel & | obstaclesModel,
|  | const TeamMessageCollection & | teamMessageCollection,
|  | PotentialfieldResult & | result
| ) |

  | Calls the potential fields with data from the world model and returns an action. Parameters:
  robotPose | The robot's pose
  ballPosition | The position of the ball
  playerPoseCollection | The positions of all other robots
  obstaclesModel | Other obstacles
  teamMessageCollection | The collection of team messages.
  result | Returns the result
Definition at line 102 of file GTStandardConverter.cpp. Referenced by GT2005PotentialFieldBasicBehaviorAvoidRobots::execute(), GT2005PotentialFieldBasicBehaviorOffensiveSupport::execute(), and GT2005PotentialFieldBasicBehaviorSupport::execute().

void GTStandardConverter::execute | ( | const RobotPose & | robotPose,
|  | const BallModel & | ballPosition,
|  | const PlayerPoseCollection & | playerPoseCollection,
|  | const ObstaclesModel & | obstaclesModel,
|  | const TeamMessageCollection & | teamMessageCollection,
|  | const Pose2D & | specialDestination1,
|  | const Pose2D & | specialDestination2,
|  | const int & | numberOfSpecialDestinations,
|  | PotentialfieldResult & | result
| ) |

  | Calls the potential fields with data from the world model and returns an action. Parameters:
  robotPose | The robot's pose
  ballPosition | The position of the ball
  playerPoseCollection | The positions of all other robots
  obstaclesModel | Other obstacles
  teamMessageCollection | The collection of team messages.
  specialDestination1 | A destination, e.g. for go-to-point skills
  specialDestination2 | A second destination
  numberOfSpecialDestinations | The number of used special destinations 0,1 or 2
  result | Returns the result
Definition at line 115 of file GTStandardConverter.cpp. References destination1Desc, destination2Desc, PotentialfieldComposition::execute(), ObjectStateDescription::isActive, PfPose::pos, ObjectStateDescription::pose, potentialfields, PfPose::probability, Pose2D::rotation, PfPose::rotation, setData(), PotentialfieldComposition::setObjectState(), Pose2D::translation, Vector2< double >::x, PfVec::x, Vector2< double >::y, and PfVec::y.

Here is the call graph for this function:

void GTStandardConverter::getValueArray | ( | const RobotPose & | robotPose,
|  | const BallModel & | ballPosition,
|  | const PlayerPoseCollection & | playerPoseCollection,
|  | const ObstaclesModel & | obstaclesModel,
|  | const TeamMessageCollection & | teamMessageCollection,
|  | const std::string & | fieldname,
|  | double | x1,
|  | double | y1,
|  | double | x2,
|  | double | y2,
|  | int | xSteps,
|  | int | ySteps,
|  | double | value[],
|  | double & | max
| ) |

  | Computes an array of field values, used by visualization. Parameters:
  robotPose | The pose of the robot
  ballPosition | The position of the ball
  playerPoseCollection | The positions of all other robots
  obstaclesModel | The obstacles
  teamMessageCollection | The collection of team messages.
  fieldname | The name of the potential field
  x1 | Minimum x-coordinate to compute
  y1 | Minimum y-coordinate to compute
  x2 | Maximum x-coordinate to compute
  y2 | Maximum y-coordinate to compute
  xSteps | The computation steps in x-direction
  ySteps | The computation steps in y-direction
  value | An array containing all computed values, memory has to be allocated BEFORE calling the function
  max | Returns the maximum value
Definition at line 514 of file GTStandardConverter.cpp. References PotentialfieldComposition::getValueArray(), max, potentialfields, and setData().

Here is the call graph for this function:

void GTStandardConverter::getDirectionArray | ( | const RobotPose & | robotPose,
|  | const BallModel & | ballPosition,
|  | const PlayerPoseCollection & | playerPoseCollection,
|  | const ObstaclesModel & | obstaclesModel,
|  | const TeamMessageCollection & | teamMessageCollection,
|  | const std::string & | fieldname,
|  | double | x1,
|  | double | y1,
|  | double | x2,
|  | double | y2,
|  | int | xSteps,
|  | int | ySteps,
|  | PfVec | directions[]
| ) |

  | Computes an array of gradient directions, used by visualization. Parameters:
  robotPose | The pose of the robot
  ballPosition | The position of the ball
  playerPoseCollection | The positions of all other robots
  obstaclesModel | The obstacles
  teamMessageCollection | The collection of team messages.
  fieldname | The name of the potential field
  x1 | Minimum x-coordinate to compute
  y1 | Minimum y-coordinate to compute
  x2 | Maximum x-coordinate to compute
  y2 | Maximum y-coordinate to compute
  xSteps | The computation steps in x-direction
  ySteps | The computation steps in y-direction
  directions | An array containing all computed gradients, memory has to be allocated BEFORE calling the function
Definition at line 527 of file GTStandardConverter.cpp. References PotentialfieldComposition::getDirectionArray(), potentialfields, and setData().

Here is the call graph for this function:

void GTStandardConverter::getFieldNames | ( | std::vector< std::string > & | fieldNames | ) |

  | Returns the names of all fields within the potential field composition. Parameters:
  fieldNames | The names
Definition at line 540 of file GTStandardConverter.cpp. References PotentialfieldComposition::getFieldNames(), and potentialfields.

Here is the call graph for this function:

void GTStandardConverter::setData | ( | const RobotPose & | robotPose,
|  | const BallModel & | ballPosition,
|  | const PlayerPoseCollection & | playerPoseCollection,
|  | const ObstaclesModel & | obstaclesModel,
|  | const TeamMessageCollection & | teamMessageCollection
| ) | `[private]`

  | Updates the potentialfields with data from the world model. Parameters:
  robotPose | The robot's pose
  ballPosition | The position of the ball
  playerPoseCollection | The positions of all other robots
  obstaclesModel | The obstacles
  teamMessageCollection | The collection of team messages.
Definition at line 159 of file GTStandardConverter.cpp. References angleToFrontLeftObstacle, angleToFrontObstacle, angleToFrontRightObstacle, angleToLeftObstacle, angleToRightObstacle, ballDesc, freeGoalDesc, ObstaclesModel::getDistanceInDirection(), BallModel::getKnownPosition(), PlayerPoseCollection::getOpponentPlayerPose(), RobotPose::getPose(), PlayerPose::getPose(), SystemCall::getTimeSince(), BallModel::getTimeSinceLastKnown(), RobotPose::getValidity(), PlayerPose::getValidity(), goalieDesc, goalieLookingPositionDesc, goaliePositionDesc, ObjectStateDescription::isActive, PlayerPoseCollection::numberOfOpponentPlayers, TeamMessageCollection::numberOfTeamMessages, obstacleFrontDesc, obstacleFrontLeftDesc, obstacleFrontRightDesc, obstacleLeftDesc, obstacleRightDesc, openingAngle, opponent1Desc, opponent2Desc, opponent3Desc, opponent4Desc, opponent5Desc, opponent6Desc, player2Desc, player3Desc, player4Desc, PfPose::pos, ObjectStateDescription::pose, BallState::positionField, potentialfields, PfPose::probability, PfVec::rotate(), Pose2D::rotation, PfPose::rotation, BallModel::seen, seenBallDesc, selfDesc, PotentialfieldComposition::setObjectState(), PotentialfieldComposition::setOwnPose(), SeenBallState::timeWhenLastSeen, Pose2D::translation, unknownTeammate1Desc, unknownTeammate2Desc, unknownTeammate3Desc, unknownTeammate4Desc, Vector2< double >::x, PfVec::x, Vector2< double >::y, and PfVec::y. Referenced by execute(), getDirectionArray(), and getValueArray().

Here is the call graph for this function:

## Member Data Documentation

PotentialfieldComposition GTStandardConverter::potentialfields`[private]`

| An instance of the potential field implementation. Definition at line 138 of file GTStandardConverter.h. Referenced by execute(), getDirectionArray(), getFieldNames(), getValueArray(), load(), and setData().

ObjectStateDescription GTStandardConverter::seenBallDesc`[private]`

| Information about the ball. Definition at line 140 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::ballDesc`[private]`

| Information about the ball. Definition at line 140 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::selfDesc`[private]`

| Information about the robot, needed by some behaviors. Definition at line 142 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::goalieDesc`[private]`

| Information about the own team. Definition at line 144 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::player2Desc`[private]`

| Information about the own team. Definition at line 144 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::player3Desc`[private]`

| Information about the own team. Definition at line 144 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::player4Desc`[private]`

| Information about the own team. Definition at line 144 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate1Desc`[private]`

| Definition at line 145 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate2Desc`[private]`

| Definition at line 145 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate3Desc`[private]`

| Definition at line 145 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate4Desc`[private]`

| Definition at line 145 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent1Desc`[private]`

| Information about the other team. Definition at line 148 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent2Desc`[private]`

| Information about the other team. Definition at line 148 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent3Desc`[private]`

| Information about the other team. Definition at line 148 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent4Desc`[private]`

| Information about the other team. Definition at line 148 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent5Desc`[private]`

| Information about the other team. Definition at line 148 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent6Desc`[private]`

| Information about the other team. Definition at line 148 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::destination1Desc`[private]`

| Information about special destinations. Definition at line 151 of file GTStandardConverter.h. Referenced by execute(), and load().

ObjectStateDescription GTStandardConverter::destination2Desc`[private]`

| Information about special destinations. Definition at line 151 of file GTStandardConverter.h. Referenced by execute(), and load().

ObjectStateDescription GTStandardConverter::obstacleFrontDesc`[private]`

| Information about obstacles. Definition at line 153 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleLeftDesc`[private]`

| Information about obstacles. Definition at line 153 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleRightDesc`[private]`

| Information about obstacles. Definition at line 153 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleFrontLeftDesc`[private]`

| Information about obstacles. Definition at line 153 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleFrontRightDesc`[private]`

| Information about obstacles. Definition at line 153 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::freeGoalDesc`[private]`

| Information about the free part of the goal. Definition at line 156 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::goalieLookingPositionDesc`[private]`

| Position to look be looked at by goalie. Definition at line 158 of file GTStandardConverter.h. Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::goaliePositionDesc`[private]`

| The goalie position. Definition at line 160 of file GTStandardConverter.h. Referenced by load(), and setData().

double GTStandardConverter::angleToFrontObstacle`[private]`

| Angles to obstacles. Definition at line 162 of file GTStandardConverter.h. Referenced by load(), and setData().

double GTStandardConverter::angleToLeftObstacle`[private]`

| Angles to obstacles. Definition at line 162 of file GTStandardConverter.h. Referenced by load(), and setData().

double GTStandardConverter::angleToRightObstacle`[private]`

| Angles to obstacles. Definition at line 162 of file GTStandardConverter.h. Referenced by load(), and setData().

double GTStandardConverter::angleToFrontLeftObstacle`[private]`

| Angles to obstacles. Definition at line 162 of file GTStandardConverter.h. Referenced by load(), and setData().

double GTStandardConverter::angleToFrontRightObstacle`[private]`

| Angles to obstacles. Definition at line 162 of file GTStandardConverter.h. Referenced by load(), and setData().

double GTStandardConverter::openingAngle`[private]`

| Opening angle of an obstacle sector. Definition at line 165 of file GTStandardConverter.h. Referenced by load(), and setData().

The documentation for this class was generated from the following files:

- Tools/PotentialFields/GTStandardConverter.h
- Tools/PotentialFields/GTStandardConverter.cpp