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

Modules/BehaviorControl/GT2004BehaviorControl/GT2004Symbols/EvolutionSymbols.h

Go to the documentation of this file.
00001 /** 
00002 * @file EvolutionSymbols.h
00003 *
00004 * Declaration of class EvolutionSymbols.
00005 *
00006 * @author Uwe Düffert
00007 */
00008 
00009 #ifndef __EvolutionSymbols_h_
00010 #define __EvolutionSymbols_h_
00011 
00012 #include "../../BehaviorControl.h"
00013 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
00014 #include "Tools/Math/Vector2.h"
00015 
00016 /**
00017 * The Xabsl2 symbols that are defined in "evolution-symbols.xml"
00018 *
00019 * @author Uwe Düffert
00020 */ 
00021 class EvolutionSymbols : public Xabsl2FunctionProvider, public BehaviorControlInterfaces
00022 {
00023 public:
00024 /*
00025 * Constructor.
00026 * @param interfaces The paramters of the BehaviorControl module.
00027   */
00028   EvolutionSymbols(const BehaviorControlInterfaces& interfaces,
00029     GT2004ParametersSet& gt2004ParametersSet,
00030     Pose2D* gt2004ParametersCalibration,
00031     int& gt2004CurrentIndex,
00032     Pose2D& measurementRequest,
00033     int& evolutionMode);
00034   
00035   /** registers the symbols at an engine */
00036   void registerSymbols(Xabsl2Engine& engine);
00037   
00038   /** updates the symbols */
00039   void update();
00040   
00041   /** current estimated time to reach the ball */
00042   double estimatedTimeToReachBall;
00043   
00044   /** last time the robot pose validity was above 0.5 */
00045   unsigned long timeOfLastGoodSelfLocalization;
00046   /** current duration since robot pose validity was above 0.5 (in s) */
00047   double durationOfBadSelfLocalization;
00048   
00049   /** a position useful for starting to measure the performance of the current GT2004Parameters */
00050   Vector2<double> currentGT2004ParametersStartPosition;
00051   /** a direction useful for starting to measure the performance of the current GT2004Parameters, must be in deg */
00052   double currentGT2004ParametersStartDirection;
00053   /** A function for the symbol "current-gt2004-parameters-measure-blind". */
00054   bool getCurrentGT2004ParametersMeasureBlind();
00055   /** Gives a percentage of how good current gt2004Parameters fullfill its purpose */
00056   double getQualityOfCurrentGT2004Parameters();
00057   
00058   /** computes the estimated time to reach the ball */
00059   void estimateTimeToReachBall();
00060   
00061   /** current role */
00062   BehaviorTeamMessage::DynamicRole role;
00063   
00064   /** computes the current role */
00065   void computeRole();
00066   
00067   //!@name Input symbols
00068   //!@{
00069   /* 
00070   * A function for the symbol "robot-number". 
00071   * Returns the robots back number as read from player.cfg 
00072   */
00073   double getRobotNumber() { return (double)(getPlayer().getPlayerNumber() + 1); };
00074   
00075   /** A function for the symbol "another-player-is-in-ready-state". */
00076   bool getAnotherPlayerIsInReadyState();
00077   
00078   /** A function for the symbol "another-teammate-is-preparing-a-kick" */
00079   bool getAnotherTeammateIsPreparingAKick();
00080   
00081   /** A function for the symbol "another-teammate-is-performing-a-kick" */
00082   bool getAnotherTeammateIsPerformingAKick();
00083   
00084   /** A function for the symbol "another-teammate-just-performed-a-kick" */
00085   bool getAnotherTeammateJustPerformedAKick();
00086   
00087   /** A function for the symbol "the-striker-is-playing-near-the-opponent-goal" */
00088   bool getTheStrikerIsPlayingNearTheOpponentGoal();
00089   
00090   /** A function for the symbol "the-striker-is-not-playing-near-the-opponent-goal" */
00091   bool getTheStrikerIsNotPlayingNearTheOpponentGoal();
00092   
00093   /** A function for the symbol "the-striker-is-playing-near-the-own-goal" */
00094   bool getTheStrikerIsPlayingNearTheOwnGoal();
00095   
00096   /** A function for the symbol "the-striker-is-not-playing-near-the-own-goal" */
00097   bool getTheStrikerIsNotPlayingNearTheOwnGoal();
00098   
00099   /** A funtion for the symbol "catch-ball" */
00100   bool getCaught(); 
00101   
00102   /** A function for the symbol "catch-ball-time" */
00103   double getCatchTime(); 
00104   
00105   /** A function for the symbol "search-ball.x" */
00106   double getSearchBallX();
00107   
00108   //!@}
00109   
00110   /** The time when the ball was started to catch */
00111   unsigned long timeWhenBallWasStartedToCatch;
00112   
00113   /** The time until the ball was caught */
00114   unsigned long timeUntilBallWasCaught;
00115   
00116   /** Indicates if the robot is stuck (based on obstacles model)*/
00117   bool robotIsStuck;
00118   
00119   /** Indicates that there are close obstacles */
00120   bool obstaclesAreClose;
00121   
00122 private:
00123   /** GT2004 Evolution stuff */
00124   GT2004ParametersSet& gt2004ParametersSet;
00125   Pose2D* gt2004ParametersCalibration;
00126   int& gt2004CurrentIndex;
00127   Pose2D& measurementRequest;
00128   int& evolutionMode;
00129 };
00130 
00131 
00132 #endif // __EvolutionSymbols_h_
00133 
00134 /*
00135 * Change Log
00136 * 
00137 * $Log: EvolutionSymbols.h,v $
00138 * Revision 1.2  2004/07/10 00:13:51  spranger
00139 * renaming for coderelease and preparations for gt2005
00140 *
00141 * Revision 1.1  2004/05/29 18:18:20  dueffert
00142 * walk parameter evolution, measurement and calibration stuff ported to GT2004_WM
00143 *
00144 * Revision 1.1  2004/05/27 13:31:27  dueffert
00145 * walking evolution stuff separated
00146 *
00147 * Revision 1.7  2004/04/16 14:56:37  dueffert
00148 * cleanup for Martins data flow graphics
00149 *
00150 * Revision 1.6  2004/03/09 08:45:17  dueffert
00151 * second measurement behavior added; calculation of tsart position improved
00152 *
00153 * Revision 1.5  2004/03/08 01:06:59  roefer
00154 * Interfaces should be const
00155 *
00156 * Revision 1.4  2004/02/18 14:49:20  dueffert
00157 * behavior control can now change walking parameters
00158 *
00159 * Revision 1.3  2004/02/10 11:13:18  dueffert
00160 * symbol for evolution added
00161 *
00162 * Revision 1.2  2003/12/06 17:45:33  loetzsch
00163 * replaced Player::playerRole (goalie, defender, striker1, striker2)
00164 * by Player::playerNumber (one, two, three, four)
00165 *
00166 * Revision 1.1  2003/10/06 13:39:29  cvsadm
00167 * Created GT2004 (M.J.)
00168 *
00169 * Revision 1.4  2003/07/07 21:15:39  risler
00170 * search-ball.x added
00171 * search-for-ball works without wlan
00172 *
00173 * Revision 1.3  2003/07/03 11:04:42  juengel
00174 * obstaclesAreClose is calculated
00175 *
00176 * Revision 1.2  2003/07/03 10:15:22  loetzsch
00177 * added symbol "not-stuck-but..."
00178 *
00179 * Revision 1.1.1.1  2003/07/02 09:40:23  cvsadm
00180 * created new repository for the competitions in Padova from the 
00181 * tamara CVS (Tuesday 2:00 pm)
00182 *
00183 * removed unused solutions
00184 *
00185 * Revision 1.12  2003/06/19 21:31:45  juengel
00186 * Added robot-is-stuck.
00187 *
00188 * Revision 1.11  2003/06/19 10:17:17  risler
00189 * symbol another-teammate-is-preparing-a-kick added
00190 *
00191 * Revision 1.10  2003/06/17 19:54:59  risler
00192 * ball caught symbols moved to strategy
00193 *
00194 * Revision 1.9  2003/06/02 14:10:20  loetzsch
00195 * added some hysteresises for the supporter position options
00196 *
00197 * Revision 1.8  2003/05/31 14:38:48  loetzsch
00198 * changed the symbols for the intercept
00199 *
00200 * Revision 1.7  2003/05/28 17:48:35  loetzsch
00201 * better positioning for the supporters
00202 *
00203 * Revision 1.6  2003/05/27 16:52:53  loetzsch
00204 * first passing experiments
00205 *
00206 * Revision 1.5  2003/05/25 22:37:02  loetzsch
00207 * finished the game state options of GT2003
00208 *
00209 * Revision 1.4  2003/05/08 14:25:30  risler
00210 * some bugfixes
00211 *
00212 * Revision 1.3  2003/05/08 13:20:37  loetzsch
00213 * some cleanup
00214 *
00215 * Revision 1.2  2003/05/08 00:22:47  risler
00216 * added strategy symbols
00217 *
00218 * Revision 1.1  2003/05/06 16:28:19  loetzsch
00219 * added class StrategySymbols
00220 *
00221 */
00222 

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