rotation of map in slam_gmapping - how to de-rotate? [closed]
I have a map produced by slam_gmapping. It looks pretty good. Straight edges, good loop closure, etc. I started the mapping on a hardwood floor (and have tuned odom on a hardwood floor) but in the middle of mapping I have to pass a carpeted area where Z drifts until I get back to wood again. The drifting Z did not screw-up up the shape of the map at all, but it did cause the entire map to rotate (I was watching as the map was built and it didn't start to rotate until I got to the carpet). It means the wall that was supposed to lie along x axis is at 20 degrees or so.
Is there a way to correct this at the map level or will I need to insert a transform to rotate it back? Of course you already know the next question: how would that transform look?
Thanks in advance for help.
Why do you want to rotate the map at all? The localization and navigation algorithms don't really care about the map orientation.
I guess that is a fair question. Fits easier (larger image with complete map) when map edges align with edges of screen and setting up the initial pose seems more complicated with an arbitrarily rotated map.