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

Modules/PlayersLocator/GT2004PlayersLocator.h

Go to the documentation of this file.
00001 /**
00002  * @file GT2004PlayersLocator.h
00003  * 
00004  * This file contains a class for players localization.
00005  * @author <A href=mailto:mkunz@informatik.uni-bremen.de>Michael Kunz</A>
00006  */
00007 
00008 #ifndef __GT2004PlayersLocator_h_
00009 #define __GT2004PlayersLocator_h_
00010 
00011 #include "PlayersLocator.h"
00012 #include "VAPoints.h"
00013 #include "Representations/Motion/OdometryData.h"
00014 
00015 /**
00016  * This class is a locator for players of the own and the opponentīs team.
00017  * It can assign the detected percepts to the players (even if they are not seen for two seconds),
00018  * using points with validity and age.
00019  *
00020  * @author <a href=mailto:mkunz@sim.tu-darmstadt.de>Michael Kunz</a>
00021  */
00022 class GT2004PlayersLocator : public PlayersLocator
00023 {
00024 
00025 public:
00026   static const double TEAM_MESSAGE_VALIDITY, MIN_MATCH_DIST;
00027 
00028   /** Constants for the number of robots in the own and in the opponentīs team*/
00029   enum {NUMBER_OF_OWN_PLAYERS_TO_LOCATE=3, NUMBER_OF_OPPONENT_PLAYERS_TO_LOCATE=4};
00030 
00031   enum {NUMBER_OF_POINTS_FOR_OWN_PLAYERS=150, NUMBER_OF_POINTS_FOR_OPPONENT_PLAYERS=200};
00032 
00033   /** 
00034   * Constructor.
00035   * @param interfaces The paramters of the PlayersLocator module.
00036   */
00037   GT2004PlayersLocator(const PlayersLocatorInterfaces& interfaces);
00038 
00039   /** Executes the module */
00040   virtual void execute();
00041 
00042 private:
00043 
00044   TeamMessage teamMessage[NUMBER_OF_OWN_PLAYERS_TO_LOCATE];
00045 
00046   /** 
00047    * The points with validity and age for determining the position of robots 
00048    * of the own team 
00049    */
00050   VAPoints opponentPointsWithValidityAndAge;
00051   /**
00052    * The points with validity and age for determining the position of robots 
00053    * of the opponentīs team 
00054    */
00055   VAPoints ownPointsWithValidityAndAge;
00056 
00057   /**
00058    * Corrects the position of players. When the calculated position of a robot lies outside
00059    * the playingfiled it is corrected to the nearby groundline.
00060    * @param oldX The x position before correcting it
00061    * @param oldY The y position before correcting it
00062    * @param newX The corrected x position
00063    * @param newY The corrected y position
00064    * @return Returns TRUE if position is corrected, otherwise FALSE
00065    */
00066   bool correctObstaclePosition(int oldX, int oldY, int &newX, int &newY);
00067 
00068   void addOwnPlayerPercepts(
00069     const SinglePlayerPercept playerPercepts[],
00070     int numberOfPlayerPercepts,
00071     const RobotPose& startRobotPose,
00072     const double collectionValidity,
00073     const unsigned long collectionTimestamp);
00074 
00075   void addOppPlayerPercepts(
00076     const SinglePlayerPercept playerPercepts[],
00077     int numberOfPlayerPercepts,
00078     const RobotPose& startRobotPose,
00079     const double collectionValidity,
00080     const unsigned long collectionTimestamp);
00081 
00082 };
00083 
00084 #endif// __GT2004PlayersLocator_h_
00085 
00086 /*
00087  * Change log :
00088  * 
00089  * $Log: GT2004PlayersLocator.h,v $
00090  * Revision 1.1  2004/07/10 00:18:31  spranger
00091  * renamed (readded) for coderelease
00092  *
00093  * Revision 1.1.1.1  2004/05/22 17:20:39  cvsadm
00094  * created new repository GT2004_WM
00095  *
00096  * Revision 1.2  2004/03/08 01:07:16  roefer
00097  * Interfaces should be const
00098  *
00099  * Revision 1.1  2003/10/06 14:10:15  cvsadm
00100  * Created GT2004 (M.J.)
00101  *
00102  * Revision 1.3  2003/09/26 15:27:49  juengel
00103  * Renamed DataTypes to representations.
00104  *
00105  * Revision 1.2  2003/09/26 11:38:52  juengel
00106  * - sorted tools
00107  * - clean-up in DataTypes
00108  *
00109  * Revision 1.1.1.1  2003/07/02 09:40:24  cvsadm
00110  * created new repository for the competitions in Padova from the 
00111  * tamara CVS (Tuesday 2:00 pm)
00112  *
00113  * removed unused solutions
00114  *
00115  * Revision 1.8  2003/05/27 12:48:12  mkunz
00116  * no more needed constants removed
00117  *
00118  * Revision 1.7  2003/05/20 12:39:44  mkunz
00119  * less points
00120  *
00121  * Revision 1.6  2003/05/16 14:50:13  mkunz
00122  * more points again
00123  *
00124  * Revision 1.5  2003/05/14 13:19:57  mkunz
00125  * bigger reorganization
00126  *
00127  * Revision 1.4  2003/05/13 14:31:16  mkunz
00128  * full transfer toVAPoints
00129  *
00130  * Revision 1.3  2003/05/08 19:51:23  mkunz
00131  * switched to VAPoints
00132  *
00133  * Revision 1.2  2003/04/15 15:52:09  risler
00134  * DDD GO 2003 code integrated
00135  *
00136  * Revision 1.6  2003/04/13 05:44:47  dthomas
00137  * modified: removed many features because nothing really works ;-(
00138  * added: alternative headcontrol
00139  *
00140  * Revision 1.5  2003/04/13 02:41:56  dthomas
00141  * modified: raised queue size
00142  *
00143  * Revision 1.4  2003/04/12 17:01:27  mkunz
00144  * back again
00145  *
00146  * Revision 1.3  2003/03/31 18:17:43  max
00147  * tamara update
00148  *
00149  * Revision 1.1  2003/03/29 12:51:03  mkunz
00150  * just a copy of GT2001
00151  *
00152  *
00153  */

Generated on Thu Sep 23 19:57:31 2004 for GT2004 by doxygen 1.3.6