Skip to content

Commit 14af4bb

Browse files
wep21Taichi Higashidetkimura4
authored
feat: move elevation map loader (#740) (#136)
* feat: Move elevation map loader (#740) Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp> * Update perception/elevation_map_loader/README.md Co-authored-by: Tomoya Kimura <tomoya.kimura@tier4.jp> * Update perception/elevation_map_loader/README.md Co-authored-by: Tomoya Kimura <tomoya.kimura@tier4.jp> * Update perception/elevation_map_loader/README.md Co-authored-by: Tomoya Kimura <tomoya.kimura@tier4.jp> Co-authored-by: Taichi Higashide <taichi.higashide@tier4.jp> Co-authored-by: Tomoya Kimura <tomoya.kimura@tier4.jp>
1 parent 2ef6fd3 commit 14af4bb

File tree

12 files changed

+297
-288
lines changed

12 files changed

+297
-288
lines changed

map/map_loader/CMakeLists.txt

-12
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ rclcpp_components_register_node(pointcloud_map_loader_node
2626
EXECUTABLE pointcloud_map_loader
2727
)
2828

29-
ament_auto_add_library(elevation_map_loader_node SHARED
30-
src/elevation_map_loader/elevation_map_loader_node.cpp
31-
)
32-
target_link_libraries(elevation_map_loader_node ${PCL_LIBRARIES})
33-
34-
rclcpp_components_register_node(elevation_map_loader_node
35-
PLUGIN "ElevationMapLoaderNode"
36-
EXECUTABLE elevation_map_loader
37-
)
38-
3929
ament_auto_add_library(lanelet2_map_loader_node SHARED
4030
src/lanelet2_map_loader/lanelet2_map_loader_node.cpp
4131
)
@@ -66,6 +56,4 @@ endif()
6656

6757
ament_auto_package(INSTALL_TO_SHARE
6858
launch
69-
config
70-
data
7159
)

map/map_loader/README.md

-111
Original file line numberDiff line numberDiff line change
@@ -52,114 +52,3 @@ lanelet2_map_visualization visualizes autoware_lanelet2_msgs/MapBin messages int
5252
### Published Topics
5353

5454
- ~output/lanelet2_map_marker (visualization_msgs/MarkerArray) : visualization messages for RViz
55-
56-
---
57-
58-
## elevation_map_loader
59-
60-
### Feature
61-
62-
Generate elevation_map from subscribed pointcloud_map and vector_map and publish it.
63-
Save the generated elevation_map locally and load it from next time.
64-
65-
The elevation value of each cell is the average value of z of the points of the lowest cluster.
66-
Cells with No elevation value can be inpainted using the values of neighboring cells.
67-
68-
<p align="center">
69-
<img src="./media/elevation_map.png" width="1500">
70-
</p>
71-
72-
### How to run
73-
74-
`ros2 run map_loader elevation_map_loader --ros-args -p param_file_path:=path/to/elevation_map_parameters.yaml -p elevation_map_directory:=path/to/elevation_map_directory -p pointcloud_map_path:=path/to/pointcloud.pcd`
75-
76-
### Subscribed Topics
77-
78-
- input/pointcloud_map (sensor_msgs:PointCloud2) : PointCloud Map
79-
- input/vector_map (autoware_lanelet2_msgs/MapBin) : binary data of Lanelet2 Map
80-
81-
### Published Topics
82-
83-
- output/elevation_map (grid_map_msgs/GridMap) : Elevation Map
84-
- output/elevation_map_cloud (sensor_msgs:PointCloud2) : Pointcloud generated from the value of Elevation Map
85-
86-
### Parameter description
87-
88-
#### ROS parameters
89-
90-
| Name | Type | Description | Default value |
91-
| :-------------------------------- | :---------- | :--------------------------------------------------------------------------------------------------------- | :------------ |
92-
| map_layer_name | std::string | elevation_map layer name | elevation |
93-
| param_file_path | std::string | GridMap parameters config | path_default |
94-
| elevation_map_file_path | std::string | elevation_map file (bag2) | path_default |
95-
| map_frame | std::string | map_frame when loading elevation_map file | map |
96-
| use_inpaint | bool | Whether to inpaint empty cells | true |
97-
| inpaint_radius | float | Radius of a circular neighborhood of each point inpainted that is considered by the algorithm [m] | 0.3 |
98-
| use_elevation_map_cloud_publisher | bool | Whether to publish `output/elevation_map_cloud` | false |
99-
| use_lane_filter | bool | Whether to filter elevation_map with vector_map | false |
100-
| lane_margin | float | Value of how much to expand the range of vector_map [m] | 0.5 |
101-
| lane_height_diff_thresh | float | Only point clouds in the height range of this value from vector_map are used to generate elevation_map [m] | 1.0 |
102-
| lane_filter_voxel_size_x | float | Voxel size x for calculating point clouds in vector_map [m] | 0.04 |
103-
| lane_filter_voxel_size_y | float | Voxel size y for calculating point clouds in vector_map [m] | 0.04 |
104-
| lane_filter_voxel_size_z | float | Voxel size z for calculating point clouds in vector_map [m] | 0.04 |
105-
106-
#### GridMap parameters
107-
108-
The parameters are described on `config/elevation_map_parameters.yaml`.
109-
110-
##### General parameters
111-
112-
| Name | Type | Description | Default value |
113-
| :--------------------------------------------- | :--- | :----------------------------------------------------------------------------------------------------------- | :------------ |
114-
| pcl_grid_map_extraction/num_processing_threads | int | Number of threads for processing grid map cells. Filtering of the raw input point cloud is not parallelized. | 12 |
115-
116-
##### Grid map parameters
117-
118-
See: <https://github.com/ANYbotics/grid_map/tree/ros2/grid_map_pcl>
119-
120-
Resulting grid map parameters.
121-
122-
| Name | Type | Description | Default value |
123-
| :------------------------------------------------------- | :---- | :----------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
124-
| pcl_grid_map_extraction/grid_map/min_num_points_per_cell | int | Minimum number of points in the point cloud that have to fall within any of the grid map cells. Otherwise the cell elevation will be set to NaN. | 3 |
125-
| pcl_grid_map_extraction/grid_map/resolution | float | Resolution of the grid map. Width and length are computed automatically. | 0.3 |
126-
127-
#### Point Cloud Pre-processing Parameters
128-
129-
##### Rigid body transform parameters
130-
131-
Rigid body transform that is applied to the point cloud before computing elevation.
132-
133-
| Name | Type | Description | Default value |
134-
| :-------------------------------------------------- | :---- | :---------------------------------------------------------------------------------------------------------------------- | :------------ |
135-
| pcl_grid_map_extraction/cloud_transform/translation | float | Translation (xyz) that is applied to the input point cloud before computing elevation. | 0.0 |
136-
| pcl_grid_map_extraction/cloud_transform/rotation | float | Rotation (intrinsic rotation, convention X-Y'-Z'') that is applied to the input point cloud before computing elevation. | 0.0 |
137-
138-
##### Cluster extraction parameters
139-
140-
Cluster extraction is based on pcl algorithms. See <https://pointclouds.org/documentation/tutorials/cluster_extraction.html> for more details.
141-
142-
| Name | Type | Description | Default value |
143-
| :----------------------------------------------------------- | :---- | :------------------------------------------------------------------------------------- | :------------ |
144-
| pcl_grid_map_extraction/cluster_extraction/cluster_tolerance | float | Distance between points below which they will still be considered part of one cluster. | 0.2 |
145-
| pcl_grid_map_extraction/cluster_extraction/min_num_points | int | Min number of points that a cluster needs to have (otherwise it will be discarded). | 3 |
146-
| pcl_grid_map_extraction/cluster_extraction/max_num_points | int | Max number of points that a cluster can have (otherwise it will be discarded). | 1000000 |
147-
148-
##### Outlier removal parameters
149-
150-
See <https://pointclouds.org/documentation/tutorials/statistical_outlier.html> for more explanation on outlier removal.
151-
152-
| Name | Type | Description | Default value |
153-
| :--------------------------------------------------------- | :---- | :----------------------------------------------------------------------------- | :------------ |
154-
| pcl_grid_map_extraction/outlier_removal/is_remove_outliers | float | Whether to perform statistical outlier removal. | false |
155-
| pcl_grid_map_extraction/outlier_removal/mean_K | float | Number of neighbours to analyze for estimating statistics of a point. | 10 |
156-
| pcl_grid_map_extraction/outlier_removal/stddev_threshold | float | Number of standard deviations under which points are considered to be inliers. | 1.0 |
157-
158-
##### Subsampling parameters
159-
160-
See <https://pointclouds.org/documentation/tutorials/voxel_grid.html> for more explanation on point cloud downsampling.
161-
162-
| Name | Type | Description | Default value |
163-
| :------------------------------------------------------- | :---- | :-------------------------------------- | :------------ |
164-
| pcl_grid_map_extraction/downsampling/is_downsample_cloud | bool | Whether to perform downsampling or not. | false |
165-
| pcl_grid_map_extraction/downsampling/voxel_size | float | Voxel sizes (xyz) in meters. | 0.02 |

map/map_loader/package.xml

-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@
1313
<depend>autoware_auto_mapping_msgs</depend>
1414
<depend>autoware_utils</depend>
1515
<depend>geometry_msgs</depend>
16-
<depend>grid_map_cv</depend>
17-
<depend>grid_map_pcl</depend>
18-
<depend>grid_map_ros</depend>
19-
<depend>hash_library_vendor</depend>
2016
<depend>lanelet2_extension</depend>
2117
<depend>libpcl-all-dev</depend>
22-
<depend>nlohmann-json-dev</depend>
2318
<depend>pcl_conversions</depend>
2419
<depend>rclcpp</depend>
2520
<depend>rclcpp_components</depend>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(elevation_map_loader)
3+
4+
if(NOT CMAKE_CXX_STANDARD)
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_CXX_EXTENSIONS OFF)
8+
endif()
9+
10+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
11+
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
12+
endif()
13+
14+
find_package(PCL REQUIRED COMPONENTS io)
15+
16+
find_package(ament_cmake_auto REQUIRED)
17+
ament_auto_find_build_dependencies()
18+
19+
ament_auto_add_library(elevation_map_loader_node SHARED
20+
src/elevation_map_loader_node.cpp
21+
)
22+
target_link_libraries(elevation_map_loader_node ${PCL_LIBRARIES})
23+
24+
rclcpp_components_register_node(elevation_map_loader_node
25+
PLUGIN "ElevationMapLoaderNode"
26+
EXECUTABLE elevation_map_loader
27+
)
28+
29+
if(BUILD_TESTING)
30+
find_package(ament_lint_auto REQUIRED)
31+
ament_lint_auto_find_test_dependencies()
32+
endif()
33+
34+
ament_auto_package(INSTALL_TO_SHARE
35+
launch
36+
config
37+
data
38+
)

0 commit comments

Comments
 (0)