ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
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?

zkytony gravatar image zkytony  ( 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?

zkytony gravatar image zkytony  ( 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

What about using the server of hector trjaectory ?.

Zuhair95 gravatar image Zuhair95  ( 2022-08-17 02:52:49 -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


@dejanpan how do I get the robot pose and uncertainty/covariance? How would I also do get the robot pose and uncertainty/covariance of the landmark observations in the map generated by gmapping slam?

hunterlineage1 gravatar image hunterlineage1  ( 2023-04-10 12:49:47 -0500 )edit

Question Tools



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

Seen: 3,628 times

Last updated: Sep 26 '12