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

# Representations/Motion/HeadControlMode.h

Go to the documentation of this file.

    00001 /**
    00002 * @file HeadControlMode.h
    00003 *
    00004 * Based on old implementation of HeadControlMode from GT2001
    00005 *
    00006 * Declaration of class HeadControlMode
    00007 * Stores head modes requested by BehaviorControl
    00008 *
    00009 * @author Matthias Juengel
    00010 * @author Nils Koschmieder
    00011 */
    00012
    00013 #ifndef __HeadControlMode_h_
    00014 #define __HeadControlMode_h_
    00015
    00016 #include "Tools/Streams/InOut.h"
    00017 #include "Tools/Math/Vector3.h"
    00018 #include "Tools/Math/Vector2.h"
    00019 #include "Tools/Streams/Streamable.h"
    00020
    00021
    00022 /**
    00023 * Stores head modes requested by BehaviorControl
    00024 */
    00025 class HeadControlMode : public Streamable
    00026 {
    00027 public:
    00028
    00029   virtual void serialize( In* in, Out* out)
    00030   {
    00031     STREAM_REGISTER_BEGIN();
    00032     STREAM_ENUM( headControlMode, numOfHeadControlModes, HeadControlMode::getHeadControlModeName);
    00033     // STREAM_ENUMASINT( headControlMode);
    00034     STREAM( directTilt);
    00035     STREAM( directPan);
    00036     STREAM( directRoll);
    00037     STREAM( directSpeed);
    00038     STREAM( directMouth);
    00039     STREAM( durationInEvolution);
    00040     STREAM_REGISTER_FINISH();
    00041   }
    00042
    00043   /** constructor */
    00044   HeadControlMode();
    00045
    00046   /** destructor */
    00047   ~HeadControlMode();
    00048
    00049   /** possible head control modes */
    00050   enum HeadControlModes
    00051   {
    00052       none,
    00053       searchForBall,
    00054       searchAuto,
    00055       searchForLandmarks,
    00056       searchForLandmarksHeadLow,
    00057       scanForObstacles,
    00058       lookAtMostInformativeLandmark,
    00059       lookAtBluePinkLandmark,
    00060       lookBetweenFeet,
    00061       lookLeft,
    00062       lookRight,
    00063       lookStraightAhead,
    00064       catchBall,
    00065       lookBetweenFeetForCarriedBall,
    00066       catchBallHigh,
    00067       holdBall,
    00068       releaseCaughtBallWhenTurningLeft,
    00069       releaseCaughtBallWhenTurningRight,
    00070       stayAsForced,
    00071       lookToStars,
    00072       snapAtFinger,
    00073       lookParallelToGround,
    00074       lookTowardOpponentGoal,
    00075       directedScanForLandmarks,
    00076       directedScanForObstacles,
    00077
    00078       direct,
    00079       calibrate,
    00080       calibrateHeadSpeed,
    00081       watchOrigin,
    00082
    00083       openChallengePullBridge,
    00084       openChallengeTest,
    00085       openChallengeTest2,
    00086       openChallengeGoToBridge,
    00087       openChallengeJoysickMode,
    00088       openChallengeReset,
    00089
    00090       searchForBallLeft,
    00091       searchForBallRight,
    00092
    00093       lookAtInsertionPointBackLeft,
    00094       lookAtInsertionPointBackRight,
    00095
    00096       lookAtInsertionPointMiddleLeft,
    00097       lookAtInsertionPointMiddleRight,
    00098
    00099       lookAtInsertionPointFrontLeft,
    00100       lookAtInsertionPointFrontRight,
    00101
    00102       lookAroundPropagatedBallPosition,
    00103       lookAroundCommunicatedBallPosition,
    00104
    00105       searchForLandmarksEvolution,
    00106
    00107       realSlowScan,
    00108
    00109       numOfHeadControlModes
    00110   };
    00111
    00112   /** The requested head control mode */
    00113   HeadControlModes headControlMode;
    00114
    00115   /** Returns the name of a HeadTrackMode. */
    00116   static const char* getHeadControlModeName(HeadControlModes mode)
    00117   {
    00118     switch(mode)
    00119     {
    00120       case none: return "none";
    00121       case searchForBall: return "searchForBall";
    00122       case searchAuto: return "searchAuto";
    00123       case searchForLandmarks: return "searchForLandmarks";
    00124       case scanForObstacles: return "scanForObstacles";
    00125       case searchForLandmarksHeadLow: return "searchForLandmarksLow";
    00126       case lookAtMostInformativeLandmark: return "lookAtMostInformativeLandmark";
    00127       case lookAtBluePinkLandmark: return "lookAtBluePinkLandmark";
    00128       case lookBetweenFeet: return "lookBetweenFeet";
    00129       case lookLeft: return "lookLeft";
    00130       case lookRight: return "lookRight";
    00131       case lookStraightAhead: return "lookStraightAhead";
    00132       case catchBall: return "catchBall";
    00133       case lookBetweenFeetForCarriedBall: return "lookBetweenFeetForCarriedBall";
    00134       case catchBallHigh: return "catchBallHigh";
    00135       case holdBall: return "holdBall";
    00136       case releaseCaughtBallWhenTurningLeft: return "releaseCaughtBallWhenTurningLeft";
    00137       case releaseCaughtBallWhenTurningRight: return "releaseCaughtBallWhenTurningRight";
    00138       case stayAsForced: return "stayAsForced";
    00139       case lookToStars: return "lookToStars";
    00140       case snapAtFinger: return "snapAtFinger";
    00141       case lookParallelToGround: return "lookParallelToGround";
    00142       case lookTowardOpponentGoal: return "lookTowardOpponentGoal";
    00143       case directedScanForLandmarks: return "directedScanForLandmarks";
    00144       case directedScanForObstacles: return "directedScanForObstacles";
    00145
    00146       case direct: return "direct";
    00147       case calibrate: return "calibrate";
    00148       case calibrateHeadSpeed: return "calibrateHeadSpeed";
    00149       case watchOrigin: return "watchOrigin";
    00150
    00151       case openChallengePullBridge: return "openChallengePullBridge";
    00152       case openChallengeTest: return "openChallengeTest";
    00153       case openChallengeTest2: return "openChallengeTest2";
    00154       case openChallengeGoToBridge: return "openChallengeGoToBridge";
    00155       case openChallengeJoysickMode: return "openChallengeJoysickMode";
    00156       case openChallengeReset: return "openChallengeReset";
    00157
    00158       case searchForBallLeft: return "searchForBallLeft";
    00159       case searchForBallRight: return "searchForBallRight";
    00160
    00161       case lookAtInsertionPointBackLeft: return "lookAtInsertionPointBackLeft";
    00162       case lookAtInsertionPointBackRight: return "lookAtInsertionPointBackRight";
    00163       case lookAtInsertionPointMiddleLeft: return "lookAtInsertionPointMiddleLeft";
    00164       case lookAtInsertionPointMiddleRight: return "lookAtInsertionPointMiddleRight";
    00165       case lookAtInsertionPointFrontLeft: return "lookAtInsertionPointFrontLeft";
    00166       case lookAtInsertionPointFrontRight: return "lookAtInsertionPointFrontRight";
    00167       case lookAroundPropagatedBallPosition: return "lookAroundPropagatedBallPosition";
    00168       case lookAroundCommunicatedBallPosition: return "lookAroundCommunicatedBallPosition";
    00169
    00170       case searchForLandmarksEvolution: return "searchForLandmarksEvolution";
    00171       case realSlowScan: return "realSlowScan";
    00172
    00173       default:return "unknown Mode";
    00174     }
    00175   }
    00176
    00177   /** Parameters for direct mode */
    00178   long directTilt, directPan, directRoll, directSpeed, directMouth;
    00179   unsigned int durationInEvolution;
    00180 };
    00181
    00182 #endif //__HeadControlMode_h_