00001 /** 00002 * @file GT2004CollisionDetector.h 00003 * 00004 * This file contains a class for Collision Detection. 00005 */ 00006 00007 #ifndef __GT2004CollisionDetector_h_ 00008 #define __GT2004CollisionDetector_h_ 00009 00010 #include "CollisionDetector.h" 00011 #include "Representations/Perception/SensorData.h" 00012 00013 /** 00014 * @class GT2004CollisionDetector 00015 * 00016 * The default CollisionDetector in the GT2004 project. 00017 */ 00018 class GT2004CollisionDetector : 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 GT2004CollisionDetector(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// __GT2004CollisionDetector_h_ 00093 00094 /* 00095 * Change log : 00096 * 00097 * $Log: GT2004CollisionDetector.h,v $ 00098 * Revision 1.2 2004/09/08 14:39:02 wachter 00099 * - Fixed some doxygen-errors 00100 * 00101 * Revision 1.1 2004/07/10 00:18:29 spranger 00102 * renamed (readded) for coderelease 00103 * 00104 * Revision 1.1.1.1 2004/05/22 17:19:08 cvsadm 00105 * created new repository GT2004_WM 00106 * 00107 * Revision 1.3 2004/03/08 01:38:49 roefer 00108 * Interfaces should be const 00109 * 00110 * Revision 1.2 2003/12/31 20:16:13 roefer 00111 * SensorData for ERS-7 00112 * 00113 * Revision 1.1 2003/10/06 14:10:14 cvsadm 00114 * Created GT2004 (M.J.) 00115 * 00116 * Revision 1.7 2003/09/26 15:27:49 juengel 00117 * Renamed DataTypes to representations. 00118 * 00119 * Revision 1.6 2003/07/15 12:49:14 goehring 00120 * Speed optimized 00121 * 00122 */