Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
laser_scan_utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
algorithms
laser_scan_utils
Commits
d6684c06
Commit
d6684c06
authored
9 years ago
by
Andreu Corominas-Murtra
Browse files
Options
Downloads
Patches
Plain Diff
Just starting to tune again, with some comments
parent
f41c1f3f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/entities.cpp
+3
-3
3 additions, 3 deletions
src/entities.cpp
src/entities.h
+15
-9
15 additions, 9 deletions
src/entities.h
src/line_detector.cpp
+2
-2
2 additions, 2 deletions
src/line_detector.cpp
src/line_detector.h
+9
-8
9 additions, 8 deletions
src/line_detector.h
with
29 additions
and
22 deletions
src/entities.cpp
+
3
−
3
View file @
d6684c06
...
...
@@ -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
;
<<
"
\t
number of points: "
<<
np_
<<
std
::
endl
<<
"
\t
range: "
<<
range_
<<
std
::
endl
<<
"
\t
theta: "
<<
theta_
<<
std
::
endl
;
}
float
laserscanutils
::
Line
::
length
()
...
...
This diff is collapsed.
Click to expand it.
src/entities.h
+
15
−
9
View file @
d6684c06
...
...
@@ -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 dist
an
c
es
from used points to line
unsigned
int
fir
st_
;
//index o
f
the
range vector
of the
fir
st 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 r
an
g
es
of the first point used TODO: rename to idx_first_
unsigned
int
la
st_
;
//
corresponding
index
t
o the
scan ranges
of the
la
st 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
;
...
...
This diff is collapsed.
Click to expand it.
src/line_detector.cpp
+
2
−
2
View file @
d6684c06
...
...
@@ -204,8 +204,8 @@ unsigned int laserscanutils::extractLines(const laserscanutils::ScanParams & _pa
}
unsigned
int
laserscanutils
::
extractLinesHough
(
const
std
::
vector
<
Eigen
::
MatrixXd
>
&
_
laser_cloud
,
const
ExtractLineParams
Hough
&
_alg_params
,
unsigned
int
laserscanutils
::
extractLinesHough
(
const
std
::
vector
<
Eigen
::
MatrixXd
>
&
_
points
,
const
ExtractLine
sHough
Params
&
_alg_params
,
std
::
list
<
laserscanutils
::
Line
>
&
_line_list
)
{
double
theta
,
range
;
...
...
This diff is collapsed.
Click to expand it.
src/line_detector.h
+
9
−
8
View file @
d6684c06
...
...
@@ -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
ExtractLineParams
Hough
struct
ExtractLine
sHough
Params
{
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment