00001 /** 00002 * @file ChallengeSymbols.h 00003 * 00004 * Declaration of class ChallengeSymbols. 00005 * 00006 * @author Thomas Röfer 00007 */ 00008 00009 #ifndef __ChallengeSymbols_h_ 00010 #define __ChallengeSymbols_h_ 00011 00012 #include "../BehaviorControl.h" 00013 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h" 00014 00015 /** 00016 * The Xabsl2 symbols that are defined in "challenge-symbols.xml" 00017 * 00018 * @author Thomas Röfer 00019 */ 00020 class ChallengeSymbols : public Xabsl2FunctionProvider, public BehaviorControlInterfaces 00021 { 00022 public: 00023 /* 00024 * Constructor. 00025 * @param interfaces The parameters of the BehaviorControl module. 00026 */ 00027 ChallengeSymbols(const BehaviorControlInterfaces& interfaces); 00028 00029 /** registers the symbols at an engine */ 00030 void registerSymbols(Xabsl2Engine& engine); 00031 00032 /** updates the symbols */ 00033 void update(); 00034 void challenge2Swap(Pose2D* p, int i, int j); 00035 void challenge2ShortestPermutation(Pose2D* p, int n, double& minLength); 00036 void challenge2ShortestPath(); 00037 void challenge2OptimalRotation(Pose2D& pose); 00038 00039 double _challenge2TargetPositionX(); /**< Returns x coordinate of target position with current index. */ 00040 double _challenge2TargetPositionY(); /**< Returns y coordinate of target position with current index. */ 00041 double _challenge2TargetPositionRotation(); /**< Returns rotation of target position with current index. */ 00042 00043 double challenge2TargetPositionX(double index); /**< Returns x coordinate of target position with current index. */ 00044 double challenge2TargetPositionY(double index); /**< Returns y coordinate of target position with current index. */ 00045 double challenge2TargetPositionRotation(double index); /**< Returns rotation of target position with current index. */ 00046 00047 double imageCharacteristicsAvgY (); 00048 double imageCharacteristicsAvgU (); 00049 double imageCharacteristicsAvgV (); 00050 00051 double getProbableOrientation (); 00052 00053 double getTimeSinceCenterCircleVisible (); 00054 private: 00055 Pose2D targetPositions[5]; /**< The 5 target positions for the localization challenge */ 00056 double index, /**< the index for targetPosition? functions */ 00057 lastIndex; /**< The index of the previous call */ 00058 00059 unsigned long lastSeenCenterCircle; 00060 double timeSinceLastCenterCircle; 00061 }; 00062 00063 00064 #endif // __ChallengeSymbols_h_ 00065
1.3.6