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 00020 00021 /** 00022 * Stores head modes requested by BehaviorControl 00023 */ 00024 class HeadControlMode 00025 { 00026 public: 00027 /** constructor */ 00028 HeadControlMode(); 00029 00030 /** destructor */ 00031 ~HeadControlMode(); 00032 00033 /** possible head control modes */ 00034 enum HeadControlModes 00035 { 00036 none, 00037 searchForBall, 00038 searchAuto, 00039 searchForLandmarks, 00040 searchForLandmarksHeadLow, 00041 lookBetweenFeet, 00042 lookLeft, 00043 lookRight, 00044 lookStraightAhead, 00045 catchBall, 00046 releaseCaughtBallWhenTurningLeft, 00047 releaseCaughtBallWhenTurningRight, 00048 stayAsForced, 00049 lookToStars, 00050 lookParallelToGround, 00051 lookTowardOpponentGoal, 00052 00053 direct, 00054 calibrate, 00055 calibrateHeadSpeed, 00056 watchOrigin, 00057 00058 openChallengePullBridge, 00059 openChallengeCheckBite, 00060 openChallengeTest, 00061 openChallengeTest2, 00062 openChallengeGoToBridge, 00063 openChallengeJoysickMode, 00064 openChallengeReset, 00065 openChallengeLookAtRedLineStart, 00066 00067 searchForBallLeft, 00068 searchForBallRight, 00069 00070 numOfHeadControlModes 00071 }; 00072 00073 /** The requested head control mode */ 00074 HeadControlModes headControlMode; 00075 00076 /** Returns the name of a HeadTrackMode. */ 00077 static const char* getHeadControlModeName(HeadControlModes mode) 00078 { 00079 switch(mode) 00080 { 00081 case none: return "none"; 00082 case searchForBall: return "searchForBall"; 00083 case searchAuto: return "searchAuto"; 00084 case searchForLandmarks: return "searchForLandmarks"; 00085 case searchForLandmarksHeadLow: return "searchForLandmarksLow"; 00086 case lookBetweenFeet: return "lookBetweenFeet"; 00087 case lookLeft: return "lookLeft"; 00088 case lookRight: return "lookRight"; 00089 case lookStraightAhead: return "lookStraightAhead"; 00090 case catchBall: return "catchBall"; 00091 case releaseCaughtBallWhenTurningLeft: return "releaseCaughtBallWhenTurningLeft"; 00092 case releaseCaughtBallWhenTurningRight: return "releaseCaughtBallWhenTurningRight"; 00093 case stayAsForced: return "stayAsForced"; 00094 case lookToStars: return "lookToStars"; 00095 case lookParallelToGround: return "lookParallelToGround"; 00096 case lookTowardOpponentGoal: return "lookTowardOpponentGoal"; 00097 00098 case direct: return "direct"; 00099 case calibrate: return "calibrate"; 00100 case calibrateHeadSpeed: return "calibrateHeadSpeed"; 00101 case watchOrigin: return "watchOrigin"; 00102 00103 00104 case openChallengeCheckBite: return "openChallengeCheckBite"; 00105 case openChallengePullBridge: return "openChallengePullBridge"; 00106 case openChallengeTest: return "openChallengeTest"; 00107 case openChallengeTest2: return "openChallengeTest2"; 00108 case openChallengeGoToBridge: return "openChallengeGoToBridge"; 00109 case openChallengeJoysickMode: return "openChallengeJoysickMode"; 00110 case openChallengeReset: return "openChallengeReset"; 00111 case openChallengeLookAtRedLineStart: return "openChallengeLookAtRedLineStart"; 00112 00113 case searchForBallLeft: return "searchForBallLeft"; 00114 case searchForBallRight: return "searchForBallRight"; 00115 default:return "unknown Mode"; 00116 } 00117 } 00118 00119 /** Parameters for direct mode */ 00120 long directTilt, directPan, directRoll, directSpeed, directMouth; 00121 00122 }; 00123 00124 /** 00125 * Streaming operator that reads a HeadControlMode from a stream. 00126 * @param stream The stream from which is read. 00127 * @param headControlMode The HeadControlMode object. 00128 * @return The stream. 00129 */ 00130 In& operator>>(In& stream,HeadControlMode& headControlMode); 00131 00132 /** 00133 * Streaming operator that writes a HeadControlMode to a stream. 00134 * @param stream The stream to write on. 00135 * @param headControlMode The HeadControlMode object. 00136 * @return The stream. 00137 */ 00138 Out& operator<<(Out& stream, const HeadControlMode& headControlMode); 00139 00140 00141 #endif //__HeadControlMode_h_ 00142 00143 /* 00144 * Change log : 00145 * 00146 * $Log: HeadControlMode.h,v $ 00147 * Revision 1.9 2004/08/09 13:51:48 hamerla 00148 * import OpenChallen Behavior to WM 00149 * 00150 * Revision 1.8 2004/07/02 13:24:23 jhoffman 00151 * - scan for landmarks low (so stuff behind the boarders will not be seen!) 00152 * 00153 * Revision 1.7 2004/07/02 10:27:03 jhoffman 00154 * - preparation for compensating robot motions by appropriate head motion (no actual changes) 00155 * - headControl-Mode added for testing 00156 * - look-at-ball-and-closest-landmark uses quicker head movement 00157 * 00158 * Revision 1.6 2004/07/01 18:21:16 dassler 00159 * Added BasicBehavior and HeadControlMode: 00160 * search-for-ball-left 00161 * search-for-ball-right 00162 * Test is needed 00163 * 00164 * Revision 1.5 2004/06/17 14:34:46 dassler 00165 * GT2004HeadControl updated 00166 * Now looks after propergated ball, followed up withe the communicated ball 00167 * GT2004HeadPathPlanner work now with time optimized moves 00168 * Middle Beacons removed of the Landmarkspercept 00169 * 00170 * Revision 1.4 2004/05/29 18:21:27 dueffert 00171 * walk parameter evolution, measurement and calibration stuff ported to GT2004_WM 00172 * 00173 * Revision 1.3 2004/05/26 12:25:24 juengel 00174 * Added release-ball modes. 00175 * 00176 * Revision 1.2 2004/05/23 12:08:26 loetzsch 00177 * clean up in class HeadControlMode 00178 * 00179 * Revision 1.1.1.1 2004/05/22 17:25:17 cvsadm 00180 * created new repository GT2004_WM 00181 * 00182 * Revision 1.15 2004/05/13 21:56:57 hamerla 00183 * OpenChallenge new Headmode 00184 * 00185 * Revision 1.14 2004/05/10 10:28:53 juengel 00186 * Added mode lookToStarsWhenStepIsFinished 00187 * 00188 * Revision 1.13 2004/05/08 16:18:13 hamerla 00189 * Open Challenge 00190 * 00191 * Revision 1.12 2004/05/03 16:32:35 dassler 00192 * automatic timing optimiting 00193 * head calibration 00194 * 00195 * Revision 1.11 2004/04/08 15:33:07 wachter 00196 * GT04 checkin of Microsoft-Hellounds 00197 * 00198 * Revision 1.10 2004/04/07 13:00:47 risler 00199 * ddd checkin after go04 - second part 00200 * 00201 * Revision 1.3 2004/04/01 20:00:36 Marc 00202 * Update getHeadControlModeName 00203 * 00204 * Revision 1.2 2004/04/01 19:54:56 Marc 00205 * Update getHeadControlModeName 00206 * 00207 * Revision 1.1.1.1 2004/03/29 08:28:45 Administrator 00208 * initial transfer from tamara 00209 * 00210 * Revision 1.9 2004/03/18 23:35:43 hodie 00211 * Some tests of the new HeadControlModes 00212 * 00213 * Revision 1.8 2004/03/17 19:54:03 juengel 00214 * Added kickRight and kickLeft. 00215 * 00216 * Revision 1.7 2004/03/17 16:18:49 thomas 00217 * added preversion of motion optimisation with behaviour, selflocator, headcontrol and robotcontrol dialog 00218 * 00219 * Revision 1.6 2004/03/10 07:59:26 roefer 00220 * New head control mode 00221 * 00222 * Revision 1.5 2004/03/04 16:01:49 fritsche 00223 * added BBautoCatchBall to BB2004HeadControl 00224 * 00225 * Revision 1.4 2004/01/16 15:49:15 dueffert 00226 * headControlMode added 00227 * 00228 * Revision 1.3 2004/01/07 04:09:44 richert 00229 * added HeadControlMode "direct" 00230 * 00231 * Revision 1.2 2003/12/05 14:20:06 jhoffman 00232 * removed unused headcontrolmodes 00233 * 00234 * Revision 1.1 2003/10/07 10:07:01 cvsadm 00235 * Created GT2004 (M.J.) 00236 * 00237 * Revision 1.8 2003/09/25 11:23:52 juengel 00238 * Removed BlobCollection. 00239 * 00240 * Revision 1.7 2003/07/07 21:27:39 schumann 00241 * head control bug removed 00242 * 00243 * Revision 1.6 2003/07/07 14:59:35 kudlacik 00244 * Corrected BW-Ball HCM 00245 * 00246 * Revision 1.5 2003/07/07 09:55:15 schumann 00247 * added head control for holding bw-ball 00248 * 00249 * Revision 1.4 2003/07/05 21:36:19 dassler 00250 * Goalie HeadControlMode 00251 * Alle 6 Sek. sich umschauen, wenn Ball weit weg (über der Mittellinie) alle 3 Sek 00252 * 00253 * Revision 1.3 2003/07/03 10:35:59 roefer 00254 * New head control mode search-for-lines 00255 * 00256 * Revision 1.2 2003/07/02 16:47:39 dueffert 00257 * lookAroundWhenBallJustCaught added 00258 * 00259 * Revision 1.1.1.1 2003/07/02 09:40:22 cvsadm 00260 * created new repository for the competitions in Padova from the 00261 * tamara CVS (Tuesday 2:00 pm) 00262 * 00263 * removed unused solutions 00264 * 00265 * Revision 1.14 2003/06/30 11:49:44 schmidt 00266 * Corrected search-for-special-ball 00267 * 00268 * Revision 1.13 2003/06/27 13:17:57 jhoffman 00269 * work on obstacle avoider challenge, 00270 * added headcontrolmode, 00271 * added method needed to determine empty space, 00272 * updatet drawing method to reflect actual corridor size 00273 * 00274 * Revision 1.12 2003/06/19 18:32:33 juengel 00275 * no message 00276 * 00277 * Revision 1.11 2003/05/27 15:23:54 loetzsch 00278 * reordered head control modes 00279 * 00280 * Revision 1.10 2003/04/15 15:52:12 risler 00281 * DDD GO 2003 code integrated 00282 * 00283 * Revision 1.7 2003/04/03 14:48:34 dthomas 00284 * added: new HeadControl searchForLandmarksAndBall 00285 * modified: deactivate debug-output for cont. bas. beh. 00286 * 00287 * Revision 1.9 2003/04/07 20:41:01 juengel 00288 * Added lookAroundWhenBallCaught. 00289 * 00290 * Revision 1.8 2003/04/04 15:32:41 jhoffman 00291 * added "scanMid.." 00292 * 00293 * Revision 1.7 2003/04/03 21:07:52 jhoffman 00294 * added "look at ball only" 00295 * 00296 * Revision 1.6 2003/04/01 17:49:10 roefer 00297 * Head control mode catchBall added 00298 * 00299 * Revision 1.5 2003/03/15 22:27:45 juengel 00300 * Added HeadControlMode searchForObstacles. 00301 * 00302 * Revision 1.4 2003/01/09 14:06:52 jhoffman 00303 * added "lookjustbelowhorizon" 00304 * 00305 * Revision 1.3 2002/12/06 10:52:05 kallnik 00306 * Fuzzy Vision 00307 * 00308 * neuer Headcontrol Mode der so schaut, daß für das Weltbild ein möglichst großer Nutzen entsteht 00309 * Doku folgt 00310 * 00311 * Revision 1.2 2002/09/22 18:40:54 risler 00312 * added new math functions, removed GTMath library 00313 * 00314 * Revision 1.1 2002/09/10 15:26:40 cvsadm 00315 * Created new project GT2003 (M.L.) 00316 * - Cleaned up the /Src/DataTypes directory 00317 * - Removed Challenge Code 00318 * - Removed processing of incoming audio data 00319 * - Renamed AcousticMessage to SoundRequest 00320 * 00321 * Revision 1.17 2002/09/03 16:00:59 juengel 00322 * HeadControlMode follwTail, TailMode stayAsForced. 00323 * 00324 * Revision 1.16 2002/08/22 14:41:03 risler 00325 * added some doxygen comments 00326 * 00327 * Revision 1.15 2002/07/23 13:32:57 loetzsch 00328 * new streaming classes 00329 * 00330 * removed many #include statements 00331 * 00332 * Revision 1.14 2002/06/21 13:28:58 risler 00333 * bar challenge stuff 00334 * 00335 * Revision 1.13 2002/06/20 04:44:52 juengel 00336 * Added HeadControlMode lookAtNextTwoLandmarks. 00337 * 00338 * Revision 1.12 2002/06/17 18:28:22 loetzsch 00339 * added head control mode search-auto 00340 * 00341 * Revision 1.11 2002/06/17 17:18:40 juengel 00342 * Added headControlMode searchForLandmarksInFrontOfRobot. 00343 * 00344 * Revision 1.10 2002/06/13 08:59:50 risler 00345 * head control mode for bar challenge 00346 * 00347 * Revision 1.9 2002/06/12 19:10:48 dueffert 00348 * exactLookAtPoint added 00349 * 00350 * Revision 1.8 2002/06/12 17:54:55 juengel 00351 * Added HeadControlModes searchForLandmarksInCorner and lookAtBallAndNextLandmark. 00352 * 00353 * Revision 1.7 2002/06/08 18:11:28 jhoffman 00354 * added "simple-look-at-point" head control 00355 * 00356 * Revision 1.6 2002/06/04 11:13:26 juengel 00357 * Added HeadControlMode lookAtVisiblePatterns 00358 * 00359 * Revision 1.5 2002/05/27 10:30:19 kosen 00360 * searchForMultipleBalls added 00361 * 00362 * Revision 1.4 2002/05/25 17:37:03 juengel 00363 * 3D and offset for lookAtPoint 00364 * 00365 * Revision 1.3 2002/05/16 09:34:26 kosen 00366 * no message 00367 * 00368 * Revision 1.2 2002/05/15 08:01:37 kosen 00369 * offset in lookAtPoint added 00370 * 00371 * Revision 1.1.1.1 2002/05/10 12:40:13 cvsadm 00372 * Moved GT2002 Project from ute to tamara. 00373 * 00374 * Revision 1.21 2002/05/03 11:49:24 juengel 00375 * GT2002HeadControl created. 00376 * 00377 * Revision 1.20 2002/04/23 10:38:30 risler 00378 * renamed headOdometry to headState 00379 * 00380 * Revision 1.19 2002/04/18 10:25:31 roefer 00381 * Bremen GO 00382 * 00383 * Revision 1.18 2002/04/17 17:04:40 risler 00384 * Darmstadt GO 00385 * 00386 * Revision 1.17 2002/04/17 12:07:35 juengel 00387 * Removed new versions of searchAuto searchForLandmarks and SearchForBall 00388 * 00389 * Revision 1.16 2002/04/16 16:18:31 dueffert 00390 * no message 00391 * 00392 * Revision 1.2 2002/04/11 23:29:38 loetzsch 00393 * added head-control-mode searchForBallWhileDribbling 00394 * 00395 * Revision 1.15 2002/04/09 14:18:29 juengel 00396 * version 2 of some modes 00397 * 00398 * Revision 1.14 2002/03/20 15:15:51 kosen 00399 * lookAtPoint added 00400 * 00401 * Revision 1.13 2002/02/15 15:06:38 kosen 00402 * trackModes in searchModes changes 00403 * 00404 * Revision 1.12 2002/02/12 12:53:12 kosen 00405 * searchLeft and searchRight added 00406 * 00407 * Revision 1.11 2002/02/01 20:44:41 kosen 00408 * changes trackOnlyBall to trackForBall 00409 * 00410 * Revision 1.10 2002/01/23 23:25:32 roefer 00411 * SimGT2002 console now accepts input 00412 * 00413 * Revision 1.9 2002/01/19 21:36:27 risler 00414 * added HeadMotionTester, HeadControlSelector 00415 * 00416 * Revision 1.8 2002/01/18 13:34:36 risler 00417 * enum style 00418 * 00419 * Revision 1.7 2002/01/18 13:29:51 risler 00420 * removed trackNothing 00421 * 00422 * Revision 1.6 2002/01/06 13:49:55 juengel 00423 * HeadControlModes lookStraihtAhead und stayAsForced eingeführt. 00424 * 00425 * Revision 1.5 2001/12/10 17:47:05 risler 00426 * change log added 00427 * 00428 */