}
}
-void Shape_detect::shape_detect(const unsigned short laser_scan[], std::vector<Shape_detect::Line> &lines)
+void Shape_detect::prepare(const unsigned short laser_scan[])
{
#ifdef GNUPLOT
gnuplot_init();
#endif
// polar coordinates to cartesian coordinates
- std::vector<Shape_detect::Point> cartes;
+ std::vector<Shape_detect::Point> cartes(HOKUYO_ARRAY_SIZE);
polar_to_cartes(laser_scan, cartes);
int cartes_size = cartes.size();
+}
+ void Shape_detect::line_detect(const unsigned short laser_scan[], std::vector<Shape_detect::Line> &lines)
+{
std::vector<Shape_detect::Point> arcs;
std::cout << "cartes: " << cartes_size << std::endl;
Point a; /**< start point from a line. */
Point b; /**< end point from a line. */
} Line;
+
+ typedef struct {
+ Point center;
+ } Arc;
+
+ void prepare(const unsigned short laser_scan[]);
+
/**
* There are detected line segments in input array of measured
* @param [out] &lines vector which contains detected lines.
* @ingroup shapedet
*/
- void shape_detect(const unsigned short laser_scan[], std::vector<Line> &lines);
+ void line_detect(std::vector<Line> &lines);
+ void arc_detect(std::vector<Arc> &lines);
private:
/**