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

Modules/BehaviorControl/CommonXabsl2Symbols/AngleSymbols.h

Go to the documentation of this file.
00001 /** 
00002 * @file AngleSymbols.h
00003 *
00004 * Declaration of class AngleSymbols.
00005 *
00006 * @author Matthias Jüngel
00007 */
00008 
00009 #ifndef __AngleSymbols_h_
00010 #define __AngleSymbols_h_
00011 
00012 #include "../BehaviorControl.h"
00013 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
00014 #include "Tools/FieldDimensions.h"
00015 #include "Tools/Actorics/RobotDimensions.h"
00016 
00017 /**
00018 * The Xabsl2 symbols that are defined in "angle-symbols.xml"
00019 *
00020 * @author Matthias Jüngel
00021 */ 
00022 class AngleSymbols : public Xabsl2FunctionProvider, public BehaviorControlInterfaces
00023 {
00024 public:
00025 /*
00026 * Constructor.
00027 * @param interfaces The paramters of the BehaviorControl module.
00028   */
00029   AngleSymbols(const BehaviorControlInterfaces& interfaces);
00030   
00031   /** registers the symbols at an engine */
00032   void registerSymbols(Xabsl2Engine& engine);
00033   
00034     /** updates the symbols */
00035   void update();
00036 
00037   //!@name Input symbols
00038   //!@{
00039 
00040   //localisation based:
00041   double getAngleToCenterOfField(); /*!< calculates the value for the symbol "robot-pose.best-angle-away-from-own-goal" */
00042   double getAngleToOpponentGoal(); /*!< A function for the symbol "robot-pose.angle-to-opponent-goal" */
00043   double getAngleToPointBehindOpponentGoal(); /*!< calculates the value for the symbol "robot-pose.angle-to-point-behind-opponent-goal" */
00044 
00045   // combined: vision + localisation
00046   double getBestAngleToOpponentGoal(); /*!< calculates the value for the symbol "robot-pose.best-angle-to-opponent-goal" */
00047   double getBestAngleToOpponentGoalNoObstacles(); /*!< calculates the value for the symbol "robot-pose.best-angle-to-opponent-goal-no-obstacles" */
00048   double getBestAngleAwayFromOwnGoal(); /*!< calculates the value for the symbol "robot-pose.best-angle-away-from-own-goal" */
00049   double getBestAngleAwayFromOwnGoalNoObstacles(); /*!< calculates the value for the symbol "robot-pose.best-angle-away-from-own-goal-no-obstacles" */
00050   double getGoalieGoalKickAngle(); /*!< calculates the value for the symbol "goalie.goal-kick-angle" */
00051 
00052   //!@}
00053 
00054   /** The angle that is shown by the top white LEDs */
00055   enum Angles {
00056     undefined,
00057     //localisation based:
00058     angleToCenterOfField,                //input symbol
00059     angleToOpponentGoal,                 //input symbol
00060     angleToLeftOpponentGoalPost,
00061     angleToRightOpponentGoalPost,        
00062     angleToLeftOpponentGoalCorner,
00063     angleToRightOpponentGoalCorner,        
00064     angleToPointBehindOpponentGoal,      //input symbol
00065 
00066     // vision based
00067     angleToFreePartOfOpponentGoal,   
00068 
00069     // combined: vision + localisation
00070     bestAngleToOpponentGoal,             //input symbol
00071     bestAngleToOpponentGoalNoObstacles,  //input symbol
00072     bestAngleAwayFromOwnGoal,            //input symbol
00073     bestAngleAwayFromOwnGoalNoObstacles, //input symbol
00074     goalieGoalKickAngle,                 //input symbol
00075 
00076     numberOfAngles
00077   };
00078 
00079   double getAngle(Angles id);
00080   
00081   static const char* getAngleName(Angles id)
00082   {
00083     switch(id)
00084     {
00085     case undefined: return "undefined";
00086     //localisation based:
00087     case angleToCenterOfField: return "angleToCenterOfField";
00088     case angleToOpponentGoal: return "angleToOpponentGoal";
00089     case angleToLeftOpponentGoalPost: return "angleToLeftOpponentGoalPost";
00090     case angleToRightOpponentGoalPost: return "angleToRightOpponentGoalPost";
00091     case angleToLeftOpponentGoalCorner: return "angleToLeftOpponentGoalCorner";
00092     case angleToRightOpponentGoalCorner: return "angleToRightOpponentGoalCorner";
00093     case angleToPointBehindOpponentGoal: return "angleToPointBehindOpponentGoal";
00094 
00095     // vision based
00096     case angleToFreePartOfOpponentGoal: return "angleToFreePartOfOpponentGoal";
00097 
00098     // combined: vision + localisation
00099     case bestAngleToOpponentGoal: return "bestAngleToOpponentGoal";
00100     case bestAngleToOpponentGoalNoObstacles: return "bestAngleToOpponentGoalNoObstacles";
00101     case bestAngleAwayFromOwnGoal: return "bestAngleAwayFromOwnGoal";
00102     case bestAngleAwayFromOwnGoalNoObstacles: return "bestAngleAwayFromOwnGoalNoObstacles";
00103     case goalieGoalKickAngle: return "goalieGoalKickAngle";
00104     default: return "please-edit-angle-name";
00105     }
00106   }
00107 
00108   Angles angleShownByLEDs;
00109   void drawAngleShownByLeds();
00110 
00111 private:
00112   void calculateVisionBasedAngles();
00113   void calculateLocalisationBasedAngles();
00114   void calculateCombinedAngles();
00115   double angles[numberOfAngles];
00116 };
00117 
00118 
00119 #endif // __AngleSymbols_h_
00120 
00121 /*
00122 * Change Log
00123 * 
00124 * $Log: AngleSymbols.h,v $
00125 * Revision 1.2  2004/06/23 19:31:10  juengel
00126 * Added angle "undefined"
00127 *
00128 * Revision 1.1  2004/06/22 18:48:56  juengel
00129 * kickAngles clean up
00130 *
00131 */
00132 

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