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

GT2004PlayersLocator Class Reference

This class is a locator for players of the own and the opponentīs team. More...

#include <GT2004PlayersLocator.h>

Inheritance diagram for GT2004PlayersLocator:

Inheritance graph
[legend]
Collaboration diagram for GT2004PlayersLocator:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { NUMBER_OF_OWN_PLAYERS_TO_LOCATE = 3, NUMBER_OF_OPPONENT_PLAYERS_TO_LOCATE = 4 }
 Constants for the number of robots in the own and in the opponentīs team. More...

enum  { NUMBER_OF_POINTS_FOR_OWN_PLAYERS = 150, NUMBER_OF_POINTS_FOR_OPPONENT_PLAYERS = 200 }

Public Member Functions

 GT2004PlayersLocator (const PlayersLocatorInterfaces &interfaces)
 Constructor.

virtual void execute ()
 Executes the module.


Static Public Attributes

const double TEAM_MESSAGE_VALIDITY = 0.3
const double MIN_MATCH_DIST = 500

Private Member Functions

bool correctObstaclePosition (int oldX, int oldY, int &newX, int &newY)
 Corrects the position of players.

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
 The points with validity and age for determining the position of robots of the own team.

VAPoints ownPointsWithValidityAndAge
 The points with validity and age for determining the position of robots of the opponentīs team.


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.

Enumeration values:
NUMBER_OF_OWN_PLAYERS_TO_LOCATE 
NUMBER_OF_OPPONENT_PLAYERS_TO_LOCATE 

Definition at line 29 of file GT2004PlayersLocator.h.

anonymous enum
 

Enumeration values:
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 20 of file GT2004PlayersLocator.cpp.


Member Function Documentation

void GT2004PlayersLocator::execute  )  [virtual]
 

Executes the module.

Implements Module.

Definition at line 27 of file GT2004PlayersLocator.cpp.

References addOppPlayerPercepts(), addOwnPlayerPercepts(), VAPoints::addPoint(), PlayersPercept::bluePlayers, 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, PlayersPercept::redPlayers, VAPoints::searchMaxima(), PlayerPoseCollection::setOpponentPlayerPose(), PlayerPoseCollection::setOwnPlayerPose(), Pose2D::translation, Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

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 140 of file GT2004PlayersLocator.cpp.

Referenced by addOppPlayerPercepts(), and addOwnPlayerPercepts().

void GT2004PlayersLocator::addOwnPlayerPercepts const SinglePlayerPercept  playerPercepts[],
int  numberOfPlayerPercepts,
const RobotPose startRobotPose,
const double  collectionValidity,
const unsigned long  collectionTimestamp
[private]
 

Definition at line 189 of file GT2004PlayersLocator.cpp.

References VAPoints::addPoint(), correctObstaclePosition(), RobotPose::getPose(), RobotPose::getValidity(), ownPointsWithValidityAndAge, Vector2< V >::x, and Vector2< V >::y.

Referenced by execute().

Here is the call graph for this function:

void GT2004PlayersLocator::addOppPlayerPercepts const SinglePlayerPercept  playerPercepts[],
int  numberOfPlayerPercepts,
const RobotPose startRobotPose,
const double  collectionValidity,
const unsigned long  collectionTimestamp
[private]
 

Definition at line 222 of file GT2004PlayersLocator.cpp.

References VAPoints::addPoint(), correctObstaclePosition(), RobotPose::getPose(), RobotPose::getValidity(), opponentPointsWithValidityAndAge, Vector2< V >::x, and Vector2< V >::y.

Referenced by execute().

Here is the call graph for this function:


Member Data Documentation

const double GT2004PlayersLocator::TEAM_MESSAGE_VALIDITY = 0.3 [static]
 

Definition at line 17 of file GT2004PlayersLocator.cpp.

const double GT2004PlayersLocator::MIN_MATCH_DIST = 500 [static]
 

Definition at line 18 of file GT2004PlayersLocator.cpp.

Referenced by execute().

TeamMessage GT2004PlayersLocator::teamMessage[NUMBER_OF_OWN_PLAYERS_TO_LOCATE] [private]
 

Definition at line 44 of file GT2004PlayersLocator.h.

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


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:07:50 2004 for GT2004 by doxygen 1.3.6