This package provides a 3D global map for multiple robots and the respective transformations between robots. It merges robots' individual maps based on the overlapping space in the maps and requires no dependencies on a particular SLAM or communication between the robots.
The ROS node can merge maps from the arbitrary number of robots. It expects maps from individual robots as ROS topics and does not impose any particular messaging between robots. If your run multiple robots under the same ROS master then map_merge_3d may work for you out-of-the-box, this makes it easy to setup a simulation experiment.
In the multi-robot exploration scenario your robots probably run multiple ROS masters and you need to setup a communication link between robots. Common solution might be multimaster_fkie. You need to provide maps from your robots on local topics (under the same master). Also if you want to distribute merged map and tf transformations back to robots your communication must take care of it.
map_merge_3d finds robot maps automatically and new robots can be added to the system at any time. 3D maps are expected as sensor_msgs/PointCloud2, other map messages are not supported.
Recommended topics names for robot maps are /robot1/map, /robot2/map etc. However the names are configurable. All robots are expected to publish map under <robot_namespace>/map, where topic name (map) is configurable, but must be the same for all robots. For each robot <robot_namespace> is of cause different, but it does not need to follow any pattern. Further, you can exclude some topics using robot_namespace parameter, to avoid merging unrelated point clouds.
Transformations between maps are estimated by feature-matching algorithm and therefore it is required to have sufficient amount of overlapping space between maps to make a high-probability match. If maps don't have enough overlapping space to make a solid match, merger might reject those matches.
Estimating transforms between maps is cpu-intesive so you might want to tune estimation_rate parameter to run the re-estimation less often.
map_merge_nodeProvides map merging services offered by this package. Dynamically looks for new robots in the system and merges their maps. Provides tf transforms.
Subscribed Topics<robot_namespace>/map (sensor_msgs/PointCloud2)
- Local map for a specific robot.
Published Topicsmap (sensor_msgs/PointCloud2)
- Merged map from all robots in the system.
NODE PARAMETERSParameters affecting general setup of the node.
- Name of robot map topic without namespaces (last component of the topic name). Only topics with this name are considered when looking for new maps to merge. This topics may be subject to further filtering (see below).
- Fixed part of the robot map topic. You can employ this parameter to further limit which topics are considered during dynamic lookup for robots. Only topics which contain (anywhere) this string are considered for lookup. Unlike robot_map_topic you are not limited by namespace logic. Topics are filtered using text-based search. Therefore robot_namespace does not need to be a ROS namespace, but it can contain slashes etc. This string must be a common part of all maps topic name (all robots for which you want to merge map).
- Topic name where merged map is published.
- Frame id (in tf tree) which is assigned to published merged map and used as reference frame for tf transforms.
- Rate in Hz. Basic frequency on which the node merges maps and publishes merged map. Increase this value if you want faster updates.
- Rate in Hz. Frequency on which this node discovers new robots (maps). Increase this value if you need more agile behaviour when adding new robots.
- Rate in Hz. Frequency on which this node re-estimates transformations between maps. Estimation is cpu-intensive, so you may wish to lower this value.
- Whether to publish estimated transforms in the tf tree. See below.
REGISTRATION PARAMETERSParameters affecting only registration algorithm used for estimating transformations between maps. These parameters should be defined in the same namespace as normal node parameters.
- Resolution used for the registration. Small value increases registration time.
- Radius for descriptors computation.
- Minimum number of neighbours for a point to be kept in the map during outliers pruning.
- Radius used for estimating normals.
- Type of keypoints used. Possible values are SIFT, HARRIS.
- Keypoints with lower response that this value are pruned. Lower this threshold when using Harris keypoints (you can set 0.0).
- Type of descriptors used. Possible values are PFH, PFHRGB, FPFH, RSD, SHOT, SC3D.
- Type of descriptors matching algorithm used. This algorithm is used for initial global match. Possible values are MATCHING, SAC_IA.
- Whether to refine estimated transformation with ICP or not.
- Inlier threshold used in RANSAC during estimation.
- Maximum distance for matched points to be considered the same point.
- Maximum iterations for RANSAC.
- Number of the nearest descriptors to consider for matching.
- The smallest change allowed until ICP convergence.
- Minimum confidence in the pair-wise transform estimate to be included in the map-merging graph. Pair-wise transformations with lower confidence are not considered when computing global transforms. Increase this value if you are having problems with invalid transforms being estimated. The confidence value is computed as a reciprocal of Euclidean distance between transformed maps.
- Resolution of the merged global map.
Provided tf Transformsworld → mapX_frame
- Transformation from the world frame (which name can be configured using world_frame parameter) to each of the maps. Each map must have a correct frame_id set (instead mapX_frame) in the sensor_msgs/PointCloud2 message. If the transformation could not be estimated, null transformation is published.
Alongside ROS node map_merge_3d provides command-line tools to work with point cloud maps saved in pcd files. Both tools accept any of the #REGISTRATION PARAMETERS.
The tools use PCL command-line parsing module. PCL command-line parsing has some limits (PCL users won't be surprised): it supports only --param value format, --param=value is not accepted. Unknown options are ignored. Options may be arbitrarily mixed with filenames. There are no short versions for parameters.
Tool for merging maps offline. Produces output.pcd with merged global map. This tool can merge arbitrary number of maps.
rosrun map_merge_3d map_merge_tool [--param value] map1.pcd map2.pcd [map3.pcd...]
For example to use SHOT descriptors with 3 maps:
rosrun map_merge_3d map_merge_tool --descriptor_type SHOT map1.pcd map2.pcd map3.pcd
Visualises pair-wise transform estimation between 2 maps. Uses PCL visualiser for the visualisation.
rosrun map_merge_3d registration_visualisation [--param value] map1.pcd map2.pcd
After one step of the estimation a visualisation window appears. You can freely navigate the point cloud, save a screenshot or camera parameters (press h to see all shortcuts). After the window is closed, estimation continues with the next phase and the next visualisation window appears. Details about estimation progress are printed to stdout.
This package was developed as part of my master thesis at Charles University in Prague.