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

how gmapping gather odom data?

asked 2020-03-05 11:58:04 -0600

sinsinsinsin gravatar image


I am using stage_ros to simulation slam.

The Gmapping works but I noticed that stage_ros is publishing "nav_msgs/Odometry" information under the topic /odom.

While the gammping node is subscribing the /tf topic to get odom data.

I checked the message under topic /tf, it was "tf2_msgs/TFMessage".

And I echo both of those topics. seems like the /tf topic is publishing the transform between difference frame (yes, as expected.)

But the stage_ros node publishes the twist data under topic /odom like the image below image description

So, I am interested in how the gmapping get odometry information from the topic /tf. Or, if I have /odom topic, can I setting gmapping to subscribe from that?

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-03-05 12:48:35 -0600

Stage ROS (or generally the odometry source) will also publish the TF transformations via a TransformBroadcaster.

edit flag offensive delete link more


Hi, If my understanding is correct, The Odometry information and TF transform are two things. The TF transform stands for the transforms between two frames (like the transforms between two rigids). The odometry information records the wheel data, like how long the robot has gone.

Why gmapping receive the odom information from /tf instead of from /odom?


sinsinsinsin gravatar image sinsinsinsin  ( 2020-03-10 12:48:21 -0600 )edit

TF is a standard used by the TF toolset (which you should look up its wiki page if you don't know it) for time variant transformations. This gives it an interpolated, high-quality estimate of the odometry vs just taking the last message from a single source.

TF transformation will provide a very similar thing to the odometry message, but they are used for different purposes.

stevemacenski gravatar image stevemacenski  ( 2020-03-10 14:44:59 -0600 )edit

Thank you. I found the TF tutorial on the wiki. Got a better though after running the tutorial.

sinsinsinsin gravatar image sinsinsinsin  ( 2020-04-02 15:18:30 -0600 )edit

Question Tools

1 follower


Asked: 2020-03-05 11:58:04 -0600

Seen: 538 times

Last updated: Mar 05 '20