]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Shape_detect:
authorMartin Synek <synek.martin@gmail.com>
Sun, 1 May 2011 19:08:27 +0000 (21:08 +0200)
committerMartin Synek <synek.martin@gmail.com>
Sun, 1 May 2011 19:08:27 +0000 (21:08 +0200)
Change constants minimal and maximal angle detection to global
(HOKUYO_RANGE_ANGLE_LEFT, HOKUYO_RANGE_ANGLE_RIGHT).

src/hokuyo/shape-detect/shape_detect.cc
src/hokuyo/shape-detect/shape_detect.h

index 468bc77e0cc68999c643879cf4637940f7e5aff4..69127ce81e2013f32167b542d6a311184fc50cbf 100644 (file)
@@ -384,7 +384,7 @@ void Shape_detect::polar_to_cartes(const unsigned short laser_scan[])
                
                fi = HOKUYO_INDEX_TO_RAD(i);
 
-               if (r > 0 && fi > (MIN_ANGLE / 180.0 * M_PI) && fi < (MAX_ANGLE / 180.0 * M_PI)) {
+               if (r > 0 && fi > (-1 * HOKUYO_RANGE_ANGLE_LEFT / 180.0 * M_PI) && fi < (HOKUYO_RANGE_ANGLE_RIGHT / 180.0 * M_PI)) {
                        fi = HOKUYO_INDEX_TO_RAD(i);
                        point.x = r * cos(fi);
                        point.y = r * sin(fi);
index c789ddb940abb0d69451f95fd7f90e64167cb23d..ff614b2c519eb5bfbaa4e1d69abc5a7f3c6ae4b5 100644 (file)
@@ -86,21 +86,10 @@ http://mathpages.com/home/kmath110.htm
 #include <hokuyo.h>
 #include <robot.h>
 #include <robomath.h>
+#include <robodim.h>
 #include <robottype.h>
 #include <roboorte_robottype.h>
 
-/**
- * Maximal angle detection
- * @ingroup shapedet
- */
-#define MAX_ANGLE 70.0
-
-/**
- * Minimal angle detection
- * @ingroup shapedet
- */
-#define MIN_ANGLE -70.0
-
 /**
  * There are detected line segments in input array of measured data (laser_scan)
  * by using perpendicular line regression.