00001 /** 00002 * @file BehaviorControlSelector.h 00003 * 00004 * Definition of class BehaviorControlSelector 00005 * 00006 * @author Max Risler 00007 * @author Martin Lötzsch 00008 * @author Matthias Jüngel 00009 */ 00010 00011 #ifndef __BehaviorControlSelector_h_ 00012 #define __BehaviorControlSelector_h_ 00013 00014 #include "Tools/Module/ModuleSelector.h" 00015 00016 #include "BehaviorControl.h" 00017 #include "GT2004BehaviorControl/GT2004BehaviorControl.h" 00018 00019 /** 00020 * BehaviorControl selection module. 00021 * 00022 * A selector for behavior control modules. 00023 */ 00024 class BehaviorControlSelector : public ModuleSelector, public BehaviorControlInterfaces 00025 { 00026 public: 00027 /** 00028 * Constructor. 00029 * @param handler The module handler of the process. 00030 * @param interfaces The paramters of the BehaviorControl module. 00031 */ 00032 BehaviorControlSelector(ModuleHandler &handler, const BehaviorControlInterfaces& interfaces) 00033 : ModuleSelector(SolutionRequest::behaviorControl), 00034 BehaviorControlInterfaces(interfaces) 00035 { 00036 handler.setModuleSelector(SolutionRequest::behaviorControl, this); 00037 } 00038 00039 00040 /** 00041 * Is called on start and when the selected solution changes 00042 * to create a specific solution. 00043 * @param id The id of the solution to create 00044 * @return The created solution or 0 00045 */ 00046 virtual Module* createSolution(SolutionRequest::ModuleSolutionID id) 00047 { 00048 switch(id) 00049 { 00050 case SolutionRequest::gt2004BehaviorControlAgentSoccer: 00051 return new Xabsl2BehaviorControlAgentInterface("soccer",new GT2004BehaviorControl(*this),*this); 00052 00053 case SolutionRequest::gt2004BehaviorControlAgentPenaltyShooter: 00054 return new Xabsl2BehaviorControlAgentInterface("penalty-shooter",new GT2004BehaviorControl(*this),*this); 00055 00056 case SolutionRequest::gt2004BehaviorControlAgentJoystickControlled: 00057 return new Xabsl2BehaviorControlAgentInterface("joystick-controlled",new GT2004BehaviorControl(*this),*this); 00058 00059 case SolutionRequest::gt2004BehaviorControlAgentOpenChallenge: 00060 return new Xabsl2BehaviorControlAgentInterface("open-challenge",new GT2004BehaviorControl(*this),*this); 00061 00062 default: 00063 return 0; 00064 } 00065 } 00066 00067 }; 00068 00069 #endif // __BehaviorControlSelector_h_ 00070 00071 /* 00072 * Change log : 00073 * 00074 * $Log: BehaviorControlSelector.h,v $ 00075 * Revision 1.7 2004/07/20 20:45:39 spranger 00076 * removed challenge and unused agents 00077 * 00078 * Revision 1.6 2004/06/27 17:41:01 goetzke 00079 * Added penalty-shooter. 00080 * 00081 * Revision 1.5 2004/06/19 12:17:35 juengel 00082 * Added agents for slam and lighting challenge. 00083 * 00084 * Revision 1.4 2004/05/28 17:52:50 thomas 00085 * added behavior-solution joystick-controlled 00086 * 00087 * Revision 1.3 2004/05/25 16:53:46 loetzsch 00088 * added agent pass test 00089 * 00090 * Revision 1.2 2004/05/22 18:23:46 juengel 00091 * Removed *GO2004BehaviorControls. 00092 * 00093 * Revision 1.1.1.1 2004/05/22 17:15:30 cvsadm 00094 * created new repository GT2004_WM 00095 * 00096 * Revision 1.33 2004/05/14 11:37:08 loetzsch 00097 * support for multiple xabsl2engines in different modules 00098 * preliminary GT2004HeadControl (does not work at all) 00099 * 00100 * Revision 1.32 2004/05/06 15:40:17 loetzsch 00101 * yet another demo agent 00102 * 00103 * Revision 1.31 2004/05/05 21:47:13 kerdels 00104 * added agent for the open challenge 00105 * 00106 * Revision 1.30 2004/05/02 13:34:26 juengel 00107 * Added GT2004BehaviorControl. 00108 * 00109 * Revision 1.29 2004/04/27 11:23:23 loetzsch 00110 * preliminary passing experiments 00111 * 00112 * Revision 1.28 2004/04/26 15:58:59 thomas 00113 * added new project RobotRemote based on ATHAiboControl 00114 * 00115 * Revision 1.27 2004/04/08 15:33:00 wachter 00116 * GT04 checkin of Microsoft-Hellounds 00117 * 00118 * Revision 1.26 2004/04/07 13:25:43 thomas 00119 * ddd checkin after go04 - second part fixed solutions 00120 * 00121 * Revision 1.24 2004/03/17 16:18:49 thomas 00122 * added preversion of motion optimisation with behaviour, selflocator, headcontrol and robotcontrol dialog 00123 * 00124 * Revision 1.23 2004/03/16 14:00:17 juengel 00125 * Integrated Improvments from "Günne" 00126 * -ATH2004ERS7Behavior 00127 * -ATHHeadControl 00128 * -KickSelectionTable 00129 * -KickEditor 00130 * 00131 * Revision 1.22 2004/03/08 00:58:52 roefer 00132 * Interfaces should be const 00133 * 00134 * Revision 1.3 2004/03/16 08:34:25 loetzsch 00135 * moved agent kick-test from ATH2004 to ATH2004ERS7 00136 * 00137 * Revision 1.2 2004/03/06 18:31:21 loetzsch 00138 * cloned ATH2004BehaviorControl into ATH2004ERS7BehaviorControl 00139 * 00140 * Revision 1.1.1.1 2004/03/05 10:10:11 loetzsch 00141 * created local cvs for Günne 00142 * 00143 * Revision 1.21 2004/02/26 18:07:27 cesarz 00144 * first version of evolution behavior 00145 * 00146 * Revision 1.20 2004/02/23 12:52:57 schumann 00147 * added MSH2004KickEngine 00148 * 00149 * Revision 1.19 2004/02/16 00:52:56 rempe 00150 * agent for developing another goalie 00151 * 00152 * Revision 1.18 2004/02/10 17:51:54 goetzke 00153 * added pass-player 00154 * 00155 * Revision 1.17 2004/02/08 10:43:19 witzmann 00156 * <!DOCTYPE symbol-and-basic-behavior-files SYSTEM "../symbol-and-basic-behavior-files.dtd"> 00157 * 00158 * Revision 1.16 2004/02/05 14:22:14 spranger 00159 * added intercept-tester agent 00160 * 00161 * Revision 1.15 2004/02/05 10:31:44 juengel 00162 * tags added 00163 * 00164 * Revision 1.14 2004/01/24 14:55:29 loetzsch 00165 * created ATH AiboControl 00166 * 00167 * Revision 1.13 2004/01/21 14:31:58 loetzsch 00168 * Module Selectors create only the selected solution. 00169 * When the solution changes, the old solution is erased and the new 00170 * one ist created using createSolution(..) 00171 * 00172 * Revision 1.12 2004/01/08 13:53:37 loetzsch 00173 * new kick test behaviors 00174 * 00175 * Revision 1.11 2004/01/06 17:49:41 sombrutz 00176 * added another-goalie (Dirk Rempe (rempe@informatik.hu-berlin.de) , Robert Sombrutzki (sombrutz@informatik.hu-berlin.de), Erik Witzmann) 00177 * 00178 * Revision 1.10 2003/12/19 01:14:14 kerdels 00179 * agent added 00180 * 00181 * Revision 1.9 2003/12/11 16:18:42 risler 00182 * added agent DDD2004-demo 00183 * 00184 * Revision 1.8 2003/12/11 11:25:59 seva 00185 * Added penalty-shooter-union and penalty-shooter-hertha. 00186 * 00187 * Revision 1.7 2003/11/03 20:12:19 juengel 00188 * Added ath-percept-tester 00189 * 00190 * Revision 1.6 2003/10/27 13:27:03 wachter 00191 * Added agent for glass-box demo. 00192 * 00193 * Revision 1.5 2003/10/26 22:49:34 loetzsch 00194 * created ATH2004BehaviorControl from GT2003BehaviorControl 00195 * - strongly simplified option graph 00196 * - moved some symbols from GT2003 to CommonXabsl2Symbols 00197 * - moved some basic behaviors from GT2003 to CommonXabsl2BasicBehaviors 00198 * 00199 * cloned ATH2004 three times (BB2004, DDD2004, MSH2004) 00200 * 00201 * Revision 1.4 2003/10/22 22:18:44 loetzsch 00202 * prepared the cloning of the GT2003BehaviorControl 00203 * 00204 * Revision 1.3 2003/07/30 14:50:43 dueffert 00205 * walk evolution agent added 00206 * 00207 * Revision 1.2 2003/07/07 22:45:34 thomas 00208 * added: frame for penalty-shooter agent 00209 * 00210 * Revision 1.1.1.1 2003/07/02 09:40:23 cvsadm 00211 * created new repository for the competitions in Padova from the 00212 * tamara CVS (Tuesday 2:00 pm) 00213 * 00214 * removed unused solutions 00215 * 00216 * Revision 1.38 2003/06/23 13:36:38 loetzsch 00217 * renamed GT2003 Agent turn-and-kick-test to kick-test 00218 * 00219 * Revision 1.37 2003/06/13 17:03:47 juengel 00220 * Added challenge agents and options. 00221 * 00222 * Revision 1.36 2003/06/06 10:55:19 dueffert 00223 * demo agent added 00224 * 00225 * Revision 1.35 2003/06/02 09:07:49 loetzsch 00226 * added option turn-and-kick and agent turn-and-kick-test 00227 * 00228 * Revision 1.34 2003/05/27 15:32:06 loetzsch 00229 * added agent manual-kick 00230 * 00231 * Revision 1.33 2003/05/27 06:54:08 thiel 00232 * re-enabled Ruhrpott-Hellhounds-Behavior-Control 00233 * 00234 * Revision 1.32 2003/05/26 16:35:38 thiel 00235 * temporarily disabled Ruhrpott-Hellhounds-Behavior-Control 00236 * 00237 * Revision 1.31 2003/05/15 15:24:37 risler 00238 * added agent obstacle-avoider 00239 * 00240 * Revision 1.30 2003/05/06 16:02:31 loetzsch 00241 * added agent free-part-of-opponent-goal-test 00242 * 00243 * Revision 1.29 2003/05/06 13:54:22 pruente 00244 * added collective-soccer agent 00245 * 00246 * Revision 1.28 2003/05/03 15:14:02 loetzsch 00247 * GT2003BehaviorControl first draft 00248 * 00249 * Revision 1.27 2003/04/16 14:01:30 loetzsch 00250 * removed Xabsl 1 from GT2003 00251 * 00252 * Revision 1.26 2003/04/15 17:19:43 risler 00253 * moved DDDGO2003 ImageProcessor to own module 00254 * removed ContinuousBasicBehaviorTester 00255 * 00256 * Revision 1.25 2003/04/15 15:52:12 risler 00257 * DDD GO 2003 code integrated 00258 * 00259 * Revision 1.21 2003/04/09 16:22:55 max 00260 * added continuous-test agent 00261 * 00262 * Revision 1.19 2003/04/05 17:02:41 max 00263 * added localization-test agent 00264 * added tailcontrol option 00265 * 00266 * Revision 1.24 2003/04/14 16:14:13 loetzsch 00267 * ATH after GermanOpen CVS merge 00268 * added penalty player 00269 * 00270 * Revision 1.23 2003/04/06 20:59:13 roefer 00271 * BremenByters behavior reenabled. If robot crashes, rebuild all! 00272 * 00273 * Revision 1.22 2003/04/03 16:49:19 loetzsch 00274 * BremenByters wieder auskommentiert 00275 * 00276 * Revision 1.21 2003/04/03 15:47:55 tim 00277 * BremenByters wieder einkommentiert 00278 * 00279 * Revision 1.20 2003/04/03 12:27:41 schumann 00280 * Bremen auskommentiert. Siehe Newsgroup (Verhalten). 00281 * 00282 * Revision 1.19 2003/04/02 16:38:19 cesarz 00283 * merged local and tamara files 00284 * 00285 * Revision 1.18 2003/03/30 14:10:35 juengel 00286 * Added BarCodeSwitcher 00287 * 00288 * Revision 1.17 2003/03/12 12:14:12 risler 00289 * added DDD-walk-test 00290 * 00291 * Revision 1.16 2003/03/04 14:30:06 kallnik 00292 * continuousbasicbehvior: bug fixes 00293 * 00294 * Revision 1.15 2003/02/28 15:03:58 loetzsch 00295 * temporarily removed creation of RuhrpottHellhoundsBehaviorControl, 00296 * it produced too much memory leaks. (more than 200) 00297 * 00298 * Revision 1.14 2003/02/25 11:51:15 loetzsch 00299 * no message 00300 * 00301 * Revision 1.13 2003/02/24 14:48:17 kallnik 00302 * some bugs in continuousbasicbehaviors fixed 00303 * 00304 * Revision 1.12 2003/02/20 13:22:00 kallnik 00305 * error correction 00306 * 00307 * Revision 1.11 2003/02/20 12:40:24 kallnik 00308 * added continuousBasicBehaviorTester in behaviorSelector 00309 * 00310 * Revision 1.10 2003/02/07 16:40:50 dueffert 00311 * Bombay stuff added after cleanup 00312 * 00313 * Revision 1.9 2003/01/23 15:22:17 dueffert 00314 * new xabsl2 agent added 00315 * 00316 * Revision 1.8 2003/01/21 18:10:12 risler 00317 * added agent simple-follow-ball 00318 * 00319 * Revision 1.7 2003/01/20 12:19:58 juengel 00320 * Added BremenBytersBehaviorControl 00321 * and RuhrpottHellhoundsBehaviorControl. 00322 * 00323 * Revision 1.6 2003/01/19 22:57:09 loetzsch 00324 * cloned Humboldt2003BehaviorControl to 00325 * DarmstadtDribblingDackelsBehaviorControl 00326 * 00327 * Revision 1.5 2003/01/19 13:04:51 loetzsch 00328 * xabsl2 agents now can be changed by using the Module and SolutionRequest 00329 * mechanism 00330 * 00331 * Revision 1.4 2002/11/30 19:11:43 juengel 00332 * Moved BehaviorControl solution Xabsl2Berlin to Humboldt2003. 00333 * 00334 * Revision 1.3 2002/11/18 17:16:29 loetzsch 00335 * Added a new BehaviorControl solution: Xabsl2BerlinBehaviorControl 00336 * When it works, it shall be cloned to the BehaviorControl solutions for 00337 * the other univiersities 00338 * 00339 * Revision 1.2 2002/09/12 12:24:10 juengel 00340 * continued change of module/solution mechanisms 00341 * 00342 * Revision 1.1 2002/09/10 15:36:12 cvsadm 00343 * Created new project GT2003 (M.L.) 00344 * - Cleaned up the /Src/DataTypes directory 00345 * - Removed challenge related source code 00346 * - Removed processing of incoming audio data 00347 * - Renamed AcousticMessage to SoundRequest 00348 * 00349 * Revision 1.9 2002/08/28 12:37:37 petters 00350 * TUDXMLBehavior moved to /src/modules/behaviorcontrol/tudxmlbehavior 00351 * 00352 * Revision 1.8 2002/08/22 14:41:04 risler 00353 * added some doxygen comments 00354 * 00355 * Revision 1.7 2002/08/21 11:50:44 cesarz 00356 * GT2001PlayersPerceptor, BerlinSelfLocator, GT2001WalkingEngine, 00357 * DoWalkingEngine, FuzzyBehaviorControl, BremenGOBehaviorControl, 00358 * FuzzyBehaviortesterdlgbar and Behaviortesterdlgbar removed. 00359 * 00360 * Revision 1.6 2002/07/23 13:33:40 loetzsch 00361 * new streaming classes 00362 * 00363 * removed many #include statements 00364 * 00365 * Revision 1.5 2002/06/20 00:40:20 Thomas Röfer 00366 * WLan crash removed 00367 * 00368 * Revision 1.4 2002/06/09 15:24:51 loetzsch 00369 * Added TeamMessageCollection and BehaviorTeamMessage to the execute of BehaviorControl 00370 * 00371 * Revision 1.3 2002/05/16 13:29:44 tim 00372 * Added BallChallengeBehavior 00373 * 00374 * Revision 1.2 2002/05/10 17:29:01 juengel 00375 * Added SpecialVision and SpecialPercept. 00376 * 00377 * Revision 1.16 2002/05/05 18:52:01 loetzsch 00378 * added 00379 * - GameControlData, 00380 * - Receivers for GameControlData 00381 * - access by behavior to GameControlData 00382 * 00383 * Revision 1.15 2002/05/04 12:43:37 loetzsch 00384 * The currently executed MotionRequest is now sent from the MotionControl 00385 * to the BehaviorControl via the OdometryData structure 00386 * 00387 * Revision 1.14 2002/05/03 15:03:29 loetzsch 00388 * removed berlinGT2002BehaviorControl 00389 * 00390 * Revision 1.13 2002/04/28 19:15:14 giese 00391 * SoundPlay added... 00392 * 00393 * Revision 1.12 2002/04/17 17:04:19 risler 00394 * Darmstadt GO 00395 * 00396 * Revision 1.11 2002/03/28 17:45:11 loetzsch 00397 * renamed BerlinGermanOpenBehaviorControl to XabslBehaviorControl 00398 * 00399 * Revision 1.10 2002/03/25 09:23:46 rentmeister 00400 * Behavior Dialog 00401 * 00402 * Revision 1.9 2002/03/23 16:16:54 tim 00403 * Moved BremenGOBehavior 00404 * 00405 * Revision 1.8 2002/03/21 15:18:30 koehlerj 00406 * Add BremenGermanOpenBehaviorControl 00407 * 00408 * Revision 1.7 2002/03/11 12:51:00 loetzsch 00409 * BerlinGermanOpenBehaviorControl added 00410 * 00411 * Revision 1.6 2002/02/12 16:06:37 fischer 00412 * Added FuzzyBehaviorControl. 00413 * 00414 * Revision 1.5 2002/02/05 22:41:25 risler 00415 * SimpleRunToBall added 00416 * 00417 * Revision 1.4 2002/01/20 13:00:18 risler 00418 * changed implementation of selecting default solution 00419 * 00420 * Revision 1.3 2002/01/18 14:03:51 risler 00421 * BehaviorControlSelector added 00422 * 00423 */