ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Get gmapping robot pose estimation

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

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?

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

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

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

Comments

1

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

zkytony gravatar image zkytony  ( 2017-01-22 11:54:45 -0600 )edit
1

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 -0600 )edit
1

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 -0600 )edit

What about using the server of hector trjaectory ?.

Zuhair95 gravatar image Zuhair95  ( 2022-08-17 02:52:49 -0600 )edit
2

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

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

Comments

@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 -0600 )edit

Question Tools

4 followers

Stats

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

Seen: 3,866 times

Last updated: Sep 26 '12