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

Modules/BehaviorControl/GT2004BehaviorControl/GT2004Symbols/OpenChallengeSymbols.h

Go to the documentation of this file.
00001 /** 
00002 * @file OpenChallengeSymbols.h
00003 *
00004 * Declaration of class BallSymbols.
00005 *
00006 * @author 
00007 */
00008 
00009 #ifndef __OpenChallengeSymbols_h_
00010 #define __OpenChallengeSymbols_h_
00011 
00012 #include "../../BehaviorControl.h"
00013 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
00014 #include "Tools/SlidingAverageValue.h"
00015 
00016 // this will be changed until release...
00017 enum OCSetStatus2
00018 {
00019   dtt_initial = 0,
00020   dtt_start,
00021   dtt_finishedIntro,
00022   dtt_finishedGoToBridge,
00023   dtt_finishedClimbBridge,
00024   dtt_finishedWalkWithBridge,
00025   dtt_finishedGoToBitePoint,
00026   dtt_finishedBite,
00027   dtt_loseBitePoints,
00028   dtt_finishedExtro,
00029   dtt_finished
00030 };
00031 
00032 typedef struct OC
00033 {
00034   double type;
00035   double x;
00036   double y;
00037   double rotation;
00038 } OC;
00039 
00040 class OpenChallengeSymbols : public Xabsl2FunctionProvider, public BehaviorControlInterfaces
00041 {
00042 public:
00043 
00044   enum OCStatus
00045   {
00046     initial = 0,
00047     intro,
00048     goToBridge,
00049     goToBitePoint,
00050     allBitePointsReady,
00051     walkWithBridge,
00052     extro,
00053     finished
00054   };
00055 
00056   enum OCSetStatus
00057   {
00058     setInitial = 0,
00059     setIntro,
00060     setGoToBridge,
00061     setGoToBitePoint,
00062     setMyBitePointIsReady,
00063     setLostMyBitePoint,
00064     setWalkWithBridge,
00065     setExtro,
00066     setFinished
00067   };
00068 
00069   enum CRIP{
00070       unchanged,
00071       rip
00072   };
00073 
00074 /*
00075 * Constructor.
00076 * @param interfaces The parameters of the BehaviorControl module.
00077   */
00078   OpenChallengeSymbols(const BehaviorControlInterfaces& interfaces);
00079   
00080   /** registers the symbols at an engine */
00081   void registerSymbols(Xabsl2Engine& engine);
00082 
00083   /** updates the symbols */
00084   void update();
00085 
00086   //!@name Input symbols
00087   //!@{
00088   // bridge
00089   OCBridge::Side getLastSeenSide();    /*!< A function for the symbol "bridge.last-seen-side" */
00090   double getSeenDistanceToBridge();    /*!< A function for the symbol "bridge.seen.distance" */
00091   double getSeenAngleToBridge();       /*!< A function for the symbol "bridge.seen.angle" */
00092   double getTimeSinceLastSeenBridge(); /*!< A function for the symbol "bridge.time-since-last-seen" */
00093 
00094   // bite point
00095   BitePoint::Position getBitePointPosition(); /*!< A function for the symbol "bite-point.position" */
00096   double getSeenDistanceToBitePoint();        /*!< A function for the symbol "bite-point.seen.distance" */
00097   double getSeenAngleToBitePoint();           /*!< A function for the symbol "bite-point.seen.angle" */
00098   double getPreciseShiftToBitePoint();        /*!< A function for the symbol "bite-point.precise-shift" */
00099   double getTimeSinceLastSeenBitePoint();     /*!< A function for the symbol "bite-point.time-since-last-seen" */
00100 
00101   // red line
00102   double redLineInImageAngle();               /*!< A function for the symbol "bite-point.time-since-last-seen" */
00103   double redLineAngle();                      /*!< A function for the symbol "bite-point.time-since-last-seen" */
00104   double getTimeSinceLastSeenRedLine();     /*!< A function for the symbol "bite-point.time-since-last-seen" */
00105   double getSeenDistanceToRedLine();    /*!< A function for the symbol "bridge.seen.distance" */
00106 
00107   // PSD data
00108   double getSensorPSDNear();            /*!< A function for the symbol "open-challenge.headpsd.near" */
00109   double getSensorPSDFar();             /*!< A function for the symbol "open-challenge.headpsd.far" */
00110   double getDistanceToSIFOC();          /*!< A function for the symbol "open-challenge.distance-to-sifoc" */
00111   
00112   // acceleration data
00113   double getSensorAccelerationX();      /*!< A function for the symbol "open-challenge.accelerator.x" */
00114   double getSensorAccelerationY();      /*!< A function for the symbol "open-challenge.accelerator.y" */
00115   double getSensorAccelerationZ();      /*!< A function for the symbol "open-challenge.accelerator.z" */
00116 
00117   // ramp
00118   double getAiboOnRamp();               /*!< A function for the symbol "open-challenge.on-ramp" */
00119   double getRampAngleOfRedLine();       /*!< A function for the symbol "ramp.angle-of-line" */
00120   double getRampLowestLinePointX();     /*!< A function for the symbol "ramp.lowest-line-point.x" */
00121   double getRampLowestLinePointY();     /*!< A function for the symbol "ramp.lowest-line-point.y" */
00122   double getRampHighestLinePointX();    /*!< A function for the symbol "ramp.highest-line-point.x" */
00123   double getRampHighestLinePointY();    /*!< A function for the symbol "ramp.highest-line-point.y" */
00124   double getRampDistanceToStartPoint(); /*!< A function for the symbol "ramp.lowest-line-point.distance" */
00125   double getRampTimeSinceLastSeen();    /*!< A function for the symbol "ramp.time-since-last-seen" */
00126 
00127   // switch ImageProcessor
00128   void setRIP(int t);                   /*!< A function for the symbol "openchallenge-image" */
00129   // set stati
00130   void setOCStatusDtt(int aStatus);     /*!< A function for the symbol "open-challenge.set-status-dtt" */
00131 
00132   
00133   //!@}
00134 
00135 
00136   /** Varaible to hold the open challenge status */
00137   OCStatus ocStatus;
00138 
00139   /* A function for the output symbol "open-challenge.set-status". */
00140   void setOCStatus(int aStatus);
00141 
00142 
00143 private:
00144   OC m_walkRequest;
00145   double m_headrot;
00146 
00147   int bitePointToUse[Player::numOfPlayerNumbers];
00148   bool bitePointReady[BitePoint::numOfPositions];
00149   int masterDog;
00150 
00151   // ramp
00152   SlidingAverageValue xspeed;     // used at getAiboOnRamp()
00153 
00154   // alread-moved-bridge
00155   int ambVal;
00156   // learn acceleration data
00157   int learnAcc;
00158   SlidingAverageValue groundVal;
00159 
00160 
00161 };
00162 
00163 
00164 
00165 
00166 #endif // OpenChallengeSymbols
00167 
00168 /*
00169 * Change Log
00170 * 
00171 * $Log: OpenChallengeSymbols.h,v $
00172 * Revision 1.4  2004/08/09 13:51:27  hamerla
00173 * import OpenChallen Behavior to WM
00174 *
00175 * Revision 1.3  2004/07/22 22:38:20  kerdels
00176 * added DTT used by Open Challenge, RIP and Xabsl-Options will follow
00177 *
00178 * Revision 1.2  2004/06/01 13:58:14  schumann
00179 * special percept type redLine added,
00180 * part 1 of open challenge added
00181 *
00182 * Revision 1.1.1.1  2004/05/22 17:18:04  cvsadm
00183 * created new repository GT2004_WM
00184 *
00185 * Revision 1.4  2004/05/17 18:20:00  kerdels
00186 * adjusted symbols for open challenge to enable free mapping of players to bitePoints- and controllerpositions
00187 *
00188 * Revision 1.3  2004/05/17 17:17:50  kerdels
00189 * added symbols for the sequence control of the open challenge,
00190 * fixed a bug concerning 5-dog-mode and distribution of option-ratings,
00191 * set one = 0 in enum Player::playerNumber --> just to be sure ;-)
00192 *
00193 * Revision 1.2  2004/05/17 01:56:15  kerdels
00194 * prepared some symbols for the open challenge bridge detection
00195 *
00196 * Revision 1.1  2004/05/08 16:18:14  hamerla
00197 * Open Challenge
00198 *
00199 *
00200 */
00201 

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