Rosanswers logo

Hey everyone,

I'm honestly surprised I have not been able to find a similar question anywhere. I am just getting started with ROS and I would like to start using gmapping for SLAM.

The robot I am using has a kinect and publishes odometry data through a topic called /Odometry. I used depthimage_to_laserscan to convert the kinects native output to the laser scan that gmapping wants. I confirmed that this works using rviz.

My problem comes when it is time to use gmapping. I don't really know what I need to do or provide to make gmapping work. From reading the documentation (And I can't say I understand too much of it) it seems like this is all I need to do:

rosrun gmapping slam_gmapping scan:=scan

However when I run this nothing happens. And I can't say I would expect otherwise, because I have not told gmapping where it can find my odometry. The documentation also mentioned something about required transforms, but I don't have any, know how to make any, or how to provide them when I have them.

What I need, and I'm sure other people need as well, is some kind of beginners guide to using gmapping. If any of you guys can help me with my specific problem, that would be great, or if you could direct me to a tutorial I overlooked (not the logged data one) that would be even better.

More on my actual problem: When I run gmapping using the command I wrote above, rviz complains that there is no transform that links my laser scanner to the map and the terminal window where I ran gmapping just replays the message "Dropped 100% of messages so far"

Thanks in advance for your help!

Originally posted by Robocop87 on ROS Answers with karma: 255 on 2013-06-18

Post score: 2


1 Answer 1


Rosanswers logo

To really understand how to use ROS for higher level functions, it is best to go through ALL the links in http://www.ros.org/wiki/ROS/Tutorials

I believe you have understood what gmapping requires correctly. What you are missing now is the tf, so the logical next step is to look into the tf tutorials (which is under "Tutorials for other libraries" in the main tutorials page). After that, you might want to further understand how to use the navigation stack.

A "shortcut" for learning how to use ROS for robots is to look for robots with good documentation, like turtlebot. Then go into the launch files to see how things are done.

Originally posted by weiin with karma: 2268 on 2013-06-18

This answer was ACCEPTED on the original site

Post score: 4

Original comments

Comment by Robocop87 on 2013-06-18:
Thanks for your answer weiin! I agree I need to read up on my transforms, which I am currently doing. I will also dig through the turtlebot code to see how they went about doing it, but I am still worried about the odometry data. I didn't see any way to pass that data...cheers to exploring!

Comment by weiin on 2013-06-18:
Odometry data is passed through the transform odom->base_link. That means only the pose information is passed. See also http://ros.org/reps/rep-0105.html


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.