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

# Modules/BehaviorControl/GT2005BehaviorControl/GT2005BasicBehaviors/GT2005SimpleBasicBehaviors.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GT2005SimpleBasicBehaviors.h
    00003 *
    00004 * Declaration of basic behaviors defined in simple-basic-behaviors.xml.
    00005 *
    00006 * @author Uwe Düffert
    00007 * @author Jan Hoffmann
    00008 * @author Matthias Jüngel
    00009 * @author Martin Lötzsch
    00010 * @author Max Risler
    00011 */
    00012
    00013 #ifndef __GT2005SimpleBasicBehaviors_h_
    00014 #define __GT2005SimpleBasicBehaviors_h_
    00015
    00016 #include "../../BehaviorControl.h"
    00017 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
    00018 #include "Tools/Actorics/WalkAccelerationRestrictor.h"
    00019 #include "Tools/Math/PIDsmoothedValue.h"
    00020
    00021
    00022
    00023 /**
    00024 * A Basic Behavior for going to the ball
    00025 * @author Matthias Jüngel
    00026 * @author Martin Lötzsch
    00027 * @author Jan Hoffmann
    00028 */
    00029 class GT2005BasicBehaviorNewGoToBall : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00030 {
    00031 public:
    00032 /*
    00033 * Constructor.
    00034 * @param errorHandler Is invoked when errors occur
    00035 * @param interfaces The paramters of the BehaviorControl module.
    00036   */
    00037   GT2005BasicBehaviorNewGoToBall(BehaviorControlInterfaces& interfaces,
    00038     Xabsl2ErrorHandler& errorHandler)
    00039     : Xabsl2BasicBehavior("new-go-to-ball", errorHandler),
    00040     BehaviorControlInterfaces(interfaces),
    00041     accelerationRestrictor(motionRequest)
    00042   {
    00043     registerParameter("new-go-to-ball.distance",distanceAtEnd);
    00044     registerParameter("new-go-to-ball.max-speed", maxSpeed);
    00045     registerParameter("new-go-to-ball.max-speed.y", maxSpeedY);
    00046     registerParameter("new-go-to-ball.max-turn-speed", maxTurnSpeed);
    00047     registerParameter("new-go-to-ball.angle-factor", angleFactor);
    00048     registerParameter("new-go-to-ball.y-offset", yOffset);
    00049     registerParameter("new-go-to-ball.walk-type", walkType);
    00050     registerParameter("new-go-to-ball.slow-down-distance", slowDownDistance);
    00051   }
    00052
    00053   /**  Executes the basic behavior. */
    00054   virtual void execute();
    00055
    00056 private:
    00057   /** parameter "go-to-ball.distance" */
    00058   double distanceAtEnd;
    00059
    00060   /** parameter "go-to-ball.max-speed" */
    00061   double maxSpeed;
    00062
    00063   /** parameter "go-to-ball.max-speed.y" */
    00064   double maxSpeedY;
    00065
    00066   /** Restricts the walk acceleration to maximum values */
    00067   WalkAccelerationRestrictor accelerationRestrictor;
    00068
    00069   /** parameter "go-to-ball.angle-factor" */
    00070   double angleFactor;
    00071
    00072   /** parameter "go-to-ball.slow-down-distance" */
    00073   double slowDownDistance;
    00074
    00075   /** parameter "go-to-ball.y-offset" */
    00076   double yOffset;
    00077
    00078   /** parameter "walk-type" */
    00079   double walkType;
    00080
    00081   /** parameter "max-turn-speed" */
    00082   double maxTurnSpeed;
    00083 };
    00084
    00085 /**
    00086 * A Basic Behavior for going to the ball
    00087 * @author Martin Lötzsch
    00088 * @author Matthias Jüngel
    00089 * @author Jan Hoffmann
    00090 */
    00091 class GT2005BasicBehaviorGoToBall : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00092 {
    00093 public:
    00094 /*
    00095 * Constructor.
    00096 * @param errorHandler Is invoked when errors occur
    00097 * @param interfaces The paramters of the BehaviorControl module.
    00098   */
    00099   GT2005BasicBehaviorGoToBall(BehaviorControlInterfaces& interfaces,
    00100     Xabsl2ErrorHandler& errorHandler)
    00101     : Xabsl2BasicBehavior("go-to-ball", errorHandler),
    00102     BehaviorControlInterfaces(interfaces),
    00103     accelerationRestrictor(motionRequest)
    00104   {
    00105     registerParameter("go-to-ball.distance",distanceAtEnd);
    00106     registerParameter("go-to-ball.max-speed", maxSpeed);
    00107     registerParameter("go-to-ball.max-speed.y", maxSpeedY);
    00108     registerParameter("go-to-ball.max-turn-speed", maxTurnSpeed);
    00109     registerParameter("go-to-ball.target-angle-to-ball", targetAngleToBall);
    00110     registerParameter("go-to-ball.walk-type", walkType);
    00111     registerParameter("go-to-ball.y-offset", yOffset);
    00112     registerParameter("go-to-ball.slow-down-distance", slowDownDistance);
    00113   }
    00114
    00115   /**  Executes the basic behavior. */
    00116   virtual void execute();
    00117
    00118 private:
    00119   /** parameter "go-to-ball.distance" */
    00120   double distanceAtEnd;
    00121
    00122   /** parameter "go-to-ball.max-speed" */
    00123   double maxSpeed;
    00124
    00125   /** parameter "go-to-ball.max-speed.y" */
    00126   double maxSpeedY;
    00127
    00128   /** Restricts the walk acceleration to maximum values */
    00129   WalkAccelerationRestrictor accelerationRestrictor;
    00130
    00131   /** parameter "go-to-ball.target-angle-to-ball" */
    00132   double targetAngleToBall;
    00133
    00134   /** parameter "go-to-ball.y-offset" */
    00135   double yOffset;
    00136
    00137   /** parameter "walk-type" */
    00138   double walkType;
    00139
    00140   /** parameter "max-turn-speed" */
    00141   double maxTurnSpeed;
    00142
    00143   /** parameter "go-to-ball.slow-down-distance" */
    00144   double slowDownDistance;
    00145
    00146 };
    00147
    00148 class GT2005BasicBehaviorGoToBallPropagated : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00149 {
    00150 public:
    00151 /*
    00152 * Constructor.
    00153 * @param errorHandler Is invoked when errors occur
    00154 * @param interfaces The paramters of the BehaviorControl module.
    00155   */
    00156   GT2005BasicBehaviorGoToBallPropagated(BehaviorControlInterfaces& interfaces,
    00157     Xabsl2ErrorHandler& errorHandler)
    00158     : Xabsl2BasicBehavior("go-to-ball-propagated", errorHandler),
    00159     BehaviorControlInterfaces(interfaces),
    00160     accelerationRestrictor(motionRequest)
    00161   {
    00162     registerParameter("go-to-ball-propagated.distance",distanceAtEnd);
    00163     registerParameter("go-to-ball-propagated.max-speed", maxSpeed);
    00164     registerParameter("go-to-ball-propagated.max-speed.y", maxSpeedY);
    00165     registerParameter("go-to-ball-propagated.max-turn-speed", maxTurnSpeed);
    00166     registerParameter("go-to-ball-propagated.target-angle-to-ball", targetAngleToBall);
    00167     registerParameter("go-to-ball-propagated.walk-type", walkType);
    00168     registerParameter("go-to-ball-propagated.y-offset", yOffset);
    00169   }
    00170
    00171   /**  Executes the basic behavior. */
    00172   virtual void execute();
    00173
    00174 private:
    00175   /** parameter "go-to-ball.distance" */
    00176   double distanceAtEnd;
    00177
    00178   /** parameter "go-to-ball.max-speed" */
    00179   double maxSpeed;
    00180
    00181   /** parameter "go-to-ball.max-speed.y" */
    00182   double maxSpeedY;
    00183
    00184   /** Restricts the walk acceleration to maximum values */
    00185   WalkAccelerationRestrictor accelerationRestrictor;
    00186
    00187   /** parameter "go-to-ball.target-angle-to-ball" */
    00188   double targetAngleToBall;
    00189
    00190   /** parameter "go-to-ball.y-offset" */
    00191   double yOffset;
    00192
    00193   /** parameter "walk-type" */
    00194   double walkType;
    00195
    00196   /** parameter "max-turn-speed" */
    00197   double maxTurnSpeed;
    00198 };
    00199
    00200
    00201 /**
    00202 * A Basic Behavior for clearing the ball
    00203 * @author Michael Spranger
    00204 * @author Matthias Jüngel
    00205 */
    00206 class GT2005BasicBehaviorGoToBallWithoutTurning: public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00207 {
    00208 public:
    00209 /*
    00210 * Constructor.
    00211 * @param errorHandler Is invoked when errors occur
    00212 * @param interfaces The paramters of the BehaviorControl module.
    00213   */
    00214   GT2005BasicBehaviorGoToBallWithoutTurning(BehaviorControlInterfaces& interfaces,
    00215     Xabsl2ErrorHandler& errorHandler)
    00216     : Xabsl2BasicBehavior("go-to-ball-without-turning", errorHandler),
    00217     BehaviorControlInterfaces(interfaces),
    00218     accelerationRestrictor(motionRequest)
    00219   {
    00220     registerParameter("go-to-ball-without-turning.max-speed", maxSpeed);
    00221   }
    00222
    00223   /**  Executes the basic behavior. */
    00224   virtual void execute();
    00225
    00226 private:
    00227   /** parameter "go-to-ball.distance" */
    00228   double distanceAtEnd;
    00229
    00230   /** parameter "go-to-ball.max-speed" */
    00231   double maxSpeed;
    00232
    00233   /** parameter "go-to-ball.max-speed.y" */
    00234   double maxSpeedY;
    00235
    00236   /** Restricts the walk acceleration to maximum values */
    00237   WalkAccelerationRestrictor accelerationRestrictor;
    00238
    00239   /** parameter "go-to-ball.target-angle-to-ball" */
    00240   double targetAngleToBall;
    00241
    00242   /** parameter "go-to-ball.y-offset" */
    00243   double yOffset;
    00244
    00245   /** parameter "walk-type" */
    00246   double walkType;
    00247
    00248   /** parameter "max-turn-speed" */
    00249   double maxTurnSpeed;
    00250 };
    00251
    00252
    00253 /**
    00254 * A Basic Behavior for going to a point on the field
    00255 * @author Uwe Düffert
    00256 * @author Martin Lötzsch
    00257 */
    00258 class GT2005BasicBehaviorGoToPoint : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00259 {
    00260 public:
    00261 /*
    00262 * Constructor.
    00263 * @param errorHandler Is invoked when errors occur
    00264 * @param interfaces The paramters of the BehaviorControl module.
    00265   */
    00266   GT2005BasicBehaviorGoToPoint(BehaviorControlInterfaces& interfaces,
    00267     Xabsl2ErrorHandler& errorHandler)
    00268     : Xabsl2BasicBehavior("go-to-point", errorHandler),
    00269     BehaviorControlInterfaces(interfaces),
    00270     accelerationRestrictor(motionRequest)
    00271   {
    00272     registerParameter("go-to-point.x", x);
    00273     registerParameter("go-to-point.y", y);
    00274     registerParameter("go-to-point.destination-angle", destinationAngle);
    00275     registerParameter("go-to-point.distance-remain", distanceRemain);
    00276     registerParameter("go-to-point.angle-remain", angleRemain);
    00277     registerParameter("go-to-point.max-speed", maxSpeed);
    00278     registerParameter("go-to-point.max-speed.y", maxSpeedY);
    00279     registerParameter("go-to-point.walk-type", walkType);
    00280   }
    00281
    00282   /**  Executes the basic behavior. */
    00283   virtual void execute();
    00284
    00285 protected:
    00286   /** parameter "go-to-point.x" */
    00287   double x;
    00288
    00289   /** parameter "go-to-point.y" */
    00290   double y;
    00291
    00292   /** parameter "go-to-point.destination-angle" */
    00293   double destinationAngle;
    00294
    00295   /** parameter "distance-remain" */
    00296   double distanceRemain;
    00297
    00298   /** parameter "angle-remain" */
    00299   double angleRemain;
    00300
    00301   /** parameter "go-to-point.max-speed" */
    00302   double maxSpeed;
    00303
    00304   /** parameter "go-to-point.max-speed.y" */
    00305   double maxSpeedY;
    00306
    00307   /** parameter "walk-type" */
    00308   double walkType;
    00309
    00310   /** Restricts the walk acceleration to maximum values */
    00311   WalkAccelerationRestrictor accelerationRestrictor;
    00312 };
    00313
    00314 /**
    00315 * A Basic Behavior for going to a point relative to the current position
    00316 * @author
    00317 */
    00318 class GT2005BasicBehaviorGoToRelativePoint : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00319 {
    00320 public:
    00321 /*
    00322 * Constructor.
    00323 * @param errorHandler Is invoked when errors occur
    00324 * @param interfaces The paramters of the BehaviorControl module.
    00325   */
    00326   GT2005BasicBehaviorGoToRelativePoint(BehaviorControlInterfaces& interfaces, Xabsl2ErrorHandler& errorHandler)
    00327     : Xabsl2BasicBehavior("go-to-relative-point", errorHandler),
    00328     BehaviorControlInterfaces(interfaces), accelerationRestrictor(motionRequest)
    00329   {
    00330     registerParameter("go-to-relative-point.x", x);
    00331     registerParameter("go-to-relative-point.y", y);
    00332     registerParameter("go-to-relative-point.destination-angle", destinationAngle);
    00333     registerParameter("go-to-relative-point.distance-remain", distanceRemain);
    00334     registerParameter("go-to-relative-point.angle-remain", angleRemain);
    00335     registerParameter("go-to-relative-point.max-speed", maxSpeed);
    00336     registerParameter("go-to-relative-point.max-speed.y", maxSpeedY);
    00337     registerParameter("go-to-relative-point.walk-type", walkType);
    00338   }
    00339
    00340   /**  Executes the basic behavior. */
    00341   virtual void execute();
    00342
    00343 protected:
    00344   /** parameter "go-to-relative-point.x" */
    00345   double x;
    00346
    00347   /** parameter "go-to-relative-point.y" */
    00348   double y;
    00349
    00350   /** parameter "go-to-relative-point.destination-angle" */
    00351   double destinationAngle;
    00352
    00353   /** parameter "go-to-relative-point.distance-remain" */
    00354   double distanceRemain;
    00355
    00356   /** parameter "go-to-relative-point.angle-remain" */
    00357   double angleRemain;
    00358
    00359   /** parameter "go-to-relative-point.max-speed" */
    00360   double maxSpeed;
    00361
    00362   /** parameter "go-to-relative-point.max-speed.y" */
    00363   double maxSpeedY;
    00364
    00365   /** parameter "go-to-relative-point.walk-type" */
    00366   double walkType;
    00367
    00368   /** Restricts the walk acceleration to maximum values */
    00369   WalkAccelerationRestrictor accelerationRestrictor;
    00370
    00371   double startX;
    00372   double startY;
    00373   double startRot;
    00374 };
    00375
    00376 /**
    00377 * A Basic Behavior for going to a point on the field
    00378 * @author Uwe Düffert
    00379 * @author Martin Lötzsch
    00380 */
    00381 class GT2005BasicBehaviorGoToPointFast : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00382 {
    00383 public:
    00384 /*
    00385 * Constructor.
    00386 * @param errorHandler Is invoked when errors occur
    00387 * @param interfaces The paramters of the BehaviorControl module.
    00388   */
    00389   GT2005BasicBehaviorGoToPointFast(BehaviorControlInterfaces& interfaces,
    00390     Xabsl2ErrorHandler& errorHandler)
    00391   : Xabsl2BasicBehavior("go-to-point-fast", errorHandler),
    00392     BehaviorControlInterfaces(interfaces)
    00393   {
    00394     registerParameter("go-to-point-fast.x", x);
    00395     registerParameter("go-to-point-fast.y", y);
    00396     registerParameter("go-to-point-fast.destination-angle", destinationAngle);
    00397     registerParameter("go-to-point-fast.distance-remain", distanceRemain);
    00398     registerParameter("go-to-point-fast.angle-remain", angleRemain);
    00399     registerParameter("go-to-point-fast.max-speed", maxSpeed);
    00400     registerParameter("go-to-point-fast.max-speed.y", maxSpeedY);
    00401     registerParameter("go-to-point-fast.walk-type", walkType);
    00402   }
    00403
    00404   /**  Executes the basic behavior. */
    00405   virtual void execute();
    00406
    00407 protected:
    00408   /** parameter "go-to-point.x" */
    00409   double x;
    00410
    00411   /** parameter "go-to-point.y" */
    00412   double y;
    00413
    00414   /** parameter "go-to-point.destination-angle" */
    00415   double destinationAngle;
    00416
    00417   /** parameter "distance-remain" */
    00418   double distanceRemain;
    00419
    00420   /** parameter "angle-remain" */
    00421   double angleRemain;
    00422
    00423   /** parameter "go-to-point.max-speed" */
    00424   double maxSpeed;
    00425
    00426   /** parameter "go-to-point.max-speed.y" */
    00427   double maxSpeedY;
    00428
    00429   /** parameter "walk-type" */
    00430   double walkType;
    00431 };
    00432
    00433 /**
    00434 * A Basic Behavior for going to a the ball-interception-point on the field
    00435 * @author Christine Zarges
    00436 * @author Thorsten Kerkhof
    00437 */
    00438 class GT2005BasicBehaviorGoToInterceptionPoint : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00439 {
    00440 public:
    00441 /*
    00442 * Constructor.
    00443 * @param errorHandler Is invoked when errors occur
    00444 * @param interfaces The paramters of the BehaviorControl module.
    00445   */
    00446   GT2005BasicBehaviorGoToInterceptionPoint(BehaviorControlInterfaces& interfaces,
    00447     Xabsl2ErrorHandler& errorHandler)
    00448     : Xabsl2BasicBehavior("go-to-interception-point", errorHandler),
    00449     BehaviorControlInterfaces(interfaces),
    00450     accelerationRestrictor(motionRequest)
    00451   {
    00452     registerParameter("go-to-interception-point.interception-point.x",x);
    00453     registerParameter("go-to-interception-point.interception-point.y",y);
    00454     registerParameter("go-to-interception-point.distance",distanceAtEnd);
    00455     registerParameter("go-to-interception-point.max-speed", maxSpeed);
    00456     registerParameter("go-to-interception-point.max-speed.y", maxSpeedY);
    00457     registerParameter("go-to-interception-point.max-turn-speed", maxTurnSpeed);
    00458     registerParameter("go-to-interception-point.walk-type", walkType);
    00459     registerParameter("go-to-interception-point.y-offset", yOffset);
    00460     registerParameter("go-to-interception-point.slow-down-distance", slowDownDistance);
    00461     registerParameter("go-to-interception-point.angle-factor", angleFactor);
    00462   }
    00463
    00464   /**  Executes the basic behavior. */
    00465   virtual void execute();
    00466
    00467 private:
    00468   /** parameter "interception-point.x" */
    00469   double x;
    00470
    00471   /** parameter "interception-point.y" */
    00472   double y;
    00473
    00474   /** parameter "go-to-ball.distance" */
    00475   double distanceAtEnd;
    00476
    00477   /** parameter "go-to-ball.max-speed" */
    00478   double maxSpeed;
    00479
    00480   /** parameter "go-to-ball.max-speed.y" */
    00481   double maxSpeedY;
    00482
    00483   /** Restricts the walk acceleration to maximum values */
    00484   WalkAccelerationRestrictor accelerationRestrictor;
    00485
    00486   /** parameter "go-to-ball.y-offset" */
    00487   double yOffset;
    00488
    00489   /** parameter "walk-type" */
    00490   double walkType;
    00491
    00492   /** parameter "max-turn-speed" */
    00493   double maxTurnSpeed;
    00494
    00495   /** parameter "go-to-ball.angle-factor" */
    00496   double angleFactor;
    00497
    00498   /** parameter "go-to-ball.slow-down-distance" */
    00499   double slowDownDistance;
    00500 };
    00501
    00502
    00503 /**
    00504 * A Basic Behavior for going turning around a point on the field
    00505 * @author Jan Hoffmann
    00506 */
    00507 class GT2005BasicBehaviorTurnAroundPoint : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00508 {
    00509 public:
    00510 /*
    00511 * Constructor.
    00512 * @param errorHandler Is invoked when errors occur
    00513 * @param interfaces The paramters of the BehaviorControl module.
    00514   */
    00515   GT2005BasicBehaviorTurnAroundPoint(BehaviorControlInterfaces& interfaces,
    00516     Xabsl2ErrorHandler& errorHandler)
    00517     : Xabsl2BasicBehavior("turn-around-point", errorHandler),
    00518     BehaviorControlInterfaces(interfaces),
    00519     accelerationRestrictor(motionRequest)
    00520   {
    00521     registerParameter("turn-around-point.x", x);
    00522     registerParameter("turn-around-point.y", y);
    00523     registerParameter("turn-around-point.radius", radius);
    00524     registerParameter("turn-around-point.left-right", leftRight);
    00525     registerParameter("turn-around-point.forward-component", forwardComponent);
    00526   }
    00527
    00528   /**  Executes the basic behavior. */
    00529   virtual void execute();
    00530
    00531 protected:
    00532   /** parameter "turn-around-point.x" */
    00533   double x;
    00534
    00535   /** parameter "turn-around-point.y" */
    00536   double y;
    00537
    00538   /** parameter "turn-around-point.radius" */
    00539   double radius;
    00540
    00541   /** parameter "go-to-point.left-right" */
    00542   double leftRight;
    00543
    00544   /** parameter "go-to-point.forward-component" */
    00545   double forwardComponent;
    00546
    00547   /** Restricts the walk acceleration to maximum values */
    00548   WalkAccelerationRestrictor accelerationRestrictor;
    00549 };
    00550
    00551 /**
    00552 * A Basic Behavior for going turning around a point on the field
    00553 * @author Jan Hoffmann
    00554 */
    00555 class GT2005BasicBehaviorTurnAroundPointFast : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00556 {
    00557 public:
    00558 /*
    00559 * Constructor.
    00560 * @param errorHandler Is invoked when errors occur
    00561 * @param interfaces The paramters of the BehaviorControl module.
    00562   */
    00563   GT2005BasicBehaviorTurnAroundPointFast(BehaviorControlInterfaces& interfaces,
    00564     Xabsl2ErrorHandler& errorHandler)
    00565     : Xabsl2BasicBehavior("turn-around-point-fast", errorHandler),
    00566     BehaviorControlInterfaces(interfaces),
    00567     accelerationRestrictor(motionRequest)
    00568   {
    00569     registerParameter("turn-around-point-fast.x", x);
    00570     registerParameter("turn-around-point-fast.y", y);
    00571     registerParameter("turn-around-point-fast.radius", radius);
    00572     registerParameter("turn-around-point-fast.left-right", leftRight);
    00573     registerParameter("turn-around-point-fast.forward-component", forwardComponent);
    00574   }
    00575
    00576   /**  Executes the basic behavior. */
    00577   virtual void execute();
    00578
    00579 protected:
    00580   /** parameter "turn-around-point-fast.x" */
    00581   double x;
    00582
    00583   /** parameter "turn-around-point-fast.y" */
    00584   double y;
    00585
    00586   /** parameter "turn-around-point-fast.radius" */
    00587   double radius;
    00588
    00589   /** parameter "turn-around-point-fast.left-right" */
    00590   double leftRight;
    00591
    00592   /** parameter "turn-around-point-fast.forward-component" */
    00593   double forwardComponent;
    00594
    00595   /** Restricts the walk acceleration to maximum values */
    00596   WalkAccelerationRestrictor accelerationRestrictor;
    00597 };
    00598
    00599 /**
    00600 * A Basic Behavior for going turning around a point on the field
    00601 * @author Jan Hoffmann
    00602 */
    00603 class GT2005BasicBehaviorTurnAroundPointWithRadius : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00604 {
    00605 public:
    00606 /*
    00607 * Constructor.
    00608 * @param errorHandler Is invoked when errors occur
    00609 * @param interfaces The paramters of the BehaviorControl module.
    00610   */
    00611   GT2005BasicBehaviorTurnAroundPointWithRadius(BehaviorControlInterfaces& interfaces,
    00612     Xabsl2ErrorHandler& errorHandler)
    00613     : Xabsl2BasicBehavior("turn-around-point-with-radius", errorHandler),
    00614     BehaviorControlInterfaces(interfaces)
    00615   {
    00616     registerParameter("turn-around-point-with-radius.x", x);
    00617     registerParameter("turn-around-point-with-radius.y", y);
    00618     registerParameter("turn-around-point-with-radius.radius", radius);
    00619     registerParameter("turn-around-point-with-radius.left-right", leftRight);
    00620     registerParameter("turn-around-point-with-radius.forward-component", forwardComponent);
    00621   }
    00622
    00623   /**  Executes the basic behavior. */
    00624   virtual void execute();
    00625
    00626 protected:
    00627   /** parameter "turn-around-point.x" */
    00628   double x;
    00629
    00630   /** parameter "turn-around-point.y" */
    00631   double y;
    00632
    00633   /** parameter "turn-around-point.radius" */
    00634   double radius;
    00635
    00636   /** parameter "go-to-point.left-right" */
    00637   double leftRight;
    00638
    00639   /** parameter "go-to-point.forward-component" */
    00640   double forwardComponent;
    00641 };
    00642
    00643
    00644 /** A goalie positioning approach from Benjamin */
    00645 class GT2005BasicBehaviorGoaliePosition : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00646 {
    00647 public:
    00648 /*
    00649 * Constructor.
    00650 * @param errorHandler Is invoked when errors occur
    00651 * @param interfaces The paramters of the BehaviorControl module.
    00652   */
    00653   GT2005BasicBehaviorGoaliePosition(BehaviorControlInterfaces& interfaces,
    00654     Xabsl2ErrorHandler& errorHandler)
    00655     : Xabsl2BasicBehavior("goalie-position", errorHandler),
    00656     BehaviorControlInterfaces(interfaces)
    00657   {
    00658   registerParameter("goalie-position.max-speed", maxSpeed);
    00659   registerParameter("goalie-position.min-x-trans", minXTrans);
    00660   registerParameter("goalie-position.min-y-trans", minYTrans);
    00661   registerParameter("goalie-position.weight-pose", weightPose);
    00662   registerParameter("goalie-position.weight-odo", weightOdo);
    00663   registerParameter("goalie-position.cut-y", cutY);
    00664   registerParameter("goalie-position.guard-direct-to-goal", guardDirectToGoal);
    00665   registerParameter("goalie-position.guard-line", guardLine);
    00666   }
    00667
    00668   /**  Executes the basic behavior. */
    00669   virtual void execute();
    00670
    00671 protected:
    00672
    00673   double maxSpeed;
    00674   double minXTrans;
    00675   double minYTrans;
    00676   double weightPose;
    00677   double weightOdo;
    00678   double cutY;
    00679   double guardDirectToGoal;
    00680   double guardLine;
    00681
    00682   Pose2D lastRobotPose;
    00683   Pose2D lastOdometry;
    00684   Pose2D goaliePose;
    00685   Pose2D lastGoaliePose;
    00686
    00687
    00688 };
    00689
    00690 /**
    00691 * A Basic Behavior for positioning the goalie inside the own goal
    00692 * @author Martin Lötzsch
    00693 */
    00694 class GT2005BasicBehaviorGoaliePositionReturn : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00695 {
    00696 public:
    00697 /*
    00698 * Constructor.
    00699 * @param errorHandler Is invoked when errors occur
    00700 * @param interfaces The paramters of the BehaviorControl module.
    00701   */
    00702   GT2005BasicBehaviorGoaliePositionReturn(BehaviorControlInterfaces& interfaces,
    00703     Xabsl2ErrorHandler& errorHandler)
    00704     : Xabsl2BasicBehavior("goalie-position-return", errorHandler),
    00705     BehaviorControlInterfaces(interfaces),
    00706     accelerationRestrictor(motionRequest)
    00707   {
    00708     registerParameter("goalie-position-return.x", x);
    00709     registerParameter("goalie-position-return.y", y);
    00710     registerParameter("goalie-position-return.destination-angle", destinationAngle);
    00711     registerParameter("goalie-position-return.max-speed", maxSpeed);
    00712   }
    00713
    00714   /**  Executes the basic behavior. */
    00715   virtual void execute();
    00716
    00717 protected:
    00718   /** parameter "goalie-position.x" */
    00719   double x;
    00720
    00721   /** parameter "goalie-position.y" */
    00722   double y;
    00723
    00724   /** parameter "goalie-position.destination-angle" */
    00725   double destinationAngle;
    00726
    00727   /** parameter "goalie-position.max-speed" */
    00728   double maxSpeed;
    00729
    00730   /** Restricts the walk acceleration to maximum values */
    00731   WalkAccelerationRestrictor accelerationRestrictor;
    00732 };
    00733
    00734 /**
    00735 * A Basic Behavior for returning the goalie to the center of its goal
    00736 * @author Tim Laue
    00737 */
    00738 class GT2005BasicBehaviorGoalieReturnToGoal : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00739 {
    00740 public:
    00741 /*
    00742 * Constructor.
    00743 * @param errorHandler Is invoked when errors occur
    00744 * @param interfaces The paramters of the BehaviorControl module.
    00745   */
    00746   GT2005BasicBehaviorGoalieReturnToGoal(BehaviorControlInterfaces& interfaces,
    00747     Xabsl2ErrorHandler& errorHandler)
    00748     : Xabsl2BasicBehavior("goalie-return-to-goal", errorHandler),
    00749     BehaviorControlInterfaces(interfaces),
    00750     accelerationRestrictor(motionRequest)
    00751   {
    00752     registerParameter("goalie-return-to-goal.x", x);
    00753     registerParameter("goalie-return-to-goal.y", y);
    00754     registerParameter("goalie-return-to-goal.max-speed", maxSpeed);
    00755   }
    00756
    00757   /**  Executes the basic behavior. */
    00758   virtual void execute();
    00759
    00760 protected:
    00761   /** parameter "goalie-return-to-goal.x" */
    00762   double x;
    00763
    00764   /** parameter "goalie-return-to-goal.y" */
    00765   double y;
    00766
    00767   /** parameter "goalie-return-to-goal.max-speed" */
    00768   double maxSpeed;
    00769
    00770   /** Restricts the walk acceleration to maximum values */
    00771   WalkAccelerationRestrictor accelerationRestrictor;
    00772 };
    00773
    00774 /**
    00775 * A Basic Behavior for going to a point on the field facing forward
    00776 * @author Uwe Düffert
    00777 * @author Martin Lötzsch
    00778 */
    00779 class GT2005BasicBehaviorGoForwardToPoint : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00780 {
    00781 public:
    00782 /*
    00783 * Constructor.
    00784 * @param errorHandler Is invoked when errors occur
    00785 * @param interfaces The paramters of the BehaviorControl module.
    00786   */
    00787   GT2005BasicBehaviorGoForwardToPoint(BehaviorControlInterfaces& interfaces,
    00788     Xabsl2ErrorHandler& errorHandler)
    00789     : Xabsl2BasicBehavior("go-forward-to-point", errorHandler),
    00790     BehaviorControlInterfaces(interfaces),
    00791     accelerationRestrictor(motionRequest)
    00792   {
    00793     registerParameter("go-forward-to-point.x", x);
    00794     registerParameter("go-forward-to-point.y", y);
    00795     registerParameter("go-forward-to-point.max-speed", maxSpeed);
    00796   }
    00797
    00798   /**  Executes the basic behavior. */
    00799   virtual void execute();
    00800
    00801 protected:
    00802   /** parameter "go-forward-to-point.x" */
    00803   double x;
    00804
    00805   /** parameter "go-forward-to-point.y" */
    00806   double y;
    00807
    00808   /** parameter "go-forward-to-point.max-speed" */
    00809   double maxSpeed;
    00810
    00811   /** Restricts the walk acceleration to maximum values */
    00812   WalkAccelerationRestrictor accelerationRestrictor;
    00813 };
    00814
    00815 /**
    00816 * A Basic Behavior for going to a point on the field and avoiding obstacles on the way there.
    00817 * @author Jan Hoffmann
    00818 */
    00819 class GT2005BasicBehaviorGoToPointAndAvoidObstacles : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00820 {
    00821 public:
    00822 /*
    00823 * Constructor.
    00824 * @param errorHandler Is invoked when errors occur
    00825 * @param interfaces The paramters of the BehaviorControl module.
    00826   */
    00827   GT2005BasicBehaviorGoToPointAndAvoidObstacles(BehaviorControlInterfaces& interfaces,
    00828     Xabsl2ErrorHandler& errorHandler)
    00829     : Xabsl2BasicBehavior("go-to-point-and-avoid-obstacles", errorHandler),
    00830     BehaviorControlInterfaces(interfaces),
    00831     turnSpeed(0, .5, 0, 0, -pi, pi, pi/2),
    00832     speedX(0, .3, 0, 0, -80, 500, 100),
    00833     speedY(0, .3, 0, 0, -150, 150, 100)
    00834   {
    00835     registerParameter("go-to-point-and-avoid-obstacles.x", x);
    00836     registerParameter("go-to-point-and-avoid-obstacles.y", y);
    00837     registerParameter("go-to-point-and-avoid-obstacles.max-speed", maxSpeed);
    00838     registerParameter("go-to-point-and-avoid-obstacles.avoidance-level", avoidanceLevel);
    00839   }
    00840
    00841   /**  Executes the basic behavior. */
    00842   virtual void execute();
    00843
    00844 private:
    00845   /** parameter "go-to-point-and-avoid-obstacles.x" */
    00846   double x;
    00847
    00848   /** parameter "go-to-point-and-avoid-obstacles.y" */
    00849   double y;
    00850
    00851   /** parameter "go-to-point-and-avoid-obstacles.max-speed" */
    00852   double maxSpeed;
    00853
    00854   /** parameter "go-to-point-and-avoid-obstacles.avoid-penalty-areas" */
    00855   double avoidanceLevel;
    00856
    00857   /** smoothes the rotation */
    00858   PIDsmoothedValue turnSpeed;
    00859
    00860   /** smoothes the speed in forward direction */
    00861   PIDsmoothedValue speedX;
    00862
    00863   /** smoothes the speed in sideways direction */
    00864   PIDsmoothedValue speedY;
    00865
    00866   /** last time behavior was executed */
    00867   long lastTimeExecuted;
    00868 };
    00869
    00870 /**
    00871 * A Basic Beha....
    00872 * @author
    00873 */
    00874 //class GT2005BasicBehaviorDogAsJoystick : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00875 //{
    00876 //public:
    00877 ///*
    00878 //* Constructor.
    00879 //* @param errorHandler Is invoked when errors occur
    00880 //* @param interfaces The paramters of the BehaviorControl module.
    00881 //  */
    00882 //  GT2005BasicBehaviorDogAsJoystick(BehaviorControlInterfaces& interfaces,
    00883 //    Xabsl2ErrorHandler& errorHandler)
    00884 //    : Xabsl2BasicBehavior("dog-as-joystick", errorHandler),
    00885 //    BehaviorControlInterfaces(interfaces)
    00886 //  {
    00887 //  }
    00888 //
    00889 //  /**  Executes the basic behavior. */
    00890 //  virtual void execute();
    00891 //
    00892 //private:
    00893 //};
    00894
    00895 struct WLanInfo
    00896 {
    00897   unsigned long measures;
    00898   double        link;
    00899   double        noise;
    00900   double        signal;
    00901
    00902   double        dLink;
    00903   double        dNoise;
    00904   double        dSignal;
    00905 };
    00906
    00907 #define FILTEREDINFO  16
    00908 #define WLANINFO      360
    00909
    00910 /**
    00911 * @class GT2005BasicBehaviorWlanBearing
    00912 *
    00913 * Creates and registers simple basic behaviors
    00914 */
    00915 class GT2005BasicBehaviorCalcWlanBearing : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00916 {
    00917 public:
    00918 /*
    00919 * Constructor.
    00920 * @param errorHandler Is invoked when errors occur
    00921 * @param interfaces The paramters of the BehaviorControl module.
    00922   */
    00923   GT2005BasicBehaviorCalcWlanBearing(BehaviorControlInterfaces& interfaces,
    00924     Xabsl2ErrorHandler& errorHandler)
    00925     : Xabsl2BasicBehavior("calc-wlan-bearing", errorHandler),
    00926     BehaviorControlInterfaces(interfaces)//,
    00927     //turnSpeed(0, .5, 0, 0, -pi, pi, pi/2),
    00928     //speedX(0, .4, 0, 0, -80, 350, 100),
    00929     //speedY(0, .4, 0, 0, -100, 100, 100)
    00930   {
    00931     registerParameter("calc-wlan-bearing.init", state);
    00932
    00933     initExecuted = false;
    00934     filterExecuted = false;
    00935
    00936     numMeasure = 0;
    00937   }
    00938
    00939   /**  Initialization. */
    00940   virtual void init();
    00941
    00942   /**  Executes the basic behavior. */
    00943   virtual void execute();
    00944
    00945   virtual void Filter();
    00946
    00947 private:
    00948   unsigned int  numMeasure;
    00949   unsigned long startTime;
    00950
    00951   double        state;
    00952
    00953   unsigned int  frames;
    00954   WLanInfo      wlanInfo[WLANINFO];
    00955
    00956   WLanInfo      filteredInfo[FILTEREDINFO];
    00957
    00958   bool          initExecuted;
    00959   bool          filterExecuted;
    00960
    00961   OdometryData  lastOdometry;
    00962
    00963   double        rotationAngle;
    00964 };
    00965
    00966 /**
    00967 * @class GT2005BasicBehaviorWlanBearing
    00968 *
    00969 * Creates and registers simple basic behaviors
    00970 */
    00971 class GT2005BasicBehaviorLocateMaxGreen : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    00972 {
    00973 public:
    00974 /*
    00975 * Constructor.
    00976 * @param errorHandler Is invoked when errors occur
    00977 * @param interfaces The paramters of the BehaviorControl module.
    00978   */
    00979   GT2005BasicBehaviorLocateMaxGreen(BehaviorControlInterfaces& interfaces,
    00980     Xabsl2ErrorHandler& errorHandler)
    00981     : Xabsl2BasicBehavior("locate-max-green", errorHandler),
    00982     BehaviorControlInterfaces(interfaces)
    00983   {
    00984     registerParameter("locate-max-green.param", param);
    00985
    00986     Init ();
    00987   }
    00988
    00989   /**  Executes the basic behavior. */
    00990   virtual void execute();
    00991 private:
    00992   void Init ();
    00993   OdometryData  lastOdometry;
    00994
    00995   double        rotationAngle;
    00996
    00997   double        param;
    00998 };
    00999
    01000 /**
    01001 * @class GT2005BasicBehaviorWlanBearing
    01002 *
    01003 * Creates and registers simple basic behaviors
    01004 */
    01005 class GT2005BasicBehaviorTurn : public Xabsl2BasicBehavior, public BehaviorControlInterfaces
    01006 {
    01007 public:
    01008 /*
    01009 * Constructor.
    01010 * @param errorHandler Is invoked when errors occur
    01011 * @param interfaces The paramters of the BehaviorControl module.
    01012   */
    01013   GT2005BasicBehaviorTurn(BehaviorControlInterfaces& interfaces,
    01014     Xabsl2ErrorHandler& errorHandler)
    01015     : Xabsl2BasicBehavior("turn", errorHandler),
    01016     BehaviorControlInterfaces(interfaces)//,
    01017   {
    01018     registerParameter("turn.angle", angle);
    01019     registerParameter("turn.radian", radian);
    01020     registerParameter("turn.param", param);
    01021   }
    01022
    01023   /**  Executes the basic behavior. */
    01024   virtual void execute();
    01025 private:
    01026   void Init ();
    01027
    01028   OdometryData  lastOdometry;
    01029
    01030   double        angle;
    01031
    01032   double        radian;
    01033
    01034   double        rotationAngle;
    01035
    01036   double        targetRotation;
    01037
    01038   double        param;
    01039 };
    01040
    01041 /**
    01042 * @class SimpleBasicBehaviors
    01043 *
    01044 * Creates and registers simple basic behaviors
    01045 */
    01046 class GT2005SimpleBasicBehaviors : public BehaviorControlInterfaces
    01047 {
    01048 public:
    01049 /**
    01050 * Constructor
    01051   */
    01052   GT2005SimpleBasicBehaviors(BehaviorControlInterfaces& interfaces,
    01053     Xabsl2ErrorHandler& errorHandler)
    01054     : BehaviorControlInterfaces(interfaces),
    01055     errorHandler(errorHandler),
    01056     basicBehaviorGoToBallWoTurning(interfaces,errorHandler),
    01057     basicBehaviorNewGoToBall(interfaces,errorHandler),
    01058     basicBehaviorGoToBallPropagated(interfaces,errorHandler),
    01059     basicBehaviorGoToBall(interfaces,errorHandler),
    01060     basicBehaviorGoToPoint(interfaces,errorHandler),
    01061     basicBehaviorGoToPointFast(interfaces,errorHandler),
    01062     basicBehaviorGoToInterceptionPoint(interfaces,errorHandler),
    01063     basicBehaviorGoForwardToPoint(interfaces,errorHandler),
    01064     basicBehaviorTurnAroundPoint(interfaces,errorHandler),
    01065     basicBehaviorGoToPointAndAvoidObstacles(interfaces,errorHandler),
    01066     //basicBehaviorDogAsJoystick(interfaces,errorHandler),
    01067     basicBehaviorGoaliePosition(interfaces,errorHandler),
    01068     basicBehaviorGoalieReturnToGoal(interfaces,errorHandler),
    01069     basicBehaviorGoaliePositionReturn(interfaces,errorHandler),
    01070     basicBehaviorTurnAroundPointWithRadius(interfaces,errorHandler),
    01071   basicBehaviorGoToRelativePoint(interfaces,errorHandler),
    01072     basicBehaviorCalcWLanBearing(interfaces,errorHandler),
    01073     basicBehaviorLocateMaxGreen(interfaces,errorHandler),
    01074     basicBehaviorTurnAroundPointFast(interfaces,errorHandler),
    01075     basicBehaviorTurn(interfaces,errorHandler)
    01076    {}
    01077
    01078   /** Registers basic behaviors at the engine */
    01079   void registerBasicBehaviors(Xabsl2Engine& engine)
    01080   {
    01081     engine.registerBasicBehavior(basicBehaviorGoToBallWoTurning);
    01082     engine.registerBasicBehavior(basicBehaviorNewGoToBall);
    01083     engine.registerBasicBehavior(basicBehaviorGoToBallPropagated);
    01084     engine.registerBasicBehavior(basicBehaviorGoToBall);
    01085     engine.registerBasicBehavior(basicBehaviorGoToPoint);
    01086     engine.registerBasicBehavior(basicBehaviorGoToPointFast);
    01087     engine.registerBasicBehavior(basicBehaviorGoToInterceptionPoint);
    01088     engine.registerBasicBehavior(basicBehaviorGoForwardToPoint);
    01089     engine.registerBasicBehavior(basicBehaviorGoToPointAndAvoidObstacles);
    01090     engine.registerBasicBehavior(basicBehaviorTurnAroundPoint);
    01091     //engine.registerBasicBehavior(basicBehaviorDogAsJoystick);
    01092     engine.registerBasicBehavior(basicBehaviorGoaliePosition);
    01093     engine.registerBasicBehavior(basicBehaviorGoalieReturnToGoal);
    01094     engine.registerBasicBehavior(basicBehaviorGoaliePositionReturn);
    01095     engine.registerBasicBehavior(basicBehaviorTurnAroundPointWithRadius);
    01096   engine.registerBasicBehavior(basicBehaviorGoToRelativePoint);
    01097     engine.registerBasicBehavior(basicBehaviorCalcWLanBearing);
    01098     engine.registerBasicBehavior(basicBehaviorLocateMaxGreen);
    01099     engine.registerBasicBehavior(basicBehaviorTurnAroundPointFast);
    01100     engine.registerBasicBehavior(basicBehaviorTurn);
    01101   }
    01102
    01103 private:
    01104   /** Is invoked when errors occurs */
    01105   Xabsl2ErrorHandler& errorHandler;
    01106
    01107   //!@name Basic Behaviors
    01108   //!@{
    01109   GT2005BasicBehaviorGoToBallWithoutTurning basicBehaviorGoToBallWoTurning;
    01110   GT2005BasicBehaviorNewGoToBall  basicBehaviorNewGoToBall;
    01111   GT2005BasicBehaviorGoToBall  basicBehaviorGoToBall;
    01112   GT2005BasicBehaviorGoToBallPropagated  basicBehaviorGoToBallPropagated;
    01113   GT2005BasicBehaviorGoToPoint  basicBehaviorGoToPoint;
    01114   GT2005BasicBehaviorGoToPointFast basicBehaviorGoToPointFast;
    01115   GT2005BasicBehaviorGoToInterceptionPoint  basicBehaviorGoToInterceptionPoint;
    01116   GT2005BasicBehaviorGoForwardToPoint  basicBehaviorGoForwardToPoint;
    01117   GT2005BasicBehaviorTurnAroundPoint basicBehaviorTurnAroundPoint;
    01118   GT2005BasicBehaviorGoToPointAndAvoidObstacles  basicBehaviorGoToPointAndAvoidObstacles;
    01119   //GT2005BasicBehaviorDogAsJoystick basicBehaviorDogAsJoystick;
    01120   GT2005BasicBehaviorGoaliePosition  basicBehaviorGoaliePosition;
    01121   GT2005BasicBehaviorGoalieReturnToGoal basicBehaviorGoalieReturnToGoal;
    01122   GT2005BasicBehaviorGoaliePositionReturn  basicBehaviorGoaliePositionReturn;
    01123   GT2005BasicBehaviorTurnAroundPointWithRadius basicBehaviorTurnAroundPointWithRadius;
    01124   GT2005BasicBehaviorGoToRelativePoint  basicBehaviorGoToRelativePoint;
    01125   GT2005BasicBehaviorCalcWlanBearing basicBehaviorCalcWLanBearing;
    01126   GT2005BasicBehaviorLocateMaxGreen basicBehaviorLocateMaxGreen;
    01127   GT2005BasicBehaviorTurnAroundPointFast basicBehaviorTurnAroundPointFast;
    01128   GT2005BasicBehaviorTurn basicBehaviorTurn;
    01129   //!@}
    01130 };
    01131
    01132 #endif // __GT2005SimpleBasicBehaviors_h_
    01133