00001 /** 00002 * @file ObstacleAvoiderOnGreenFieldERS7.h 00003 * Class that generates Motion requests in a fashion similar to the ObstacleAvoiderOnGreenFieldERS7 ve. 00004 * 00005 * @author <A href=mailto:jhoffman@informatik.hu-berlin.de>Jan Hoffmann</A> 00006 */ 00007 00008 #ifndef __ObstacleAvoiderOnGreenFieldERS7_h_ 00009 #define __ObstacleAvoiderOnGreenFieldERS7_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 ObstacleAvoiderOnGreenFieldERS7 : public SensorBehaviorControl 00022 { 00023 public: 00024 /** 00025 * Constructor. 00026 * @param interfaces The paramters of the SensorBehaviorControl module. 00027 */ 00028 ObstacleAvoiderOnGreenFieldERS7(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// __ObstacleAvoiderOnGreenFieldERS7_h_ 00056 00057 /* 00058 * Change log : 00059 * 00060 */