#include <GT2004PlayersLocator.h>
Inheritance diagram for GT2004PlayersLocator:
Public Types | |
NUMBER_OF_OWN_PLAYERS_TO_LOCATE = 3 | |
NUMBER_OF_OPPONENT_PLAYERS_TO_LOCATE = 4 | |
NUMBER_OF_POINTS_FOR_OWN_PLAYERS = 150 | |
NUMBER_OF_POINTS_FOR_OPPONENT_PLAYERS = 200 | |
enum | { NUMBER_OF_OWN_PLAYERS_TO_LOCATE = 3, NUMBER_OF_OPPONENT_PLAYERS_TO_LOCATE = 4 } |
enum | { NUMBER_OF_POINTS_FOR_OWN_PLAYERS = 150, NUMBER_OF_POINTS_FOR_OPPONENT_PLAYERS = 200 } |
Public Member Functions | |
GT2004PlayersLocator (const PlayersLocatorInterfaces &interfaces) | |
virtual void | execute () |
Static Public Attributes | |
static const double | TEAM_MESSAGE_VALIDITY = 0.3 |
static const double | MIN_MATCH_DIST = 500 |
Private Member Functions | |
bool | correctObstaclePosition (int oldX, int oldY, int &newX, int &newY) |
void | addOwnPlayerPercepts (const SinglePlayerPercept playerPercepts[], int numberOfPlayerPercepts, const RobotPose &startRobotPose, const double collectionValidity, const unsigned long collectionTimestamp) |
void | addOppPlayerPercepts (const SinglePlayerPercept playerPercepts[], int numberOfPlayerPercepts, const RobotPose &startRobotPose, const double collectionValidity, const unsigned long collectionTimestamp) |
Private Attributes | |
TeamMessage | teamMessage [NUMBER_OF_OWN_PLAYERS_TO_LOCATE] |
VAPoints | opponentPointsWithValidityAndAge |
VAPoints | ownPointsWithValidityAndAge |
Definition at line 22 of file GT2004PlayersLocator.h.
anonymous enum |
Constants for the number of robots in the own and in the opponentīs team
Definition at line 29 of file GT2004PlayersLocator.h.
anonymous enum |
Definition at line 31 of file GT2004PlayersLocator.h.
GT2004PlayersLocator::GT2004PlayersLocator | ( | const PlayersLocatorInterfaces & | interfaces | ) |
Constructor.
interfaces | The paramters of the PlayersLocator module. |
Definition at line 27 of file GT2004PlayersLocator.cpp.
void GT2004PlayersLocator::addOppPlayerPercepts | ( | const SinglePlayerPercept | playerPercepts[], | |
int | numberOfPlayerPercepts, | |||
const RobotPose & | startRobotPose, | |||
const double | collectionValidity, | |||
const unsigned long | collectionTimestamp | |||
) | [private] |
Definition at line 233 of file GT2004PlayersLocator.cpp.
References VAPoints::addPoint(), correctObstaclePosition(), RobotPose::getPose(), RobotPose::getValidity(), int(), opponentPointsWithValidityAndAge, Vector2< V >::x, and Vector2< V >::y.
Referenced by execute().
void GT2004PlayersLocator::addOwnPlayerPercepts | ( | const SinglePlayerPercept | playerPercepts[], | |
int | numberOfPlayerPercepts, | |||
const RobotPose & | startRobotPose, | |||
const double | collectionValidity, | |||
const unsigned long | collectionTimestamp | |||
) | [private] |
Definition at line 200 of file GT2004PlayersLocator.cpp.
References VAPoints::addPoint(), correctObstaclePosition(), RobotPose::getPose(), RobotPose::getValidity(), int(), ownPointsWithValidityAndAge, Vector2< V >::x, and Vector2< V >::y.
Referenced by execute().
bool GT2004PlayersLocator::correctObstaclePosition | ( | int | oldX, | |
int | oldY, | |||
int & | newX, | |||
int & | newY | |||
) | [private] |
Corrects the position of players. When the calculated position of a robot lies outside the playingfiled it is corrected to the nearby groundline.
oldX | The x position before correcting it | |
oldY | The y position before correcting it | |
newX | The corrected x position | |
newY | The corrected y position |
Definition at line 147 of file GT2004PlayersLocator.cpp.
References int().
Referenced by addOppPlayerPercepts(), and addOwnPlayerPercepts().
void GT2004PlayersLocator::execute | ( | ) | [virtual] |
Executes the module
Implements Module.
Definition at line 34 of file GT2004PlayersLocator.cpp.
References abs(), addOppPlayerPercepts(), addOwnPlayerPercepts(), VAPoints::addPoint(), PlayersPercept::bluePlayers, SystemCall::getCurrentSystemTime(), VAPoints::getMaximum(), PlayerPoseCollection::getOwnPlayerPose(), getPlayer(), PlayerPose::getPose(), RobotPose::getPose(), Player::getTeamColor(), PlayerPose::getValidity(), MIN_MATCH_DIST, NUMBER_OF_OPPONENT_PLAYERS_TO_LOCATE, NUMBER_OF_OWN_PLAYERS_TO_LOCATE, PlayersPercept::numberOfBluePlayers, PlayerPoseCollection::numberOfOpponentPlayers, PlayerPoseCollection::numberOfOwnPlayers, PlayersPercept::numberOfRedPlayers, TeamMessageCollection::numberOfTeamMessages, opponentPointsWithValidityAndAge, ownPointsWithValidityAndAge, PlayersLocatorInterfaces::playerPoseCollection, PlayersLocatorInterfaces::playersPercept, Player::red, PlayersPercept::redPlayers, PlayersLocatorInterfaces::robotPose, VAPoints::searchMaxima(), PlayerPoseCollection::setOpponentPlayerPose(), PlayerPoseCollection::setOwnPlayerPose(), PlayersLocatorInterfaces::teamMessageCollection, Pose2D::translation, Vector2< V >::x, and Vector2< V >::y.
const double GT2004PlayersLocator::MIN_MATCH_DIST = 500 [static] |
The points with validity and age for determining the position of robots of the own team
Definition at line 50 of file GT2004PlayersLocator.h.
Referenced by addOppPlayerPercepts(), and execute().
The points with validity and age for determining the position of robots of the opponentīs team
Definition at line 55 of file GT2004PlayersLocator.h.
Referenced by addOwnPlayerPercepts(), and execute().
const double GT2004PlayersLocator::TEAM_MESSAGE_VALIDITY = 0.3 [static] |
Definition at line 26 of file GT2004PlayersLocator.h.
TeamMessage GT2004PlayersLocator::teamMessage[NUMBER_OF_OWN_PLAYERS_TO_LOCATE] [private] |
Definition at line 44 of file GT2004PlayersLocator.h.