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
5c3d924e
Commit
5c3d924e
authored
10 years ago
by
vvaquero
Browse files
Options
Downloads
Patches
Plain Diff
changes on the object structure
parent
121a2a5c
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/entities.cpp
+17
-0
17 additions, 0 deletions
src/entities.cpp
src/entities.h
+29
-2
29 additions, 2 deletions
src/entities.h
src/object_detector.cpp
+164
-211
164 additions, 211 deletions
src/object_detector.cpp
src/object_detector.h
+22
-26
22 additions, 26 deletions
src/object_detector.h
with
232 additions
and
239 deletions
src/entities.cpp
+
17
−
0
View file @
5c3d924e
...
@@ -15,6 +15,13 @@ void laserscanutils::Line::print() const
...
@@ -15,6 +15,13 @@ void laserscanutils::Line::print() const
<<
" number of points: "
<<
np_
<<
std
::
endl
;
<<
" number of points: "
<<
np_
<<
std
::
endl
;
}
}
float
laserscanutils
::
Line
::
length
()
{
return
(
std
::
sqrt
(
std
::
pow
(
(
this
->
point_last_
(
0
)
-
this
->
point_first_
(
0
)),
2
)
+
std
::
pow
(
(
this
->
point_last_
(
1
)
-
this
->
point_first_
(
1
)),
2
)
)
);
}
void
laserscanutils
::
Corner
::
print
()
const
void
laserscanutils
::
Corner
::
print
()
const
{
{
std
::
cout
<<
"Corner Parameters : "
<<
std
::
endl
std
::
cout
<<
"Corner Parameters : "
<<
std
::
endl
...
@@ -73,3 +80,13 @@ void laserscanutils::Object::print() const
...
@@ -73,3 +80,13 @@ void laserscanutils::Object::print() const
}
}
float
laserscanutils
::
Object
::
getArea
()
{
return
this
->
size_x_
*
this
->
size_y_
;
}
float
laserscanutils
::
Object
::
getPerimeter
()
{
return
(
(
this
->
size_x_
*
2
)
+
(
this
->
size_y_
*
2
)
);
}
This diff is collapsed.
Click to expand it.
src/entities.h
+
29
−
2
View file @
5c3d924e
...
@@ -24,6 +24,7 @@ namespace laserscanutils
...
@@ -24,6 +24,7 @@ namespace laserscanutils
//just a print method
//just a print method
void
print
()
const
;
void
print
()
const
;
float
length
();
};
};
struct
Corner
struct
Corner
...
@@ -68,6 +69,19 @@ namespace laserscanutils
...
@@ -68,6 +69,19 @@ namespace laserscanutils
this
->
ref_act_point_
=
{
0.0
,
0.0
,
0.0
};
this
->
ref_act_point_
=
{
0.0
,
0.0
,
0.0
};
this
->
ref_old_point_
=
{
0.0
,
0.0
,
0.0
};
this
->
ref_old_point_
=
{
0.0
,
0.0
,
0.0
};
this
->
min_x_
=
1000.0
;
this
->
min_y_
=
1000.0
;
this
->
max_x_
=
-
1000.0
;
this
->
max_y_
=
-
1000.0
;
this
->
angle_
=
0.0
;
this
->
orientation_
=
0.0
;
this
->
object_center_
<<
0.0
,
0.0
;
this
->
size_x_
=
0.0
;
this
->
size_y_
=
0.0
;
// this->polyline_points_ << 0.0, 0.0, 0.0, 0.0, 0.0,
// 0.0, 0.0, 0.0, 0.0, 0.0;
this
->
ref_type_
=
-
1
;
this
->
ref_type_
=
-
1
;
this
->
ref_position_
=
-
1
;
this
->
ref_position_
=
-
1
;
...
@@ -84,15 +98,26 @@ namespace laserscanutils
...
@@ -84,15 +98,26 @@ namespace laserscanutils
// Eigen::Vector2f linear_velocity_; // WRT??
// Eigen::Vector2f linear_velocity_; // WRT??
// Eigen::Vector2f angular_velocity_; // WRT??
// Eigen::Vector2f angular_velocity_; // WRT??
ScalarT
id_
;
// Id of the object. -1 if unknown
ScalarT
id_
;
// Id of the object. -1 if unknown
or MOBILE; other number if pre-associated.
// Description
// Description
ScalarT
area_
;
Eigen
::
Vector3s
ref_middle_point_
;
Eigen
::
Vector3s
ref_middle_point_
;
Eigen
::
Vector3s
ref_centroid_point_
;
Eigen
::
Vector3s
ref_centroid_point_
;
Eigen
::
Vector3s
ref_act_point_
;
Eigen
::
Vector3s
ref_act_point_
;
Eigen
::
Vector3s
ref_old_point_
;
Eigen
::
Vector3s
ref_old_point_
;
float
min_x_
;
float
min_y_
;
float
max_x_
;
float
max_y_
;
float
angle_
;
float
orientation_
;
float
size_x_
;
float
size_y_
;
Eigen
::
Vector2s
object_center_
;
Eigen
::
MatrixXs
polyline_points_
;
//<float,2,5>
int
ref_type_
;
// Type of the reference. 8 = corner; 4 = init_line ; 2 = end_line; 1 = centroid. -1 = unkonwn;
int
ref_type_
;
// Type of the reference. 8 = corner; 4 = init_line ; 2 = end_line; 1 = centroid. -1 = unkonwn;
int
ref_position_
;
// The position of the referenced corner (or line) in its corresponding list;
int
ref_position_
;
// The position of the referenced corner (or line) in its corresponding list;
...
@@ -100,6 +125,8 @@ namespace laserscanutils
...
@@ -100,6 +125,8 @@ namespace laserscanutils
// TODO: Bounding Box
// TODO: Bounding Box
void
print
()
const
;
void
print
()
const
;
float
getArea
();
float
getPerimeter
();
};
};
...
...
This diff is collapsed.
Click to expand it.
src/object_detector.cpp
+
164
−
211
View file @
5c3d924e
This diff is collapsed.
Click to expand it.
src/object_detector.h
+
22
−
26
View file @
5c3d924e
...
@@ -65,7 +65,7 @@ namespace laserscanutils
...
@@ -65,7 +65,7 @@ namespace laserscanutils
unsigned
int
scan_total_points_
;
//Total number of points in the raw scan
unsigned
int
scan_total_points_
;
//Total number of points in the raw scan
unsigned
int
filtered_total_points_
;
//Total number of valid points after pre filter
unsigned
int
filtered_total_points_
;
//Total number of valid points after pre filter
unsigned
int
number_of_clusters_
;
//Total number of clusters found in the scan
unsigned
int
number_of_clusters_
;
//Total number of clusters found in the scan
(valid and not valid)
unsigned
int
num_points_in_clusters_
;
// Total number of points in the clusters
unsigned
int
num_points_in_clusters_
;
// Total number of points in the clusters
unsigned
int
number_of_valid_clusters_
;
//Total number of valid clusters found in the scan
unsigned
int
number_of_valid_clusters_
;
//Total number of valid clusters found in the scan
unsigned
int
number_of_global_scan_
;
//Total number scan till now
unsigned
int
number_of_global_scan_
;
//Total number scan till now
...
@@ -204,44 +204,40 @@ namespace laserscanutils
...
@@ -204,44 +204,40 @@ namespace laserscanutils
//
/** \brief Calculate Features
/** \brief Calculate Features
//
*
*
//
* Calculate middle point, centroid, length, with, area...
* Calculate middle point, centroid, length, with, area...
//
*
*
//
* \param _alg_params is the structure of algorithm params for the Laser Object Detection Algorithm.
* \param _alg_params is the structure of algorithm params for the Laser Object Detection Algorithm.
//
* \param _points is the returned points from the conversion of ranges to homogeneous coordinates
* \param _points is the returned points from the conversion of ranges to homogeneous coordinates
//
* \param _global_scan_number is the global number of scan processed (to be used as header id)
* \param _global_scan_number is the global number of scan processed (to be used as header id)
//
* \param _scan_processed is the structure where all the information of elements in a scan is stored
* \param _scan_processed is the structure where all the information of elements in a scan is stored
//
*
*
//
**/
**/
//
void extractFeaturesIn
Clusters
(const Eigen::MatrixXs & _points,
void
extractFeaturesIn
Object
(
const
Eigen
::
MatrixXs
&
_points
,
//
laserscanutils::LaserScanProcessed & _scan_processed
);
Object
&
_object
);
/** \brief Performs the
corner
association from two objects list
/** \brief Performs the association from two objects list
*
*
* From a list of objects of both previous and actual scans, computes the distances
from all corners
and find the
* From a list of objects of both previous and actual scans, computes the distances and find the
* closest (euclidean dist threshold) ones as associated.
* closest (euclidean dist threshold) ones as associated.
*
*
* \param _prev_objects_list is the objects list from the previous scan
* \param _act_objects_list is the objects list from the actual scan
* \param _asso_threshold is the euclidean distance threshold for associate corners.
* \param _obj_asso_results is the vector with the association values! Binary [corner | l_angle | l_init_pt | l_final_pt ].
*
*
**/
**/
// Old creates a vector but needs to be checked the structure...really is the solution? cross things....
void
associateObjectsPrim
(
std
::
list
<
laserscanutils
::
Object
>
&
_prev_objects_list
,
std
::
list
<
laserscanutils
::
Object
>
&
_act_objects_list
,
float
_threshold
,
float
_angle_thr
,
std
::
vector
<
int
>
&
_obj_asso_results
);
void
associateObjects
(
std
::
list
<
laserscanutils
::
Object
>
&
_prev_objects_list
,
void
associateObjects
(
std
::
list
<
laserscanutils
::
Object
>
&
_prev_objects_list
,
std
::
list
<
laserscanutils
::
Object
>
&
_act_objects_list
,
std
::
list
<
laserscanutils
::
Object
>
&
_act_objects_list
,
float
_corner_threshold
,
float
_angle_thr
,
float
_line_ext_threshold
);
float
_corner_threshold
,
float
_angle_thr
,
float
_line_ext_threshold
);
// /** \brief Fullfils the bounding boxes and rest of parameters on the detections.
// *
// **/
// void objectsBB(laserscanutils::LaserScanProcessed & _act_scan);
}
}
...
...
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