Skip to content
Snippets Groups Projects
Commit d6684c06 authored by Andreu Corominas-Murtra's avatar Andreu Corominas-Murtra
Browse files

Just starting to tune again, with some comments

parent f41c1f3f
No related branches found
No related tags found
No related merge requests found
......@@ -12,9 +12,9 @@ void laserscanutils::Line::print() const
// << " first,last: " << first_ << " , " << last_ << std::endl
// << " first point: " << point_first_.transpose() << std::endl
// << " last point: " << point_last_.transpose() << std::endl
<< " number of points: " << np_ << std::endl
<< " range: " << range_ << std::endl
<< " theta: " << theta_ << std::endl;
<< "\tnumber of points: " << np_ << std::endl
<< "\trange: " << range_ << std::endl
<< "\ttheta: " << theta_ << std::endl;
}
float laserscanutils::Line::length()
......
......@@ -5,24 +5,30 @@
//laserscanutils
#include "laser_scan_utils.h"
//std
#include <iostream>
#include <list>
//TODO: .cpp with print() functions per each entity
namespace laserscanutils
{
/** \brief Line entity represents straight segments on the plane
*
* Line entity represents straight segments on the plane
* Several parameterizations can coexist, but no coherency check between them is performed.
* Not all parameterizations are required.
*
**/
struct Line
{
Eigen::Vector3s vector_; //homogeneous parameterization of the line: (a,b,c)^T -> ax+by+c=0
ScalarT error_; //sum of all distances from used points to line
unsigned int first_; //index of the range vector of the first point used
unsigned int last_; //index of the range vector of the last point used
Eigen::Vector3s vector_; //homogeneous parameterization of the line: (a,b,c)^T -> ax+by+c=0 TODO: rename to abc_
unsigned int first_; //corresponding index to the scan ranges of the first point used TODO: rename to idx_first_
unsigned int last_; //corresponding index to the scan ranges of the last point used TODO: rename to idx_last_
ScalarT error_; //sum of all distances from used points to line when fitting
Eigen::Vector3s point_first_; //homogeneous coordinates of the starting 2D point
Eigen::Vector3s point_last_; //homogeneous coordinates of the ending 2D point
unsigned int np_; // number of points of the line
double range_; //range component in polar coordinates
double theta_; //theta component in polar coordinates
//TODO: add an Eigen::Map to the supporting points ... but who ensures memory allocation of such points ???
unsigned int np_; // number of scan points supporting this line (through fitting, Hough voting, ...)
ScalarT range_; //range component in polar parameterization.
ScalarT theta_; //theta component in polar parameterization.
//just a print method
void print() const;
......
......@@ -204,8 +204,8 @@ unsigned int laserscanutils::extractLines(const laserscanutils::ScanParams & _pa
}
unsigned int laserscanutils::extractLinesHough( const std::vector<Eigen::MatrixXd> & _laser_cloud,
const ExtractLineParamsHough & _alg_params,
unsigned int laserscanutils::extractLinesHough( const std::vector<Eigen::MatrixXd> & _points,
const ExtractLinesHoughParams & _alg_params,
std::list<laserscanutils::Line> & _line_list )
{
double theta, range;
......
......@@ -14,7 +14,7 @@ namespace laserscanutils
* Set of tunning parameters for line extraction
*
*/
struct ExtractLineParams
struct ExtractLineParams //TODO rename to ExtractLinesParams
{
//members
ScalarT jump_dist_ut_; //Upper threshold in consecutive ranges to consider a jump
......@@ -34,7 +34,7 @@ namespace laserscanutils
* set of tunning parameters for the Hough transform line detection
*
**/
struct ExtractLineParamsHough
struct ExtractLinesHoughParams
{
double range_max_; //maximum allowed range for lines
double range_step_; //range step in the voting grid
......@@ -45,7 +45,11 @@ namespace laserscanutils
/** \brief Find the best fittig line given a set of points
*
* Find the best fittig line given a set of points
* Input points at each column of _points matrix
* \requires
* \param _points: 3xN matrix, set of points. Each column is a 2D point in homogeneous (x,y,1).
*
* \provides
* \param _line: a laserscanutils::Line object of the best fitting line in the Least Squares sense
*
**/
void fitLine(const Eigen::MatrixXs & _points, Line & _line);
......@@ -79,11 +83,8 @@ namespace laserscanutils
*
*
*/
// unsigned int extractLinesHough(const std::list<std::pair<laserscanutils::ScanParams,const std::vector<float> > > _laser_data,
// const ExtractLineParamsHough & _alg_params,
// std::list<laserscanutils::Line> & _line_list);
unsigned int extractLinesHough( const std::vector<Eigen::MatrixXd> & _laser_cloud,
const ExtractLineParamsHough & _alg_params,
unsigned int extractLinesHough( const std::vector<Eigen::MatrixXd> & _points,
const ExtractLinesHoughParams & _alg_params,
std::list<laserscanutils::Line> & _line_list);
......
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