How to change the origin of the /map frame before mapping ?

asked 2021-07-01 07:31:30 -0600

charvi gravatar image

Hi everyone,

I am using slamtoolbox ros package to do the mapping of the environment. Whenever we start mapping, the /map frame and /odom frame are at origin and as the mapping continue, we get the tf between /map to /odom frame and after that we save the map using map_server. So here after saving the map in map.yaml file the origin is the coortinate of the bottom left cell in the /map frame. But now I have another map frame /global_map frame which is translated and oriented wrt to the /odom frame. So now I want my /map frame origin to get aligned with /global_map frame and then I want to start doing the mapping , so I wonder if it is possible to shift the origin of the /map frame before mapping ? (in other words, I want to do mapping with /global_map as the /map frame and also wants to save the map wrt to /global_map frame only i.e to set origin of map.yaml file wrt to /global_map frame only.

I was looking into slamtoolbox codebase many times but I am unable to figure it out. For reference I looked into this issue also https://github.com/SteveMacenski/slam...

Also , I searched same question in here , so I got reference as here https://answers.ros.org/question/2959...

Here the solution mentioned is to publish extra static tf , but in that case I am unable to save map wrt to /global_map frame and the origin values are remained same wrt to /map frame only in map.yaml file. Also, instead of publishing extra static /tf I wonder if we can change and set /map frame origin in slamtoolbox codebase only ?

edit retag flag offensive close merge delete