diff --git a/src/corner_finder.cpp b/src/corner_finder.cpp index 73ac303629b3bfab70733add8836abdbb1d1e2ac..a8c747947ba14f4eda57a2728b49a5073c67ae02 100644 --- a/src/corner_finder.cpp +++ b/src/corner_finder.cpp @@ -13,5 +13,16 @@ CornerFinder::~CornerFinder() } +int CornerFinder::findCorners( const Eigen::MatrixXs & _points, std::list<laserscanutils::CornerPoint> & _corner_list) const +{ + //to be implemented by inherited class + return -1; +} + +int CornerFinder::findCorners( const std::list<laserscanutils::LineSegment> & _lines, std::list<laserscanutils::CornerPoint> & _corner_list) const +{ + //TODO +} + }//namespace diff --git a/src/corner_finder.h b/src/corner_finder.h index a1e743653ee00a4b5043a9ac92a640749825d191..c5b42722caf526e8bdd41f2337cd7a0c72f7b98e 100644 --- a/src/corner_finder.h +++ b/src/corner_finder.h @@ -5,6 +5,7 @@ #include "laser_scan_utils.h" //#include "laser_scan.h" #include "corner_point.h" +#include "line_segment.h" //std #include <list> @@ -35,9 +36,9 @@ class CornerFinder **/ ~CornerFinder(); - /** \brief Find corners. Pure virtual. To be implemented by each inherited class + /** \brief Find corners from points. To be implemented by each inherited class. * - * Find corners from a set of scans. + * Find corners from a set of points. * Returns corners as a std::list<CornerPoint> * * \Requires: @@ -47,12 +48,30 @@ class CornerFinder * \param _corner_list set of corners extracted from _points * \return Number of corners extracted, or -1 if some error * + * \note Not pure virtual to allow instantation of this class + * */ virtual int findCorners( const Eigen::MatrixXs & _points, - std::list<laserscanutils::CornerPoint> & _corner_list) const = 0; + std::list<laserscanutils::CornerPoint> & _corner_list) const; // virtual int findCorners(const laserscanutils::LaserScan & _scan, // std::list<laserscanutils::CornerPoint> & _corner_list) = 0; - + + /** \brief Find corners from lines. + * + * Find corners from a set of lines. + * Returns corners as a std::list<CornerPoint> + * + * \Requires: + * \param _lines: List of input lines + * + * \Provides: + * \param _corner_list set of corners extracted from _lines + * \return Number of corners extracted, or -1 if some error + * + */ + virtual int findCorners( const std::list<laserscanutils::LineSegment> & _lines, + std::list<laserscanutils::CornerPoint> & _corner_list) const; + /** \brief Print things * * Print things about this class diff --git a/src/line_finder_iterative.cpp b/src/line_finder_iterative.cpp index bf0129280a64bbe55ca836a61ea090b724aebe70..2e8016008d8ab22111dc669027c81a1c9deb700f 100644 --- a/src/line_finder_iterative.cpp +++ b/src/line_finder_iterative.cpp @@ -57,7 +57,7 @@ unsigned int LineFinderIterative::findLines( const Eigen::MatrixXs & _points, st //split _points into two subsets and call findLines again for each one, if enough points in the subset if ( max_ii >= ilf_params_.min_supports_ ) { - this->findLines(_points.block(0,0,3,max_ii), _line_list); + this->findLines(_points.block(0,0,3,max_ii+1), _line_list); } if ( _points.cols()-max_ii >= ilf_params_.min_supports_ ) {