GT2004PlayersLocator Class Reference

#include <GT2004PlayersLocator.h>

Inheritance diagram for GT2004PlayersLocator:

PlayersLocator Module PlayersLocatorInterfaces MessageHandler List of all members.

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

Detailed Description

This class is a locator for players of the own and the opponentīs team. It can assign the detected percepts to the players (even if they are not seen for two seconds), using points with validity and age.

Author:
Michael Kunz

Definition at line 22 of file GT2004PlayersLocator.h.


Member Enumeration Documentation

anonymous enum

Constants for the number of robots in the own and in the opponentīs team

Enumerator:
NUMBER_OF_OWN_PLAYERS_TO_LOCATE 
NUMBER_OF_OPPONENT_PLAYERS_TO_LOCATE 

Definition at line 29 of file GT2004PlayersLocator.h.

anonymous enum

Enumerator:
NUMBER_OF_POINTS_FOR_OWN_PLAYERS 
NUMBER_OF_POINTS_FOR_OPPONENT_PLAYERS 

Definition at line 31 of file GT2004PlayersLocator.h.


Constructor & Destructor Documentation

GT2004PlayersLocator::GT2004PlayersLocator ( const PlayersLocatorInterfaces interfaces  ) 

Constructor.

Parameters:
interfaces The paramters of the PlayersLocator module.

Definition at line 27 of file GT2004PlayersLocator.cpp.


Member Function Documentation

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.

Parameters:
oldX The x position before correcting it
oldY The y position before correcting it
newX The corrected x position
newY The corrected y position
Returns:
Returns TRUE if position is corrected, otherwise FALSE

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.


Member Data Documentation

const double GT2004PlayersLocator::MIN_MATCH_DIST = 500 [static]

Definition at line 26 of file GT2004PlayersLocator.h.

Referenced by execute().

VAPoints GT2004PlayersLocator::opponentPointsWithValidityAndAge [private]

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

VAPoints GT2004PlayersLocator::ownPointsWithValidityAndAge [private]

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.


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