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 mapserver, and the datum property from `navsattransform_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!
Asked by agurman on 2019-05-05 20:24:52 UTC
Answers
May this helps you: https://github.com/ahhda/Map-Merge-Tool
Asked by MrCheesecake on 2019-08-14 12:04:36 UTC
Comments
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.
Asked by Zeken on 2019-05-05 21:25:08 UTC
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
Asked by agurman on 2019-05-05 23:19:21 UTC
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?
Asked by Zeken on 2019-05-06 20:10:14 UTC
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 coordinates by that origin. If i change the maps origin (bottom left corner) things no longer line up as they should. So if i want to merge a map, and hence increase the size of a map, i need a way to calculate this origin difference
Asked by agurman on 2019-05-07 00:01:10 UTC
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.
Asked by Manmeeth on 2019-12-13 11:08:05 UTC