* Parameters of Obstacle detection
*******************************************************************************/
-#define OBS_SIZE_M 0.2 /**< Expected size of detected obstacle */
+#define OBS_SIZE_M 0.05 /**< Expected size of detected obstacle */
#define IGNORE_CLOSER_THAN_M 0.2 /**< 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 200 /**< The period of thread_obstacle_forgeting [ms] */
if (real_obstacle) {
/* The obstacle was detected here */
map->cells[ycell][xcell].flags |= MAP_FLAG_DET_OBST;
+ map->cells[ycell][xcell].flags |= MAP_FLAG_WALL;
+ map->cells[ycell][xcell].detected_obstacle |= MAP_NEW_OBSTACLE;
}
/** Then all the cells arround obstacle cell are set as
if((beam.ang<(-70.0/180.0*M_PI))||((beam.ang>(70.0/180.0*M_PI))))
continue;
- if(data[i] > 19 && data[i] < 4000) {
+ if(data[i] > 19 && data[i] < 2000) {
obst_coord(&e, &beam, data[i]/1000.0, &x, &y);
obstacle_detected_at(x, y, true);
- }
+ } /*else {
+ //TODO delete all obsatcles previously seen in this range
+ struct map *map = robot.map;
+
+ double range;
+
+ double cosinus = cos(e.phi + beam.ang);
+ double sinus = sin(e.phi + beam.ang);
+ for (range = 0.1; range < (data[i]/1000.0); range += 0.05) {
+ //printf("pocitam, data[%i], range=%f\n", i, range);
+ bool valid;
+
+ beam.x = cosinus*range + e.x;
+ beam.y = sinus*range + e.y;
+
+ ShmapPoint2Cell(beam.x, beam.y, &x, &y, &valid);
+ map->cells[(int)y][(int)x].flags |= MAP_FLAG_WALL;
+ }
+ }*/
}
}