15 #include <robottype.h>
16 #include <roboorte_robottype.h>
21 // debug mode with connect Hokuyo
24 #define LINE_MIN_POINTS 7
25 #define LINE_ERROR_THRESHOLD 20
26 #define MAX_DISTANCE_POINT 300
33 typedef struct {float a,b,c;} General_form; // Line equation - General form
34 typedef struct {float x,y;} Point;
35 typedef struct {Point a,b;} Line;
37 void shape_detect(const std::vector<int> &input_data, std::vector<Line> &lines);
43 void plot_line(int begin, int end, int maxdist, std::vector<Point> &cartes, std::vector<Line> &lines);
44 void plot_shape_detect(std::vector<Line> &lines, std::vector<Point> &cartes);
48 inline Point intersection_line(const Point point, const General_form gen);
50 int perpendicular_regression(float &r, const int begin, const int end, std::vector<Point> &cartes, General_form &gen);
52 void line_fitting(int begin, int end, std::vector<Point> &cartes, std::vector<Line> &lines);
54 void polar_to_cartes(const std::vector<int> &input_data, std::vector<Point> &cartes);
56 inline float point_distance(Point a, Point b);
59 #endif // SHAPE_DETECT