Ask Your Question

Get gmapping robot pose estimation

asked 2012-09-26 04:12:53 -0500

Antonio gravatar image

I'm using gmapping with laser and odometry to perform SLAM. How can I visualize in rviz the estimated robot path? And how can I get the x and y values for each pose?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-09-26 22:19:26 -0500

Gmapping does not publish the pose of the robot as a pose per se (within a topic), but as a transform from 'map' to 'odom'.

In order to get the pose of the robot in the map that is built you have to get the current odometry of the robot (read your odometry topic) and then ask for the transform of that odometry (that is in 'odom' frame) to the 'map' frame. The result will be a pose in 'map' frame (the coordiantes of the robot in the map)

Then, in order to visualize the robot path through the map being built you have to create a node that asks periodically for that transform, store it in some place, and publish all the stored points as a path in a given topic (you decide the name).

Key point here is to understand the difference between 'tf transform' and 'topic'. Gmapping publishes a topic named '/map' which contains the current map, but it also publishes the tf transform 'map' (to 'odom').

edit flag offensive delete link more


shouldn't the actual pose of the robot be from map to base_link?

kaiyu gravatar image kaiyu  ( 2017-01-22 11:54:45 -0500 )edit

There is another potential problem. Getting the path in the way you described may suffer from loop closure or other adjustment of the map, which makes previously obtained poses invalid. Do you know a way to get the gmapping's current estimate of the trajectory?

kaiyu gravatar image kaiyu  ( 2017-01-26 15:15:37 -0500 )edit

Sorry but I do not understand so much, do you know how I can get a pose with covariance stamped from gmapping???

roberto3 gravatar image roberto3  ( 2018-02-20 03:10:44 -0500 )edit

answered 2012-09-26 07:21:17 -0500

dejanpan gravatar image

Do you mean the robot pose? You can use the RobotModel display type and see where it is and for the other you could visualize the TF display type. base_link frame is where the base of your robot should be (with the map frame being the world frame).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2012-09-26 04:12:53 -0500

Seen: 2,909 times

Last updated: Sep 26 '12