]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robofsm: Remove shape detecting from map handling
authorMatous Pokorny <matous.pokorny@me.com>
Fri, 28 Sep 2012 16:54:14 +0000 (18:54 +0200)
committerMatous Pokorny <matous.pokorny@me.com>
Fri, 28 Sep 2012 16:54:14 +0000 (18:54 +0200)
src/robofsm/map_handling.cc

index ae336a5744a45ab7052a9b4d9eb40e28dbb09eb4..90a5a56057ad4e3535d19366a50246cb2b10976b 100644 (file)
@@ -198,13 +198,13 @@ void update_map_hokuyo(struct sick_scan_type *s)
        struct sharp_pos beam;
        u_int16_t *data;
 
-       static std::vector<Shape_detect::Point> reds;
-       static std::vector<Shape_detect::Point> blues;
+//     static std::vector<Shape_detect::Point> reds;
+//     static std::vector<Shape_detect::Point> blues;
 
-       if (reds.size() < 16) {
-               get_checkerboard(blues);
-               get_checkerboard(reds);
-       }
+//     if (reds.size() < 16) {
+//             get_checkerboard(blues);
+//             get_checkerboard(reds);
+//     }
 
        robot_get_est_pos(&e.x, &e.y, &e.phi);
 
@@ -213,14 +213,14 @@ void update_map_hokuyo(struct sick_scan_type *s)
 
        data = s->data;
 
-       Shape_detect shapeDet;
-       std::vector<Shape_detect::Arc> arcs;
-       std::vector<Shape_detect::Point> center_arcs;
-
-       shapeDet.prepare(data);
-       shapeDet.arc_detect(arcs);
-
-       Shape_detect::Point tmpPoint;
+//     Shape_detect shapeDet;
+//     std::vector<Shape_detect::Arc> arcs;
+//     std::vector<Shape_detect::Point> center_arcs;
+// 
+//     shapeDet.prepare(data);
+//     shapeDet.arc_detect(arcs);
+// 
+//     Shape_detect::Point tmpPoint;
 
 //     double distance;
 
@@ -266,17 +266,17 @@ void update_map_hokuyo(struct sick_scan_type *s)
                if(data[i] > 19 && data[i] < 2000) {
                        obst_coord(&e, &beam, data[i]/1000.0, &x, &y);
 
-                       tmpPoint.x = x;
-                       tmpPoint.y = y;
+//                     tmpPoint.x = x;
+//                     tmpPoint.y = y;
 
-                       if (center_arcs.size() > 0) {
-                               for (unsigned int j = 0; j < center_arcs.size(); j++) {
-                                       if (point_distance(tmpPoint, center_arcs[j]) < 0.12) {
-                                               obstacle = false;
-                                               break;
-                                       }
-                               }
-                       }
+//                     if (center_arcs.size() > 0) {
+//                             for (unsigned int j = 0; j < center_arcs.size(); j++) {
+//                                     if (point_distance(tmpPoint, center_arcs[j]) < 0.12) {
+//                                             obstacle = false;
+//                                             break;
+//                                     }
+//                             }
+//                     }
 
                        if (obstacle) {
                                obstacle_detected_at(x, y, true);