00001 /** 00002 * @file GT2005CollisionDetector.h 00003 * 00004 * This file contains a class for Collision Detection. 00005 */ 00006 00007 #ifndef __GT2005CollisionDetector_h_ 00008 #define __GT2005CollisionDetector_h_ 00009 00010 #include "CollisionDetector.h" 00011 #include "Representations/Perception/SensorData.h" 00012 00013 /** 00014 * @class GT2005CollisionDetector 00015 * 00016 * The default CollisionDetector in the GT2005 project. 00017 */ 00018 class GT2005CollisionDetector : public CollisionDetector 00019 { 00020 private: 00021 int ringBuffer[SensorData::numOfSensor_ERS210][128][2]; 00022 int floatingAvg[SensorData::numOfSensor_ERS210][SensorDataBuffer::maxNumOfFrames][16]; 00023 int minAvg[SensorData::numOfSensor_ERS210][SensorDataBuffer::maxNumOfFrames]; //best matching phase delay 00024 int threshold[SensorData::numOfSensor_ERS210][3]; //min, max and current threshold value 00025 int oldVal; // the old Difference between Sensor and actor 00026 int newVal; // the new Difference between Sensor and actor 00027 int index; // number of the sensor data number rounded to quadruples 00028 int min; // minimum delay value for sensor to actor delay in 125ths seconds 00029 int max; // maximum delay value for sensor to actor delay in 125ths seconds 00030 int infin; // very large integer 00031 int walkingMode; // 0 = out of range, 1 = just straight, 2 = just side, 3 = left, 4 = right, 5 = rotation 00032 int q; // Queue length 00033 00034 double lastMotionChange; // frame number of last motion change 00035 double currentMotionX; // current motion.x value 00036 double currentMotionY; // current motion.y value 00037 double currentRotation; // current rotation value 00038 double lastMotionX; // previous motion.x value 00039 double lastMotionY; // previous motion.y value 00040 double lastRotation; // previous rotation value 00041 double motionChangeThresholdX; // threshold which is allowed from one to another x motion speed 00042 double motionChangeThresholdY; // threshold which is allowed from one to another y motion speed 00043 double motionChangeThresholdR; // threshold which is allowed from one to another rot. motion speed 00044 00045 double frontMin; //minimum front walking speed value which is allowed for recognition 00046 double frontMax; //maximum front walking speed value which is allowed for recognition 00047 double backMin; //minimum front walking speed value which is allowed for recognition 00048 double backMax; //maximum front walking speed value which is allowed for recognition 00049 double sideMin; //minimum side walking speed value which is allowed for recognition 00050 double sideMax; //maximum side walking speed value which is allowed for recognition 00051 double rotMin; //minimum rotating speed value which is allowed for recognition 00052 double rotMax; //maximum rotating speed value which is allowed for recognition 00053 double calmDown; // the number of frames it takes the robot to wait after motion change in 125th secs. 00054 double scaleThresholdFore; // a scale factor for foreward move thresholds 00055 double scaleThresholdBack; // a scale factor for backward move thresholds 00056 double scaleThresholdSide; // a scale factor for side move thresholds 00057 double scaleThresholdRot; // a scale factor for rotation move thresholds 00058 double motionChangeThresholdFactor; // a scale factor to compensate motion changes 00059 double lastTooBigMotionChange; //last motion change that has too be considered in col.det. 00060 double xRatio; // Difference between two straight movements 00061 double yRatio; // Difference between two side movements 00062 double rRatio; // Difference between two rotation movements 00063 00064 00065 /* DEBUG / 00066 00067 double maxfl1; 00068 double maxfl2; 00069 double maxfr1; 00070 double maxfr2; 00071 double maxhl1; 00072 double maxhl2; 00073 double maxhr1; 00074 double maxhr2; 00075 */ 00076 00077 public: 00078 /** 00079 * Constructor 00080 * 00081 */ 00082 GT2005CollisionDetector(const CollisionDetectorInterfaces& interfaces); 00083 00084 /** Executes the module */ 00085 virtual void execute(); 00086 00087 private: 00088 /** Calculated the angle thresholds */ 00089 void calculateThresholds(); 00090 }; 00091 00092 #endif// __GT2005CollisionDetector_h_
1.3.6