Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(probablistic_occupancy_grid_map): add grid map fusion node to fuse multiple sensor based occupancy grid map #3107

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
857d117
rebase on to master
YoshiRi Mar 8, 2023
2db65a2
rebase to main
YoshiRi Mar 8, 2023
6570e04
fix config and launch file
YoshiRi Mar 10, 2023
b34c3cd
fixed laserscan based launcher
YoshiRi Mar 11, 2023
74c40dd
add filter func to extract obstacle pc in sensor
YoshiRi Mar 11, 2023
9f2b884
add switchable launcher
YoshiRi Mar 13, 2023
7095da9
back to pointcloud based method
YoshiRi Mar 16, 2023
2099169
add gridmap fusion node
YoshiRi Mar 15, 2023
14c5419
fix: settings for fusion and launch
YoshiRi Mar 17, 2023
eba38ae
fix: fix and refactor launch.py
YoshiRi Mar 17, 2023
cea427d
fix: fix grid map conversion problem
YoshiRi Mar 27, 2023
bd1a5eb
try approx time fusion
YoshiRi Mar 29, 2023
baf5e4d
enable to change origins by lanch args
YoshiRi Mar 31, 2023
cff248c
fix launch and separated config for fusion
YoshiRi Mar 31, 2023
4e9fc69
feat: fix concatenate pc compensation order
YoshiRi Apr 3, 2023
711aff4
feat: add transformed raw pc output to concat func
YoshiRi Apr 3, 2023
de2ee02
fix: concat pc to sync with oldest time stamp
YoshiRi Apr 6, 2023
05746ff
feat: changed ogm fusion settings
YoshiRi Apr 6, 2023
80e73ec
feat: add time sync node component
YoshiRi Apr 6, 2023
0e2f274
refactor: time synchronizer class
YoshiRi Apr 7, 2023
9dbe465
feat: add pc concatenate node
YoshiRi Apr 7, 2023
5000aea
rename existing concat node file
YoshiRi Apr 7, 2023
c910556
update concat_node launch to choose two methods
YoshiRi Apr 7, 2023
2af3ffc
fix: simulator.launch
YoshiRi Apr 10, 2023
060ac01
fix: fix fusion launch
YoshiRi Apr 11, 2023
b911f9c
fix: bug fix in grid map fusion
YoshiRi Apr 11, 2023
279c07a
refactor: add test for costmap conversion
YoshiRi Apr 11, 2023
b091c33
feat: add single frame fusion policies
YoshiRi Apr 14, 2023
39f6e35
feat: add debug information for evaluation
YoshiRi Apr 14, 2023
94d7f47
feat: add weight function
YoshiRi Apr 17, 2023
ea6f28f
feat: add fusion policy test
YoshiRi Apr 18, 2023
ff5d703
update launch file and node to run with yaml file
YoshiRi Apr 19, 2023
122927a
remove temporary parameters
YoshiRi Apr 19, 2023
4499d54
add escape to binary bayes filter
YoshiRi Apr 19, 2023
7855904
change multiframe fusion method to log-odds
YoshiRi Apr 20, 2023
eb8e7b5
Update readme
YoshiRi Apr 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<launch>
<!--default parameter follows node setting -->
<arg name="input/obstacle_pointcloud" default="concatenated/pointcloud"/>
<arg name="input/raw_pointcloud" default="no_ground/oneshot/pointcloud"/>
<arg name="output" default="/perception/occupancy_grid_map/map"/>
<arg name="use_intra_process" default="false"/>
<arg name="use_multithread" default="false"/>
<arg name="use_pointcloud_container" default="false"/>
<arg name="container_name" default="occupancy_grid_map_container"/>
<arg name="scan_origin" default="base_link"/>
<arg name="map_origin" default="base_link"/>

<!--default parameter follows node setting -->
<arg name="method" default="pointcloud_based_occupancy_grid_map"/>
<arg name="param_file" default="$(find-pkg-share probabilistic_occupancy_grid_map)/config/$(var method).param.yaml"/>

