]> rtime.felk.cvut.cz Git - eurobot/public.git/blobdiff - src/robofsm/map_handling.c
src: raw code a changes
[eurobot/public.git] / src / robofsm / map_handling.c
index 0fbdca9e105050e90fdd3209d14dc2d9b601e2d9..c064048da671b0ea35c56ee7f7723842d0eba32c 100644 (file)
@@ -8,11 +8,11 @@
  * Parameters of Obstacle detection
  *******************************************************************************/
 
-#define OBS_SIZE_M 0.1         /**< Expected size of detected obstacle  */
+#define OBS_SIZE_M 0.05                /**< Expected size of detected obstacle  */
 #define IGNORE_CLOSER_THAN_M 0.1 /**< Do not mark any obstacle closer than this to center of the robot (avoid path planning deadlock) */
 #define IGNORE_FURTHER_THAN_M 0.5 /**< Ignore data from sharp if further than this */
 #define OBS_FORGET_PERIOD      100             /**< The period of thread_obstacle_forgeting [ms] */
-#define OBS_FORGET_SEC 1                       /**< Time to completely forget detected obstacle. */
+#define OBS_FORGET_SEC 5                       /**< Time to completely forget detected obstacle. */
 #define OBS_OFFSET     0.6
 
 void obstacle_detected_at(double x, double y, bool real_obstacle)
@@ -101,13 +101,13 @@ void update_map_hokuyo(struct hokuyo_scan_type *s)
 
        for (i = 0; i < HOKUYO_ARRAY_SIZE; i++) {
                beam.ang = HOKUYO_INDEX_TO_RAD(i);
-               if((beam.ang<(-70.0/180.0*M_PI))||((beam.ang>(70.0/180.0*M_PI))))
+               if((beam.ang<(-HOKUYO_RANGE_ANGLE_LEFT/180.0*M_PI))||((beam.ang>(HOKUYO_RANGE_ANGLE_RIGHT/180.0*M_PI))))
                        continue;
 
                if(data[i] > 19 && data[i] < 4000) {
                        obst_coord(&e, &beam, data[i]/1000.0, &x, &y);
                        obstacle_detected_at(x, y, true);
-                       obst_coord(&e, &beam, (data[i]/1000.0)+0.1, &x, &y);
+                       obst_coord(&e, &beam, (data[i]/1000.0) + OBS_SIZE_M, &x, &y);
                        obstacle_detected_at(x, y, false);
                }