Robotics StackExchange | Archived questions

Map is rotating with the robot

My fixed frame is Map . While the robot is moving linear the map is staying still but when the robot starts rotating the map is rotating too .

My odom data are very accurate and i've checked them with tf in rviz .

My transforms are :

Any thoughts why is this happening ?

Asked by Kostas Tzias on 2022-10-09 08:48:40 UTC

Comments

Answers

Hi. I think what's happening is that gmapping gives the transformation from map -> odom, as it should. But if you then give odom -> base_link, this will rotate the map, when the odometry rotates.

You will have to change your package to publish base_link -> odom and also the urdf must give laser -> base link. I think both of those transformations are published the wrong way round. It should also be mentioned here http://wiki.ros.org/amcl?distro=noetic#Transforms and here https://wiki.ros.org/gmapping?distro=noetic#Required_tf_Transforms

EDIT: I think the way you write the transformations is correct, I just think that maybe the implementation does not match that which would give the indicated behaviour.

Asked by ct2034 on 2022-10-09 16:22:16 UTC

Comments

I don't think that's right because now my tree frame is broken into map->odom and laser->base_link . Are you sure this is the right way ?

Asked by Kostas Tzias on 2022-10-11 08:28:07 UTC

just to be clear, the arrow x->y indicates a transformation of frame y in terms of x. Saying where y is within x. Note that this is the way, the tf documentation uses the arrow directions and also the link i posted from gmapping uses this orientation of arrows. The amcl documentation has the arrows the other way around but means the same thing. And just to make things even more complicated, rviz uses the wrong orientation, i.e. the one that also the amcl documentation uses.

Asked by ct2034 on 2022-10-11 15:41:51 UTC

could you maybe post the output of rosrun tf view_frames

Asked by ct2034 on 2022-10-11 15:43:11 UTC