Shape_detect::Radius = 100;
Shape_detect::Scale = 10;
Shape_detect::Arc_min_points = 10;
- Shape_detect::Arc_max_distance = 1000;
+ Shape_detect::Arc_max_distance = 2000;
+
+ bresenham_circle(circle);
}
Shape_detect::Shape_detect(int line_min_points, int line_error_threshold, int max_distance_point,
Shape_detect::Scale = scale;
Shape_detect::Arc_min_points = arc_min_points;
Shape_detect::Arc_max_distance = arc_max_distance;
+
+ bresenham_circle(circle);
}
inline Shape_detect::Point Shape_detect::intersection_line(const Shape_detect::Point point, const General_form gen)
memset(accumulator, 0, sizeof(accumulator));
- std::vector<Shape_detect::Point> circle;
-
- bresenham_circle(circle);
-
for (int i = begin; i <= end; i++) {
int xc = floor((cartes[i].x - center_x) / Shape_detect::Scale);
int yc = floor((cartes[i].y - center_y) / Shape_detect::Scale);
for (int i = 0; i < (int) HOKUYO_ARRAY_SIZE; i++) {
r = (laser_scan[i] <= 19) ? 0 : laser_scan[i];
+
+ fi = HOKUYO_INDEX_TO_RAD(i);
- if (r > 0) {
+ if (r > 0 && fi > (MIN_ANGLE / 180.0 * M_PI) && fi < (MAX_ANGLE / 180.0 * M_PI)) {
fi = HOKUYO_INDEX_TO_RAD(i);
point.x = r * cos(fi);
point.y = r * sin(fi);
#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.
std::vector<Point> cartes;//(HOKUYO_ARRAY_SIZE);
+ std::vector<Shape_detect::Point> circle;
+
/**
* Calculation of lines intersection.
* @param point which pertains to line.