<!--pointcloud based method-->
<group if="$(eval &quot;'$(var method)'=='pointcloud_based_occupancy_grid_map'&quot;)">
<include file="$(find-pkg-share probabilistic_occupancy_grid_map)/launch/pointcloud_based_occupancy_grid_map.launch.py">
<arg name="input/obstacle_pointcloud" value="$(var input/obstacle_pointcloud)"/>
<arg name="input/raw_pointcloud" value="$(var input/raw_pointcloud)"/>
<arg name="output" value="$(var output)"/>
<arg name="use_intra_process" value="$(var use_intra_process)"/>
<arg name="use_multithread" value="$(var use_multithread)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="container_name" value="$(var container_name)"/>
<arg name="param_file" value="$(var param_file)"/>
<arg name="scan_origin" value="$(var scan_origin)"/>
<arg name="map_origin" value="$(var map_origin)"/>
</include>
</group>

<!--laserscan based method-->
<group if="$(eval &quot;'$(var method)'=='laserscan_based_occupancy_grid_map'&quot;)">
<include file="$(find-pkg-share probabilistic_occupancy_grid_map)/launch/laserscan_based_occupancy_grid_map.launch.py">
<arg name="input/obstacle_pointcloud" value="$(var input/obstacle_pointcloud)"/>
<arg name="input/raw_pointcloud" value="$(var input/raw_pointcloud)"/>
<arg name="output" value="$(var output)"/>
<arg name="use_intra_process" value="$(var use_intra_process)"/>
<arg name="use_multithread" value="$(var use_multithread)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
<arg name="container_name" value="$(var container_name)"/>
<arg name="param_file" value="$(var param_file)"/>
<arg name="scan_origin" value="$(var scan_origin)"/>
<arg name="map_origin" value="$(var map_origin)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@
<!-- occupancy grid map module -->
<group>
<push-ros-namespace namespace="occupancy_grid_map"/>
<include file="$(find-pkg-share tier4_perception_launch)/launch/occupancy_grid_map/pointcloud_based_occupancy_grid_map.launch.py">
<include file="$(find-pkg-share tier4_perception_launch)/launch/occupancy_grid_map/probabilistic_occupancy_grid_map.launch.xml">
<arg name="input/obstacle_pointcloud" value="/perception/obstacle_segmentation/single_frame/pointcloud_raw"/>
<arg name="input/raw_pointcloud" value="$(var input/pointcloud)"/>
<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="method" value="pointcloud_based_occupancy_grid_map"/>
<arg name="param_file" value="$(find-pkg-share probabilistic_occupancy_grid_map)/config/pointcloud_based_occupancy_grid_map.param.yaml"/>
</include>
</group>
Expand Down
6 changes: 4 additions & 2 deletions launch/tier4_simulator_launch/launch/simulator.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
<group unless="$(var scenario_simulation)">
<!-- Occupancy Grid -->
<push-ros-namespace namespace="occupancy_grid_map"/>
<include file="$(find-pkg-share tier4_perception_launch)/launch/occupancy_grid_map/laserscan_based_occupancy_grid_map.launch.py">
<include file="$(find-pkg-share tier4_perception_launch)/launch/occupancy_grid_map/probabilistic_occupancy_grid_map.launch.xml">
<arg name="input_obstacle_pointcloud" value="true"/>
<arg name="input_obstacle_and_raw_pointcloud" value="false"/>
<arg name="input/obstacle_pointcloud" value="/perception/obstacle_segmentation/pointcloud"/>
<arg name="output" value="/perception/occupancy_grid_map/map"/>
<arg name="param_file" value="$(find-pkg-share probabilistic_occupancy_grid_map)/config/laserscan_based_occupancy_grid_map.param.yaml"/>
<arg name="method" value="laserscan_based_occupancy_grid_map"/>
<arg name="map_origin" value="base_link"/>
<arg name="scan_origin" value="base_link"/>
</include>
</group>

