Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_ground_segmentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Iván del Pino
iri_ground_segmentation
Commits
bc80551e
Commit
bc80551e
authored
1 year ago
by
Iván del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Finished semantickitti2bag integration
parent
0554c0ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
launch/iri_ground_segmentation.launch
+1
-1
1 addition, 1 deletion
launch/iri_ground_segmentation.launch
src/ground_segmentation_alg_node.cpp
+67
-21
67 additions, 21 deletions
src/ground_segmentation_alg_node.cpp
with
68 additions
and
22 deletions
launch/iri_ground_segmentation.launch
+
1
−
1
View file @
bc80551e
<?xml version="1.0"?>
<launch>
<env
name=
"LIBGL_ALWAYS_SOFTWARE"
value=
"1"
/>
<env
name=
"LIBGL_ALWAYS_SOFTWARE"
value=
"1"
/>
<!-- for running the rviz in virtual box, comment this if you do not use a VM-->
<rosparam
command=
"load"
file=
"$(find iri_ground_segmentation)/params/iri_ground_segmentation.yaml"
/>
<remap
from=
"/iri_ground_segmentation/lidar_points"
to=
"/kitti/velo/pointcloud"
/>
<remap
from=
"/iri_ground_segmentation/ground_truth_lidar_points"
to=
"/velodyne_points"
/>
...
...
This diff is collapsed.
Click to expand it.
src/ground_segmentation_alg_node.cpp
+
67
−
21
View file @
bc80551e
...
...
@@ -138,8 +138,7 @@ GroundSegmentationAlgNode::GroundSegmentationAlgNode(void) :
"GroundSegmentationAlgNode::GroundSegmentationAlgNode: param 'dataset_filename_with_global_path' not found"
);
}
else
this
->
alg_
.
filtering_configuration_
.
dataset_filename_with_global_path
=
config_
.
dataset_filename_with_global_path
;
this
->
alg_
.
filtering_configuration_
.
dataset_filename_with_global_path
=
config_
.
dataset_filename_with_global_path
;
if
(
!
this
->
private_node_handle_
.
getParam
(
"neural_net_filename_with_global_path"
,
this
->
config_
.
neural_net_filename_with_global_path
))
...
...
@@ -154,12 +153,10 @@ GroundSegmentationAlgNode::GroundSegmentationAlgNode(void) :
if
(
!
this
->
private_node_handle_
.
getParam
(
"neural_net_number_of_features"
,
this
->
config_
.
neural_net_number_of_features
))
{
ROS_WARN
(
"GroundSegmentationAlgNode::GroundSegmentationAlgNode: param 'neural_net_number_of_features' not found"
);
ROS_WARN
(
"GroundSegmentationAlgNode::GroundSegmentationAlgNode: param 'neural_net_number_of_features' not found"
);
}
else
this
->
alg_
.
filtering_configuration_
.
neural_net_number_of_features
=
config_
.
neural_net_number_of_features
;
this
->
alg_
.
filtering_configuration_
.
neural_net_number_of_features
=
config_
.
neural_net_number_of_features
;
if
(
!
this
->
private_node_handle_
.
getParam
(
"neural_net_number_of_neurons_in_hidden_layer"
,
this
->
config_
.
neural_net_number_of_neurons_in_hidden_layer
))
...
...
@@ -236,8 +233,8 @@ GroundSegmentationAlgNode::GroundSegmentationAlgNode(void) :
this
->
lidar_subscriber_
=
this
->
private_node_handle_
.
subscribe
(
"lidar_points"
,
1
,
&
GroundSegmentationAlgNode
::
cb_lidar
,
this
);
this
->
ground_truth_lidar_subscriber_
=
this
->
private_node_handle_
.
subscribe
(
"ground_truth_lidar_points"
,
1
,
&
GroundSegmentationAlgNode
::
cb_ground_truth_lidar
,
this
);
this
->
ground_truth_lidar_subscriber_
=
this
->
private_node_handle_
.
subscribe
(
"ground_truth_lidar_points"
,
1
,
&
GroundSegmentationAlgNode
::
cb_ground_truth_lidar
,
this
);
// [init publishers]
...
...
@@ -382,7 +379,7 @@ void GroundSegmentationAlgNode::storeHeaderForSync(void)
void
GroundSegmentationAlgNode
::
convertInputsToSuitableFormats
(
void
)
{
//std::cout << "GroundSegmentationAlgNode::convertInputsToSuitableFormats..." << std::endl;
if
(
flag_new_lidar_data_
)
if
(
flag_new_lidar_data_
)
{
this
->
rosPointCloudtoPCLPointCloud
(
lidar_ros_cloud_
,
xyzi_lidar_pcl_cloud_
);
...
...
@@ -432,7 +429,7 @@ void GroundSegmentationAlgNode::convertInputsToSuitableFormats(void)
// std::cout << "DATA_C_2_MEAN_INTENSITY = " << lidar_pcl_cloud_.points[100].data_c[DATA_C_2_MEAN_INTENSITY] << std::endl;
// std::cout << "DATA_C_3_ORIGINAL_INDEX = " << lidar_pcl_cloud_.points[100].data_c[DATA_C_3_ORIGINAL_INDEX] << std::endl;
if
(
flag_new_ground_truth_lidar_data_
)
if
(
flag_new_ground_truth_lidar_data_
)
{
this
->
rosPointCloudtoPCLPointCloud
(
lidar_ros_cloud_
,
ground_truth_pcl_cloud_
);
...
...
@@ -451,13 +448,63 @@ void GroundSegmentationAlgNode::convertInputsToSuitableFormats(void)
extended_point
.
data_n
[
DATA_N_2_Z_MEAN
]
=
UNKNOWN_MEAN
;
extended_point
.
data_n
[
DATA_N_3_Z_VARIANCE
]
=
UNKOWN_VARIANCE
;
// These three values are stored in data_c[0]
//extended_point.r = R_CLASS_UNKNOWN;
//extended_point.g = G_CLASS_UNKNOWN;
//extended_point.b = B_CLASS_UNKNOWN;
extended_point
.
rgb
=
regular_point
->
rgb
;
int
gt_label
=
regular_point
->
label
;
// We are only interester in ROAD, VEGETATION, SIDEWALK, TERRAIN and OBSTACLE classes, so we consolide them
// here. TODO: We leave this todo mark here, because maybe in the future we will want to work with more classes
if
(
gt_label
==
ROAD
||
gt_label
==
PARKING
||
gt_label
==
OTHER_GROUND
||
gt_label
==
LANE_MARKING
)
gt_label
=
ROAD
;
if
(
gt_label
!=
ROAD
&&
gt_label
!=
TERRAIN
&&
gt_label
!=
VEGETATION
&&
gt_label
!=
SIDEWALK
)
gt_label
=
CLASS_OBSTACLE
;
// Experimental thresholds to avoid reflected points in the Ego-Vehicle
if
((
extended_point
.
x
<
3.0
&&
extended_point
.
x
>
-
2.2
)
&&
(
extended_point
.
y
<
1.8
&&
extended_point
.
y
>
-
1.8
))
{
// These three values are stored in data_c[0]
extended_point
.
r
=
R_CLASS_OUTLIER
;
extended_point
.
g
=
G_CLASS_OUTLIER
;
extended_point
.
b
=
B_CLASS_OUTLIER
;
extended_point
.
data_c
[
DATA_C_1_ID_CLASS
]
=
(
float
)
OUTLIER
;
}
else
{
switch
(
gt_label
)
{
case
ROAD
:
extended_point
.
r
=
R_CLASS_ROAD
;
extended_point
.
g
=
G_CLASS_ROAD
;
extended_point
.
b
=
B_CLASS_ROAD
;
break
;
case
TERRAIN
:
extended_point
.
r
=
R_CLASS_TERRAIN
;
extended_point
.
g
=
G_CLASS_TERRAIN
;
extended_point
.
b
=
B_CLASS_TERRAIN
;
break
;
case
VEGETATION
:
extended_point
.
r
=
R_CLASS_VEGETATION
;
extended_point
.
g
=
G_CLASS_VEGETATION
;
extended_point
.
b
=
B_CLASS_VEGETATION
;
break
;
case
SIDEWALK
:
extended_point
.
r
=
R_CLASS_SIDEWALK
;
extended_point
.
g
=
G_CLASS_SIDEWALK
;
extended_point
.
b
=
B_CLASS_SIDEWALK
;
break
;
default:
extended_point
.
r
=
R_CLASS_KITTI_OBSTACLE
;
extended_point
.
g
=
G_CLASS_KITTI_OBSTACLE
;
extended_point
.
b
=
B_CLASS_KITTI_OBSTACLE
;
}
extended_point
.
data_c
[
DATA_C_1_ID_CLASS
]
=
(
float
)
CLASS_UNKNOWN
;
// We need this to be set to unknown for the algorithm to work
// We use the color information to get the ground truth
}
extended_point
.
data_c
[
DATA_C_1_ID_CLASS
]
=
(
float
)
regular_point
->
label
;
extended_point
.
data_c
[
DATA_C_3_ORIGINAL_INDEX
]
=
(
float
)
i
++
;
lidar_pcl_cloud_
.
points
.
push_back
(
extended_point
);
...
...
@@ -535,7 +582,6 @@ void GroundSegmentationAlgNode::publishAll(void)
// Visualization topics
this
->
ground_dense_reconstruction_publisher_
.
publish
(
this
->
ground_dense_reconstruction_ros_cloud_
);
visualization_msgs
::
Marker
markerD
;
markerD
.
header
=
common_header_
;
markerD
.
action
=
visualization_msgs
::
Marker
::
DELETEALL
;
...
...
@@ -723,11 +769,11 @@ void GroundSegmentationAlgNode::node_config_update(Config &config, uint32_t leve
std
::
cout
<<
"mahalanobis_threshold = "
<<
this
->
alg_
.
filtering_configuration_
.
mahalanobis_threshold
<<
std
::
endl
;
std
::
cout
<<
"score_threshold = "
<<
this
->
alg_
.
filtering_configuration_
.
score_threshold
<<
std
::
endl
;
std
::
cout
<<
"score_threshold = "
<<
this
->
alg_
.
filtering_configuration_
.
score_threshold
<<
std
::
endl
;
std
::
cout
<<
"use_neural_network = "
<<
this
->
alg_
.
filtering_configuration_
.
use_neural_network
<<
std
::
endl
;
std
::
cout
<<
"use_neural_network = "
<<
this
->
alg_
.
filtering_configuration_
.
use_neural_network
<<
std
::
endl
;
std
::
cout
<<
"extract_data_to_external_training_of_the_network = "
<<
this
->
alg_
.
filtering_configuration_
.
extract_data_to_external_training_of_the_network
<<
std
::
endl
;
...
...
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