Skip to content

Commit e1fa94e

Browse files
committed
initial commit
0 parents  commit e1fa94e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2715
-0
lines changed

CMakeLists.txt

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(groundgrid)
3+
4+
# use c++17
5+
SET(CMAKE_CXX_STANDARD 17)
6+
7+
######################################
8+
## Find catkin macros and libraries ##
9+
######################################
10+
11+
find_package(catkin REQUIRED COMPONENTS
12+
dynamic_reconfigure
13+
nodelet
14+
roscpp
15+
geometry_msgs
16+
pcl_ros
17+
pcl_conversions
18+
grid_map_core
19+
grid_map_ros
20+
grid_map_cv
21+
grid_map_filters
22+
grid_map_loader
23+
grid_map_msgs
24+
grid_map_rviz_plugin
25+
grid_map_visualization
26+
cv_bridge
27+
image_transport
28+
std_msgs
29+
sensor_msgs
30+
nav_msgs
31+
tf2
32+
tf2_ros
33+
tf2_msgs
34+
message_generation
35+
)
36+
37+
################################
38+
## include common CMake setup ##
39+
################################
40+
find_package(OpenCV REQUIRED)
41+
find_package(PCL REQUIRED COMPONENTS common)
42+
find_package(Eigen3 REQUIRED)
43+
44+
#######################################
45+
## dynamic_reconfigure configuration ##
46+
#######################################
47+
48+
generate_dynamic_reconfigure_options(
49+
cfg/GroundGrid.cfg
50+
)
51+
52+
################################################
53+
## Declare ROS messages, services and actions ##
54+
################################################
55+
add_service_files(
56+
FILES
57+
NextCloud.srv
58+
)
59+
60+
61+
## Generate added messages and services with any dependencies listed here
62+
generate_messages(
63+
DEPENDENCIES
64+
std_msgs
65+
)
66+
67+
###################################
68+
## catkin specific configuration ##
69+
###################################
70+
71+
catkin_package(
72+
INCLUDE_DIRS include
73+
LIBRARIES ${PROJECT_NAME}_lib
74+
CATKIN_DEPENDS
75+
dynamic_reconfigure
76+
nodelet
77+
)
78+
79+
###########
80+
## Build ##
81+
###########
82+
83+
## Specify additional locations of header files
84+
## Your package locations should be listed before other locations
85+
86+
include_directories(SYSTEM
87+
${catkin_INCLUDE_DIRS}
88+
include
89+
)
90+
91+
92+
#####################################################
93+
## Build library, node and nodelet of this package ##
94+
#####################################################
95+
96+
## Declare a cpp library
97+
add_library(${PROJECT_NAME}_lib
98+
src/GroundGrid.cpp
99+
)
100+
101+
## Add cmake target dependencies of the executable/library
102+
## as an example, message headers may need to be generated before nodes
103+
add_dependencies(${PROJECT_NAME}_lib
104+
${PROJECT_NAME}_gencfg
105+
)
106+
107+
## Specify libraries to link a library or executable target against
108+
target_link_libraries(${PROJECT_NAME}_lib
109+
${catkin_LIBRARIES}
110+
)
111+
112+
## Declare a cpp library
113+
add_library(${PROJECT_NAME}_groundsegmentation_lib
114+
src/GroundSegmentation.cpp
115+
)
116+
117+
## Add cmake target dependencies of the executable/library
118+
## as an example, message headers may need to be generated before nodes
119+
add_dependencies(${PROJECT_NAME}_groundsegmentation_lib
120+
${PROJECT_NAME}_gencfg
121+
)
122+
123+
## Specify libraries to link a library or executable target against
124+
target_link_libraries(${PROJECT_NAME}_groundsegmentation_lib
125+
${catkin_LIBRARIES}
126+
)
127+
128+
## determines target name as lib[name].so, here: libfub_dummy_nodelet.so
129+
## the library path in nodelet_plugins.xml refers to this file
130+
add_library(${PROJECT_NAME}_nodelet
131+
src/GroundGridNodelet.cpp
132+
)
133+
134+
add_dependencies(${PROJECT_NAME}_nodelet
135+
${PROJECT_NAME}_gencfg
136+
${catkin_EXPORTED_TARGETS}
137+
${PROJECT_NAME}_lib
138+
${PROJECT_NAME}_groundsegmentation_lib
139+
)
140+
141+
target_link_libraries(${PROJECT_NAME}_nodelet
142+
${catkin_LIBRARIES}
143+
${PROJECT_NAME}_lib
144+
${PROJECT_NAME}_groundsegmentation_lib
145+
)
146+
147+
## Declare a cpp executable
148+
add_executable(${PROJECT_NAME}_node
149+
src/GroundGridNode.cpp
150+
)
151+
152+
add_dependencies(${PROJECT_NAME}_node
153+
${PROJECT_NAME}_nodelet
154+
)
155+
156+
target_link_libraries(${PROJECT_NAME}_node
157+
${catkin_LIBRARIES}
158+
)
159+
160+
#############
161+
## Install ##
162+
#############
163+
164+
## Mark executables and/or libraries for installation
165+
install(
166+
TARGETS
167+
${PROJECT_NAME}_lib
168+
${PROJECT_NAME}_groundsegmentation_lib
169+
${PROJECT_NAME}_node
170+
${PROJECT_NAME}_nodelet
171+
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
172+
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
173+
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
174+
)
175+
176+
## Mark cpp header files for installation
177+
install(DIRECTORY include/${PROJECT_NAME}/
178+
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
179+
FILES_MATCHING PATTERN "*.h"
180+
)
181+
182+
183+
## Mark other files for installation (e.g. launch and bag files, etc.)
184+
install(
185+
DIRECTORY launch
186+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
187+
)
188+
189+
install(
190+
FILES nodelet_plugins.xml
191+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
192+
)
193+

LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Copyright 2023 Dahlem Center for Machine Learning and Robotics, Freie Universität Berlin
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Source code for the article "GroundGrid: LiDAR Point Cloud Ground Segmentation and Terrain Estimation"
2+
This repository contains the source code for the article "GroundGrid: LiDAR Point Cloud Ground Segmentation and Terrain Estimation" published in the IEEE Robotics and Automation Letters ([DOI: 10.1109/LRA.2023.3333233](https://doi.org/10.1109/lra.2023.3333233)).
3+
<p align="center">
4+
<img src="/res/img/teaser.gif" alt="Ground segmentation results"/>
5+
</p>
6+
7+
# Dependencies
8+
- ROS Noetic Ninjemys
9+
- catkin
10+
- roscpp
11+
- geometry_msgs
12+
- sensor_msgs
13+
- std_msgs
14+
- message_generation
15+
- message_runtime
16+
- velodyne_pointcloud
17+
- nodelet
18+
- dynamic_reconfigure
19+
- grid_map_core
20+
- grid_map_ros
21+
- grid_map_cv
22+
- grid_map_loader
23+
- grid_map_msgs
24+
- grid_map_rviz_plugin
25+
- grid_map_visualization
26+
- cv_bridge
27+
- pcl_ros
28+
29+
# Build
30+
```
31+
catkin build -DCMAKE_BUILD_TYPE=Release groundgrid
32+
```
33+
34+
# Launch
35+
## Playback
36+
```
37+
roslaunch groundgrid KITTIPlayback.launch directory:=/path/to/the/SemanticKITTI/dataset sequence:=0
38+
```
39+
40+
The launch file opens a RViz window which displays the segmentation results:
41+
<p align="center">
42+
<img src="/res/img/rviz.png" alt="SemanticKitti playback Rviz window"/>
43+
</p>
44+
45+
46+
## Ground Segmentation Evaluation
47+
```
48+
roslaunch groundgrid KITTIEvaluate.launch directory:=/path/to/the/SemanticKITTI/dataset sequence:=0
49+
```
50+
51+
This launch file evaluates the ground segmentation performance of GroundGrid and displays the results every 500 processed clouds.
52+
The final results are displayed upon receiving Ctrl+C in the terminal:
53+
```
54+
Stats
55+
Received 4540 point clouds. KITTI sequence 00.
56+
label nonground % ground % nonground total
57+
unlabeled 88.74% 11.26% 6512861 7339364
58+
outlier 42.51% 57.49% 121616 286056
59+
car 94.42% 5.58% 43078880 45622648
60+
bicycle 89.85% 10.15% 200919 223610
61+
motorcycle 95.39% 4.61% 500522 524684
62+
truck 97.61% 2.39% 416124 426308
63+
other-vehicle 96.34% 3.66% 1199946 1245564
64+
person 95.95% 4.05% 68227 71104
65+
bicyclist 100.00% 0.00% 5 5
66+
motorcyclist 0.00% 100.00% 0 8
67+
road 0.07% 99.93% 68465 95649669
68+
parking 0.45% 99.55% 37828 8450594
69+
sidewalk 0.91% 99.09% 716154 78601664
70+
other-ground 6.43% 93.57% 192 2985
71+
building 97.33% 2.67% 117586234 120810401
72+
fence 88.91% 11.09% 15821127 17793867
73+
other-structure 89.92% 10.08% 713791 793778
74+
lane-marking 0.16% 99.84% 171 109456
75+
vegetation 93.43% 6.57% 121595505 130139604
76+
trunk 97.88% 2.12% 4495649 4592878
77+
terrain 6.68% 93.32% 1939107 29038187
78+
pole 98.14% 1.86% 1819715 1854290
79+
traffic-sign 99.87% 0.13% 248254 248565
80+
other-object 89.59% 10.41% 4577201 5109077
81+
moving-car 96.48% 3.52% 245225 254183
82+
moving-bicyclist 98.23% 1.77% 155263 158054
83+
moving-person 96.51% 3.49% 85024 88099
84+
moving-motorcyclist 94.68% 5.32% 2011 2124
85+
moving-bus 98.26% 1.74% 902 918
86+
moving-other-vehicle 94.24% 5.76% 34090 36175
87+
Precision 96.05% 209090638 8607231
88+
Recall 98.70% 209090638 2761917
89+
F1 97.35% 8607231 2761917
90+
Accuracy 97.24% 400339747 411708895
91+
IoUg 94.84%
92+
```
93+

cfg/GroundGrid.cfg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python
2+
PACKAGE = "groundgrid"
3+
4+
from dynamic_reconfigure.parameter_generator_catkin import *
5+
6+
gen = ParameterGenerator()
7+
8+
gen.add("point_count_cell_variance_threshold", int_t, 0, "if a cell has at least this much points, the variance of just that cell is used instead of the variance of 3x3 or 5x5 patch", 10, 0, 30)
9+
gen.add("max_ring", int_t, 0, "maximum velodyne ring for ground detection consideration", 256, 0, 256)
10+
gen.add("groundpatch_detection_minimum_threshold", double_t, 0, "if the ground patch layer at a cell is below this value, a cell without the minimum point count can be classified as ground", 0.01, 0, 1.0)
11+
gen.add("distance_factor", double_t, 0, "compensates for the geometric dilution of the point density with the distance", 0.0001, 0, 0.01)
12+
gen.add("minimum_distance_factor", double_t, 0, "minimum value for the distance factor", 0.0005, 0, 0.01)
13+
gen.add("miminum_point_height_threshold", double_t, 0, "Points lower than ground height + threshold are considered ground points", 0.3, 0, 1)
14+
gen.add("minimum_point_height_obstacle_threshold", double_t, 0, "Points lower than ground height + threshold are considered ground points [m]", 0.1, 0, .2)
15+
gen.add("outlier_tolerance", double_t, 0, "Outlier detection tolerance [m]", 0.1, -.5, .5)
16+
gen.add("ground_patch_detection_minimum_point_count_threshold", double_t, 0, "Minimum point count for ground patch detection in percent of expected point count", 0.25, 0.01, 1.0)
17+
gen.add("patch_size_change_distance", double_t, 0, "Distance from the center from which on the patch size is increased [m]", 20, 0, 50)
18+
gen.add("occupied_cells_decrease_factor", double_t, 0, "Occupied cells decrease factor [100/x %]", 5.0, 1.0, 100.0)
19+
gen.add("occupied_cells_point_count_factor", double_t, 0, "Occupied cells point count factor [100/x %]", 20, 1, 50)
20+
gen.add("min_outlier_detection_ground_confidence", double_t, 0, "Minimum ground confidence to consider lower points an outlier (5x5 patch)", 1.25, 0, 5)
21+
gen.add("thread_count", int_t, 0, "Maximum number of threads", 8, 1, 64)
22+
23+
exit(gen.generate(PACKAGE, "groundgrid", "GroundGrid"))

0 commit comments

Comments
 (0)