# amcl with rotated map

I know this was asked previously, but since there was no answer, I hope it is OK to ask.

I would like to align my map xy axes by specifying an origin in the map's yaml file. However, AMCL does not track location when a yaw is put into the map origin. Is there a way to use AMCL with a rotated map?

edit retag close merge delete

I wonder if thats important since amcl needs the initial pose anyway.

( 2018-06-21 02:38:41 -0600 )edit

It is helpful when debugging since the map's x and y axes will line up with amcl's. For example, look at rviz and see that when the axes are aligned, the grid lines are parallel to the walls of the map, which is helpful with debugging localization errors.

( 2018-06-21 12:05:36 -0600 )edit

I can't answer your question about the YAML file, but you could always modify the map directly in a photo editor. Cut Paste-rotate.

( 2018-06-23 12:08:50 -0600 )edit

Sort by » oldest newest most voted

I find this an interesting question. I have used rotated maps in the past and I did not experiment a great localization error.

I also rather prefer to have an aligned map because of tracking of pose components is much simpler than taking into account the rotation of the map. Though, not always is possible to create a live map that would satisfy this.

I think first you should evaluate effect of rotation of your map on the localization. It depends on grid scale, map size,...

In map_server documentation ( http://wiki.ros.org/map_server ) it is told that the .pgm file is processed by SDL_image ( http://www.libsdl.org/projects/SDL_im... ). Map server converts pixel color into occupancy value, so I guess that if you modified the map in a photo editor (like InkScape/Gimp/...) as long as size matches with metadata yaml file I do not see any problem. I guess that what is more likely to happen when editing manually is that your origin point would move sligthly to the one you record. I did not try but I will and update with conclusions.

Maybe it is just that I am not aware of inner effects on AMCL, but I do not see problems with working with rotated maps more than is more difficult to perform tests/pose debugging. You can always make use of AMCL parameters to handle initial mean hypothesis condition as launch param or directly on the ParameterServer:

~initial_pose_x (double, default: 0.0 meters)

Initial pose mean (x), used to initialize filter with Gaussian distribution.


~initial_pose_y (double, default: 0.0 meters)

Initial pose mean (y), used to initialize filter with Gaussian distribution.


Initial pose mean (yaw), used to initialize filter with Gaussian distribution.

more