Re: Realtime Map Merger Improvements
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Realtime-Map-Merger-Improvements-tp8200p8554.html
Hi Derek,
It is more efficient to subscribe to mapData from rtabmapviz than the raw point clouds. The mapData contains only data (compressed) from the latest frame added to map. rtabmapviz will accumulate them (in its cache) and reconstruct the 3d map on its side. On loop closure, the mapData contains the modified graph (which is only some KB of data) and rtabmapviz re-correct the position of each cloud previously received in its cache without having to re-download data of each node.
When subscribing to camera/point cloud data with rtabmapviz, it is only used to show the current data published by the robot at odometry rate. This is very similar to RVIZ and subscribing to robot's topics.
For multi robots, rtabmapviz cannot subscribe to more than one mapData stream. You would need as many rtabmapviz than the number of robots. To show the maps in a single visualizer, try RVIZ, which can use many rtabmap_ros/MapCloud plugins in parallel, each subscribing to different mapData topic. The only (major) problem you will have is that the TF tree should contain links between the map frames of the robots to visualize them at the same time:
<node pkg="tf" type="static_transform_publisher" name="world_map_robot1" args="0 0 0 0 0 0 world robot1/map 100" />
<node pkg="tf" type="static_transform_publisher" name="world_map_robot2" args="15 0 0 0 0 0 world robot2/map 100" />
then set /world as fixed frame in RVIZ global options. In this example, the map from robot2 will appear 15 meters in front of the map of robot 1. Configured this way, the maps are independent and may overlap if robot1 moves along x axis towards map of robot2. Ideally, the world->robotX/map transforms would not be static, but they would be published by a node trying to detect loop closures between the robot and adjust the transforms when this happens.
cheers,
Mathieu