This ROS2 node subscribes to two different map messages, merges them, and publishes the merged map to the /merge_map topic.
The Merge Map ROS2 package is designed to merge map messages from /map1
and /map2
topics, and publish the merged map to the /merge_map
topic. To use this package, follow the instructions below:
- Copy the
merge_map
folder to thesrc
directory of your ROS2 workspace. - Run the following command:
ros2 launch merge_map merge_map_launch.py
This command starts the map merging node and opens an RViz2 window. - In the RViz2 window, you can observe the merged map. Whenever one of the maps being merged is updated, the
merge_map
node will also update the merged map accordingly.
Make sure to have ROS2 installed and properly configured in your environment before using this package. For more information, please refer to the ROS2 documentation.
The Merge Map ROS2 package can be customized and launched in your own launch.py
file by adding the following code block. You can update /yourMapName1
and /yourMapName2
topics according to your project:
Node(
package='merge_map',
executable='merge_map',
output='screen',
parameters=[{'use_sim_time': True}],
remappings=[
("/map1", "/yourMapName1"),
("/map2", "/yourMapName2"),
],
),