int ShmapIsFreeCell(int x, int y)
{
struct map_cell *cell;
- if(map && ShmapIsCellInMap(x,y)) {
- bool free;
+
+ if (map && ShmapIsCellInMap(x,y)) {
+ bool free;
cell = &(map->cells[y][x]);
- free = (cell->detected_obstacle == 0) &&
- (((cell->flags & (MAP_FLAG_WALL|MAP_FLAG_DET_OBST|MAP_FLAG_PLAN_MARGIN)) == 0) ||
- ((cell->flags & MAP_FLAG_WALL) && (cell->flags & MAP_FLAG_INVALIDATE_WALL)));
- return free;
+ free = ((cell->detected_obstacle == 0) &&
+ ((cell->flags & (MAP_FLAG_WALL | MAP_FLAG_DET_OBST | MAP_FLAG_PLAN_MARGIN)) == 0));
+ return free;
}
else return -1;
}
/** "Safety margin" around obstacle - used only during A* planning and
* not during runtime obstacle avoidance. */
#define MAP_FLAG_PLAN_MARGIN 128
-#define MAP_FLAG_INVALIDATE_WALL 256 /**< Area, where the wall should be forgotten */
/** @}*/
/** @name Shared Memory macros */
TARGET_ERROR // Fatal errror during planning
};
-// we may need something similar in future
-void invalidate(Point point)
-{
- //ShmapSetRectangleFlag(x-s, y-s, x+s, y+s, MAP_FLAG_INVALIDATE_WALL, 0)
-}
-
static double free_space_in_front_of_robot()
{
int i, i1, i2;
Trajectory *t = new Trajectory(move_target->tc, backward);
- /*
- // Clear all invalidate flags;
- ShmapSetRectangleFlag(0, 0, PLAYGROUND_WIDTH_M, PLAYGROUND_HEIGHT_M, 0, MAP_FLAG_INVALIDATE_WALL);
- // Set invalidate flags if we are going to walled area
- if (false) // we may need this in future
- invalidate(start);
- */
-
if (move_target->heading.operation == TOP_ARRIVE_FROM) {
get_arrive_from_point(move_target->x, move_target->y, move_target->heading,
&target.x, &target.y);
struct map_cell *cell = &map->cells[j][i];
color = lightGray;
- if ((cell->flags & MAP_FLAG_WALL) &&
- (cell->flags & MAP_FLAG_INVALIDATE_WALL) == 0)
+ if (cell->flags & MAP_FLAG_WALL)
color = darkYellow;
if (cell->flags & MAP_FLAG_IGNORE_OBST)
color = darkGreen;