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

Modules/SensorBehaviorControl/ObstacleAvoiderOnGreenField.h

Go to the documentation of this file.
00001 /**
00002 * @file ObstacleAvoiderOnGreenField.h
00003 * Class that generates Motion requests in a fashion similar to the ObstacleAvoiderOnGreenField ve.
00004 * 
00005 * @author <A href=mailto:jhoffman@informatik.hu-berlin.de>Jan Hoffmann</A>
00006 */
00007  
00008 #ifndef __ObstacleAvoiderOnGreenField_h_
00009 #define __ObstacleAvoiderOnGreenField_h_
00010 
00011 #include "SensorBehaviorControl.h"
00012 #include "Tools/Math/PIDsmoothedValue.h"
00013 #include "Tools/Debugging/DebugImages.h"
00014 #include "Tools/Debugging/DebugDrawings.h"
00015 
00016 
00017 /**
00018 * Class that generates Motion requests in a fashion similar to the Braitenberg but also uses
00019 * the PSD sensor to not run into things.
00020 */
00021 class ObstacleAvoiderOnGreenField : public SensorBehaviorControl
00022 {
00023 public:
00024   /** 
00025   * Constructor.
00026   * @param interfaces The paramters of the SensorBehaviorControl module.
00027   */
00028   ObstacleAvoiderOnGreenField(const SensorBehaviorControlInterfaces& interfaces);
00029   
00030   /** some init's that are only done when the module is called
00031   * for the first time (or it it hasn't been called for a while) 
00032   * such as setting the headcontrol-mode
00033   */
00034   void init();
00035   /** the "main" module where all the magic is happening */
00036   virtual void execute();
00037   /** calibrate the psd (while standing still) to the minimum 
00038   * value it measures */
00039   void calibrate();
00040   /** currently no debug messages are handled */
00041   virtual bool handleMessage(InMessage& message);
00042 
00043 private:
00044   double maxSpeedX, distanceToGround, distanceOffset, distanceControlInterval;
00045   PIDsmoothedValue speedX, speedY, speedPhi;
00046   int gridSize, greenOrLight;
00047   unsigned long timeOfLastExecute, timeToCalibrate;
00048   ColorTable64 localColTable;
00049   bool localColTableInitialized;
00050 
00051   // images for debugging
00052   DECLARE_DEBUG_IMAGE(classificationY);
00053 };
00054 
00055 #endif// __ObstacleAvoiderOnGreenField_h_
00056 
00057 /*
00058 * Change log :
00059 * 
00060 * $Log: ObstacleAvoiderOnGreenField.h,v $
00061 * Revision 1.1.1.1  2004/05/22 17:20:52  cvsadm
00062 * created new repository GT2004_WM
00063 *
00064 * Revision 1.4  2004/03/08 02:11:50  roefer
00065 * Interfaces should be const
00066 *
00067 * Revision 1.3  2004/01/12 16:00:47  jhoffman
00068 * *** empty log message ***
00069 *
00070 * Revision 1.2  2003/12/09 16:28:15  jhoffman
00071 * - added sounds to obstacle avoider on green field
00072 * - added calibration mode for obstacle avoider on green field
00073 *
00074 * Revision 1.1  2003/10/06 14:10:15  cvsadm
00075 * Created GT2004 (M.J.)
00076 *
00077 * Revision 1.1.1.1  2003/07/02 09:40:24  cvsadm
00078 * created new repository for the competitions in Padova from the 
00079 * tamara CVS (Tuesday 2:00 pm)
00080 *
00081 * removed unused solutions
00082 *
00083 * Revision 1.3  2003/06/11 16:10:31  dueffert
00084 * some cleanup
00085 *
00086 * Revision 1.2  2003/02/02 23:29:21  jhoffman
00087 * adjustments for it to work reliably and with any walking engine
00088 *
00089 * Revision 1.1  2003/01/30 18:26:40  jhoffman
00090 * added ObstacleAvoider
00091 *
00092 *
00093 *
00094 */

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