#include <GTStandardConverter.h>
Definition at line 30 of file GTStandardConverter.h.
GTStandardConverter::GTStandardConverter | ( | const char * | fileName | ) |
Constructor.
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.
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
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
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
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
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
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
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
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().
double GTStandardConverter::angleToFrontLeftObstacle [private] |
double GTStandardConverter::angleToFrontObstacle [private] |
Angles to obstacles
Definition at line 165 of file GTStandardConverter.h.
double GTStandardConverter::angleToFrontRightObstacle [private] |
double GTStandardConverter::angleToLeftObstacle [private] |
double GTStandardConverter::angleToRightObstacle [private] |
Information about special destinations
Definition at line 154 of file GTStandardConverter.h.
Information about the free part of the goal
Definition at line 159 of file GTStandardConverter.h.
Information about the own team
Definition at line 147 of file GTStandardConverter.h.
Position to look be looked at by goalie
Definition at line 161 of file GTStandardConverter.h.
The goalie position
Definition at line 163 of file GTStandardConverter.h.
Information about obstacles
Definition at line 156 of file GTStandardConverter.h.
double GTStandardConverter::openingAngle [private] |
Opening angle of an obstacle sector
Definition at line 168 of file GTStandardConverter.h.
Information about the other team
Definition at line 151 of file GTStandardConverter.h.
An instance of the potential field implementation
Definition at line 141 of file GTStandardConverter.h.
Referenced by execute(), getDirectionArray(), getFieldNames(), getValueArray(), load(), and setData().
Information about the ball
Definition at line 143 of file GTStandardConverter.h.
Information about the robot, needed by some behaviors
Definition at line 145 of file GTStandardConverter.h.