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

How is odometry used in gmapping?

asked 2016-07-20 16:30:12 -0500

krishna43 gravatar image

updated 2016-07-21 11:16:19 -0500


I working on gmapping to map a huge area. I have basic knowledge of ROS i.e how to publish,subscribe,writing launch files. As i have to map a huge area i don't want to drive the robot manually, so i wrote a simple obstacle avoidance code to move around the space without hitting anything. And when i robot moves i save the laserscan data and tf data into a bag file. and ofter than i follow this tutorial to make a map. As a trail run, i just made the robot to go around a small cubical (rectangle in space)and mapped the environment offline. You can see the output below:

image description

As you can see the map is REALLY REALLY bad :( .

I did some research and played with gmapping parameters, i was able to improve the mapping a little bit. Output after changes gmapping parameters:

image description

As you can see it improve a little bit. :) . But i am not satisfied with the result. I want to make it more perfect, so i kept on reading tutorials and watching videos on gmapping but most of the information doesn't make any sense to me especially on tf frames. I have following question:

1) when i record data into a bag file i just record laserscan and tf. So, how is odom data is considered in mapping the environment?

2) Is there any other high level way (rather than play with gmapping parameters) to improve gmapping?

3) whenever i collect data from my robot i go around with my robot and i can see that sometimes it bumps into things and make sudden movements. i think these movements effect the quality of data. Is there anyway i can make my robot go smoother?

4) And damn what doe this means map -> odom -> base_link . I know it's a transformation from one frame to another frame, like in low level how is map frame different from odom and base_link and which frame is used in gmapping?

Can someone please throw some light on these questions?

P.S: why understanding about odom and base_link is obom drifts over time, but base_link isn't. Please correct me if i am wrong.


edit retag flag offensive close merge delete



Hi Krishna,

Your questions are really appropriate. I have just started making something similar to turtle bot's autonomous navigation system. However, I don't have odometry data. Is there any way I can still build the car using gmapping alone?

pallavbakshi gravatar image pallavbakshi  ( 2017-01-16 07:53:22 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-07-20 16:53:26 -0500

metRo_ gravatar image

odom is used when ROS is calculating the TF transform for your laserscan data however to make it work properly you need to setup your TF frame.

edit flag offensive delete link more


Aren't TF frame already setup in a turtlebot? I am using off-the-shelf turtlebot.

krishna43 gravatar image krishna43  ( 2016-07-20 17:27:50 -0500 )edit

And did you set up a tf frame for your laser?

metRo_ gravatar image metRo_  ( 2016-07-20 17:49:45 -0500 )edit

I think i did, because whenever i run:

  rosrun tf view_frames

in the generated pdf i can see a link between laser_link and base_footprint

krishna43 gravatar image krishna43  ( 2016-07-20 18:09:57 -0500 )edit

Can you share the code where you are publish the laserscan?

metRo_ gravatar image metRo_  ( 2016-07-21 01:25:05 -0500 )edit

I am not publishing the laserscan. I have a kinect with me, i getting data off the kinect, so i am subscribing to /scan topic.

krishna43 gravatar image krishna43  ( 2016-07-21 11:15:07 -0500 )edit

answered 2020-07-29 02:00:31 -0500

megh-bot15 gravatar image

gmapping requires wheel odometry data to stitch the map at different locations. Without odometry, there is mismatch, drifts, unwanted rotations in the map.

If you do not have or do not want to use wheel/IMU odometry data, you may use "hector mapping" that performs ICP odometry using Laser Scan data. (

edit flag offensive delete link more

Question Tools



Asked: 2016-07-20 16:30:12 -0500

Seen: 4,017 times

Last updated: Jul 29 '20