Expand Down
30 changes: 30 additions & 0 deletions perception/probabilistic_occupancy_grid_map/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,36 @@ rclcpp_components_register_node(laserscan_based_occupancy_grid_map
EXECUTABLE laserscan_based_occupancy_grid_map_node
)

# GridMapFusionNode
ament_auto_add_library(grid_map_fusion SHARED
src/fusion/grid_map_fusion_node.cpp
src/fusion/single_frame_fusion_policy.cpp
src/pointcloud_based_occupancy_grid_map/occupancy_grid_map.cpp
src/updater/occupancy_grid_map_log_odds_bayes_filter_updater.cpp
src/utils/utils.cpp
)

target_link_libraries(grid_map_fusion
${PCL_LIBRARIES}
)

rclcpp_components_register_node(grid_map_fusion
PLUGIN "grid_map_fusion::GridMapFusionNode"
EXECUTABLE grid_map_fusion_node
)

# Tests
if(BUILD_TESTING)
ament_add_gtest(costmap_unit_tests
test/cost_value_test.cpp)
ament_add_gtest(fusion_policy_unit_tests
test/fusion_policy_test.cpp
src/fusion/single_frame_fusion_policy.cpp
)
target_include_directories(costmap_unit_tests PRIVATE "include")
target_include_directories(fusion_policy_unit_tests PRIVATE "include")
endif()

ament_auto_package(
INSTALL_TO_SHARE
launch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**:
ros__parameters:
map_length: 100.0 # [m]
map_resolution: 0.5 # [m]

use_height_filter: true
enable_single_frame_mode: true
# use sensor pointcloud to filter obstacle pointcloud
filter_obstacle_pointcloud_by_raw_pointcloud: true

# grid map coordinate
map_frame: "map"
base_link_frame: "base_link"
# center of the grid map
gridmap_origin_frame: "base_link"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# sample grid map fusion parameters for sample sensor kit
/**:
ros__parameters:
fusion_map_length_x: 100.0 # [m]
fusion_map_length_y: 100.0 # [m]
fusion_map_resolution: 0.5 # [m]

# Setting1: tune ogm creation parameters
obstacle_pointcloud_topic: "/perception/obstacle_segmentation/single_frame/pointcloud_raw"
each_raw_pointcloud_topics:
- "/sensing/lidar/top/outlier_filtered/pointcloud_synchronized"
- "/sensing/lidar/left/outlier_filtered/pointcloud_synchronized"
- "/sensing/lidar/right/outlier_filtered/pointcloud_synchronized"
each_ogm_output_topics:
- "/perception/occupancy_grid_map/top_lidar/map"
- "/perception/occupancy_grid_map/left_lidar/map"
- "/perception/occupancy_grid_map/right_lidar/map"
each_ogm_sensor_frames:
- "velodyne_top"
- "velodyne_left"
- "velodyne_right"
# reliability of each sensor (0.0 ~ 1.0) only work with "log-odds" and "dempster-shafer"
each_ogm_reliabilities:
- 1.0
- 0.6
- 0.6

# Setting2: tune ogm fusion parameters
## choose fusion method from ["overwrite", "log-odds", "dempster-shafer"]
fusion_method: "overwrite"

# grid map coordinate
map_frame: "map"
base_link_frame: "base_link"
# center of the grid map
gridmap_origin_frame: "base_link"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**:
ros__parameters:
map_length: 100.0 # [m]
map_resolution: 0.5 # [m]

use_height_filter: true
enable_single_frame_mode: true
# use sensor pointcloud to filter obstacle pointcloud
filter_obstacle_pointcloud_by_raw_pointcloud: true

# grid map coordinate
map_frame: "map"
base_link_frame: "base_link"
# center of the grid map
gridmap_origin_frame: "base_link"
# ray-tracing center: main sensor frame is preferable like: "velodyne_top"
scan_origin_frame: "base_link"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading