]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Remove unused map flags and related functions.
authorMichal Vokac <vokac.m@gmail.com>
Sun, 30 Sep 2012 10:38:15 +0000 (12:38 +0200)
committerMichal Vokac <vokac.m@gmail.com>
Sun, 30 Sep 2012 10:38:15 +0000 (12:38 +0200)
- MAP_FLAG_INVALIDATE_WALL
- MAP_FLAG_TARGET

src/pathplan/map.c
src/pathplan/map.h
src/robofsm/fsmmove.cc
src/robomon/RobomonAtlantis.cpp

index e713441398bbd82f4a874b8e32b311d737c965ca..790a5a68976e42f4e83fcef481c46dcd72a0cb6b 100644 (file)
@@ -151,13 +151,13 @@ struct map_cell *ShmapCellAtPoint(double x_m, double y_m)
 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;
 }
index 4c2657279ded10ded5ff5a7cc4d7412f60f8174f..a7999980c676582edd6183e30ff292272641339b 100644 (file)
 /** "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 */
index 15561cd00836b90db960488a147e97080b5c0bc9..e72702dae6c1a75974878abaf5804fbcf8f05aa8 100644 (file)
@@ -49,12 +49,6 @@ enum target_status {
        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;
@@ -111,14 +105,6 @@ static enum target_status new_goal(struct move_target *move_target, double start
        
        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);
index 3fbb90ff65615c56a1a28371116f2bda58b08bee..38beaf9cfe2fa898cd17b77fda054bcb2c312724 100644 (file)
@@ -481,8 +481,7 @@ void RobomonAtlantis::paintMap()
                         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;