Skip to content

Commit

Permalink
feat(probabilistic_occupancy_grid_map): add grid map fusion node (aut…
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiRi authored and soblin committed Jan 11, 2024
1 parent ac4ff34 commit 25b59a5
Show file tree
Hide file tree
Showing 19 changed files with 2,055 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<arg name="use_multithread" default="false"/>
<arg name="use_pointcloud_container" default="false"/>
<arg name="container_name" default="occupancy_grid_map_container"/>
<arg name="occupancy_grid_map_method" description="options: pointcloud_based_occupancy_grid_map, laserscan_based_occupancy_grid_map"/>
<arg name="occupancy_grid_map_method" description="options: pointcloud_based_occupancy_grid_map, laserscan_based_occupancy_grid_map, multi_lidar_pointcloud_based_occupancy_grid_map"/>
<arg name="occupancy_grid_map_param_path"/>
<arg name="occupancy_grid_map_updater" description="options: binary_bayes_filter"/>
<arg name="occupancy_grid_map_updater_param_path"/>
Expand Down Expand Up @@ -44,4 +44,18 @@
<arg name="updater_param_file" value="$(var occupancy_grid_map_updater_param_path)"/>
</include>
</group>

<!--multi lidar pointclouds based method-->
<group if="$(eval &quot;'$(var occupancy_grid_map_method)'=='multi_lidar_pointcloud_based_occupancy_grid_map'&quot;)">
<include file="$(find-pkg-share probabilistic_occupancy_grid_map)/launch/multi_lidar_pointcloud_based_occupancy_grid_map.launch.py">
<arg name="output" value="/perception/occupancy_grid_map/map"/>
<arg name="use_intra_process" value="true"/>
<arg name="use_multithread" value="true"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="container_name" value="$(var pointcloud_container_name)"/>
<arg name="multi_lidar_fusion_config_file" value="$(var occupancy_grid_map_param_path)"/>
<arg name="updater_type" value="$(var occupancy_grid_map_updater)"/>
<arg name="updater_param_file" value="$(var occupancy_grid_map_updater_param_path)"/>
</include>
</group>
</launch>
18 changes: 18 additions & 0 deletions perception/probabilistic_occupancy_grid_map/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@ rclcpp_components_register_node(laserscan_based_occupancy_grid_map
EXECUTABLE laserscan_based_occupancy_grid_map_node
)

# GridMapFusionNode
ament_auto_add_library(synchronized_grid_map_fusion SHARED
src/fusion/synchronized_grid_map_fusion_node.cpp
src/fusion/single_frame_fusion_policy.cpp
src/pointcloud_based_occupancy_grid_map/occupancy_grid_map_fixed.cpp
src/updater/occupancy_grid_map_log_odds_bayes_filter_updater.cpp
src/utils/utils.cpp
)

target_link_libraries(synchronized_grid_map_fusion
${PCL_LIBRARIES}
)

rclcpp_components_register_node(synchronized_grid_map_fusion
PLUGIN "synchronized_grid_map_fusion::GridMapFusionNode"
EXECUTABLE synchronized_grid_map_fusion_node
)

ament_auto_package(
INSTALL_TO_SHARE
launch
Expand Down
17 changes: 17 additions & 0 deletions perception/probabilistic_occupancy_grid_map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This package outputs the probability of having an obstacle as occupancy grid map

- [Pointcloud based occupancy grid map](pointcloud-based-occupancy-grid-map.md)
- [Laserscan based occupancy grid map](laserscan-based-occupancy-grid-map.md)
- [Grid map fusion](synchronized_grid_map_fusion.md)

## Settings

Expand Down Expand Up @@ -70,3 +71,19 @@ Additional argument is shown below:
| `container_name` | `occupancy_grid_map_container` | |
| `input_obstacle_pointcloud` | `false` | only for laserscan based method. If true, the node subscribe obstacle pointcloud |
| `input_obstacle_and_raw_pointcloud` | `true` | only for laserscan based method. If true, the node subscribe both obstacle and raw pointcloud |

### Test

This package provides unit tests using `gtest`.
You can run the test by the following command.

```bash
colcon test --packages-select probabilistic_occupancy_grid_map --event-handlers console_direct+
```

Test contains the following.

- Unit test for cost value conversion function
- Unit test for utility functions
- Unit test for occupancy grid map fusion functions
- Input/Output test for pointcloud based occupancy grid map
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**:
ros__parameters:
# 1. fusion parameters
fusion_input_ogm_topics: ["topic1", "topic2"]
input_ogm_reliabilities: [0.8, 0.2]
fusion_method: "overwrite" # choose from ["overwrite", "log-odds", "dempster-shafer"]

# 2. synchronization settings
match_threshold_sec: 0.01 # 10ms
timeout_sec: 0.1 # 100ms
input_offset_sec: [0.0, 0.0] # no offset

# 3. settings for fused fusion map
# remember resolution and map size should be same with input maps
map_frame_: "map"
base_link_frame_: "base_link"
grid_map_origin_frame_: "base_link"
fusion_map_length_x: 100.0
fusion_map_length_y: 100.0
fusion_map_resolution: 0.5
Loading

0 comments on commit 25b59a5

Please sign in to comment.