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

# Get gmapping robot pose estimation

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 close merge delete

Sort by ยป oldest newest most voted

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').

more

1

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

( 2017-01-22 11:54:45 -0500 )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?

( 2017-01-26 15:15:37 -0500 )edit
1

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

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

What about using the server of hector trjaectory ?.

( 2022-08-17 02:52:49 -0500 )edit

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).

more