ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

Merge multiple saved maps

Hey guys,

Does anyone know of any package, or method, to combine multiple saved maps. I am not talking about multi robot map merging here which is all i can seem to find on this topic! I simply have multiple maps from a few different sessions and areas of a site, i use the projected maps from the octomap_server ROS package and save them with map_saver. Upon starting the mapping i save the robots origin in world (UTM) coordinates, and then i can load a static map using map_server, and the datum property from navsat_transform_node for localisation in the map.

Now if i have multiple saved maps with different origins, how can i merge these into a single map (let's assume they have overlap)? The only solution i have been able to come up with is manually editing these maps in photoshop however because the size of the map changes so does the origin in the .yaml file and i can't work out how to calculate the difference in origins to change for the new map.

Any help would be appreciated!

edit retag close merge delete

Have you tried testing the map without changing the origin? As in taking the origin on one of the maps and using the origin? I am not too sure about this but I did try doing this before and I just used one of the map's origins and it did work for a while.

( 2019-05-05 21:25:08 -0600 )edit

Hey! thanks for the reply, unfortunately this doesnt work for me. If i have a map say, Map A, with some origin, and i go out and record another map say Map B, with another origin, if i then merge Map A with Map B in say photoshop as best i can by lining up features or overlap, and then use Map A's origin, because i have changed the pixel dimensions of Map A the robot is no longer localised correctly in the map

( 2019-05-05 23:19:21 -0600 )edit

Not sure if I am right but isn't the origin just the left bottom corner of the map in relation to the grid? I have tested this and I tried setting the origin to 0,0,0 and it just placed the left bottom corner of the map in the center of the grid (using rviz). So is your issue that the robot does not appear in the map? Or that it cannot move around in the map?

( 2019-05-06 20:10:14 -0600 )edit

You are correct, the origin of a map is the bottom left corner, this logic is fine, and based on the origin parameter in the maps yaml file, the position of the map is changed accordingly to that bottom left corner. Now say there was a black box exactly in the bottom left corner of some size 5x5 which marked the origin. If i then increase the size of this map so i can merge in another map, i am changing the "position" of the bottom left corner so now the black box is now somewhere in the middle of the map if you can visualize this. Now my robot's localization is done purely via GNSS positioning, so as soon as a i record a map, i save the origin in real world (x,y) coordinates, and upon navigating somewhere i set a datum parameter which offset's my ...(more)

( 2019-05-07 00:01:10 -0600 )edit

Hi, I am having trouble in figuring out how to merge saved maps in ROS. I have tried the "https://github.com/ahhda/Map-Merge-Tool" tool but no luck. Any help would be appreciated.

( 2019-12-13 10:08:05 -0600 )edit

Sort by » oldest newest most voted
more