GTStandardConverter Class Reference

#include <GTStandardConverter.h>

List of all members.

Public Member Functions

 GTStandardConverter (const char *fileName)
 GTStandardConverter ()
void load (const char *filename)
void execute (const RobotPose &robotPose, const BallModel &ballPosition, const PlayerPoseCollection &playerPoseCollection, const ObstaclesModel &obstaclesModel, const TeamMessageCollection &teamMessageCollection, PotentialfieldResult &result)
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)
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)
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[])
void getFieldNames (std::vector< std::string > &fieldNames)

Private Member Functions

void setData (const RobotPose &robotPose, const BallModel &ballPosition, const PlayerPoseCollection &playerPoseCollection, const ObstaclesModel &obstaclesModel, const TeamMessageCollection &teamMessageCollection)

Private Attributes

PotentialfieldComposition potentialfields
ObjectStateDescription seenBallDesc
ObjectStateDescription ballDesc
ObjectStateDescription selfDesc
ObjectStateDescription goalieDesc
ObjectStateDescription player2Desc
ObjectStateDescription player3Desc
ObjectStateDescription player4Desc
ObjectStateDescription unknownTeammate1Desc
ObjectStateDescription unknownTeammate2Desc
ObjectStateDescription unknownTeammate3Desc
ObjectStateDescription unknownTeammate4Desc
ObjectStateDescription opponent1Desc
ObjectStateDescription opponent2Desc
ObjectStateDescription opponent3Desc
ObjectStateDescription opponent4Desc
ObjectStateDescription opponent5Desc
ObjectStateDescription opponent6Desc
ObjectStateDescription destination1Desc
ObjectStateDescription destination2Desc
ObjectStateDescription obstacleFrontDesc
ObjectStateDescription obstacleLeftDesc
ObjectStateDescription obstacleRightDesc
ObjectStateDescription obstacleFrontLeftDesc
ObjectStateDescription obstacleFrontRightDesc
ObjectStateDescription freeGoalDesc
ObjectStateDescription goalieLookingPositionDesc
ObjectStateDescription goaliePositionDesc
double angleToFrontObstacle
double angleToLeftObstacle
double angleToRightObstacle
double angleToFrontLeftObstacle
double angleToFrontRightObstacle
double openingAngle


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().

GTStandardConverter::GTStandardConverter (  ) 

Constructor

Definition at line 27 of file GTStandardConverter.cpp.


Member Function Documentation

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
teamMessageCollection Information from other robots
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< V >::x, PfVec::x, Vector2< V >::y, and PfVec::y.

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 GT2004PotentialFieldBasicBehaviorOffensiveSupport::execute(), GT2004PotentialFieldBasicBehaviorSupport::execute(), and GT2004PotentialFieldBasicBehaviorGoToPose::execute().

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
teamMessageCollection Information from other robots

Definition at line 527 of file GTStandardConverter.cpp.

References PotentialfieldComposition::getDirectionArray(), potentialfields, and setData().

Referenced by CPotentialFieldViewerDlgBar::getValues().

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.

Referenced by CPotentialFieldViewerDlgBar::OnPotentialfieldViewerOpenButton().

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
teamMessageCollection Information from other robots

Definition at line 514 of file GTStandardConverter.cpp.

References PotentialfieldComposition::getValueArray(), potentialfields, and setData().

Referenced by CPotentialFieldViewerDlgBar::getValues().

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 GT2004PotentialFieldBasicBehavior::GT2004PotentialFieldBasicBehavior(), GTStandardConverter(), and CPotentialFieldViewerDlgBar::OnPotentialfieldViewerOpenButton().

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, potentialfields, PfPose::probability, PfVec::rotate(), Pose2D::rotation, PfPose::rotation, BallModel::seen, seenBallDesc, selfDesc, PotentialfieldComposition::setObjectState(), PotentialfieldComposition::setOwnPose(), SeenBallPosition::timeWhenLastSeen, Pose2D::translation, unknownTeammate1Desc, unknownTeammate2Desc, unknownTeammate3Desc, unknownTeammate4Desc, Vector2< V >::x, PfVec::x, Vector2< V >::y, and PfVec::y.

Referenced by execute(), getDirectionArray(), and getValueArray().


Member Data Documentation

double GTStandardConverter::angleToFrontLeftObstacle [private]

Definition at line 165 of file GTStandardConverter.h.

Referenced by load(), and setData().

double GTStandardConverter::angleToFrontObstacle [private]

Angles to obstacles

Definition at line 165 of file GTStandardConverter.h.

Referenced by load(), and setData().

double GTStandardConverter::angleToFrontRightObstacle [private]

Definition at line 165 of file GTStandardConverter.h.

Referenced by load(), and setData().

double GTStandardConverter::angleToLeftObstacle [private]

Definition at line 165 of file GTStandardConverter.h.

Referenced by load(), and setData().

double GTStandardConverter::angleToRightObstacle [private]

Definition at line 165 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::ballDesc [private]

Definition at line 143 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::destination1Desc [private]

Information about special destinations

Definition at line 154 of file GTStandardConverter.h.

Referenced by execute(), and load().

ObjectStateDescription GTStandardConverter::destination2Desc [private]

Definition at line 154 of file GTStandardConverter.h.

Referenced by execute(), and load().

ObjectStateDescription GTStandardConverter::freeGoalDesc [private]

Information about the free part of the goal

Definition at line 159 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::goalieDesc [private]

Information about the own team

Definition at line 147 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::goalieLookingPositionDesc [private]

Position to look be looked at by goalie

Definition at line 161 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::goaliePositionDesc [private]

The goalie position

Definition at line 163 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleFrontDesc [private]

Information about obstacles

Definition at line 156 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleFrontLeftDesc [private]

Definition at line 156 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleFrontRightDesc [private]

Definition at line 156 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleLeftDesc [private]

Definition at line 156 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::obstacleRightDesc [private]

Definition at line 156 of file GTStandardConverter.h.

Referenced by load(), and setData().

double GTStandardConverter::openingAngle [private]

Opening angle of an obstacle sector

Definition at line 168 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent1Desc [private]

Information about the other team

Definition at line 151 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent2Desc [private]

Definition at line 151 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent3Desc [private]

Definition at line 151 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent4Desc [private]

Definition at line 151 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent5Desc [private]

Definition at line 151 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::opponent6Desc [private]

Definition at line 151 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::player2Desc [private]

Definition at line 147 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::player3Desc [private]

Definition at line 147 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::player4Desc [private]

Definition at line 147 of file GTStandardConverter.h.

Referenced by load(), and setData().

PotentialfieldComposition GTStandardConverter::potentialfields [private]

An instance of the potential field implementation

Definition at line 141 of file GTStandardConverter.h.

Referenced by execute(), getDirectionArray(), getFieldNames(), getValueArray(), load(), and setData().

ObjectStateDescription GTStandardConverter::seenBallDesc [private]

Information about the ball

Definition at line 143 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::selfDesc [private]

Information about the robot, needed by some behaviors

Definition at line 145 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate1Desc [private]

Definition at line 148 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate2Desc [private]

Definition at line 148 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate3Desc [private]

Definition at line 148 of file GTStandardConverter.h.

Referenced by load(), and setData().

ObjectStateDescription GTStandardConverter::unknownTeammate4Desc [private]

Definition at line 148 of file GTStandardConverter.h.

Referenced by load(), and setData().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:36:32 2006 for DT2005.panorama by  doxygen 1.4.7