Skip to content
Snippets Groups Projects
Commit 667cc813 authored by andreucm's avatar andreucm
Browse files

Working copy on stabilizing API for line/corner finders

parent 15fcdb01
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -13,5 +13,16 @@ CornerFinder::~CornerFinder() ...@@ -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 }//namespace
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "laser_scan_utils.h" #include "laser_scan_utils.h"
//#include "laser_scan.h" //#include "laser_scan.h"
#include "corner_point.h" #include "corner_point.h"
#include "line_segment.h"
//std //std
#include <list> #include <list>
...@@ -35,9 +36,9 @@ class CornerFinder ...@@ -35,9 +36,9 @@ class CornerFinder
**/ **/
~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> * Returns corners as a std::list<CornerPoint>
* *
* \Requires: * \Requires:
...@@ -47,12 +48,30 @@ class CornerFinder ...@@ -47,12 +48,30 @@ class CornerFinder
* \param _corner_list set of corners extracted from _points * \param _corner_list set of corners extracted from _points
* \return Number of corners extracted, or -1 if some error * \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, 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, // virtual int findCorners(const laserscanutils::LaserScan & _scan,
// std::list<laserscanutils::CornerPoint> & _corner_list) = 0; // 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 /** \brief Print things
* *
* Print things about this class * Print things about this class
......
...@@ -57,7 +57,7 @@ unsigned int LineFinderIterative::findLines( const Eigen::MatrixXs & _points, st ...@@ -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 //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_ ) 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_ ) if ( _points.cols()-max_ii >= ilf_params_.min_supports_ )
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment