Rosanswers logo

I'm working on creating a server map using the tutorial:


The odometry data is being published, and I have a hokuyo utm-30lx laser scanner published as well. My robot is being modeled with a urdf file.

I made sure the hokuyo was perfectly horizontal and then start recording my bag file with this:

>rosbag record -O mylaserdata /scan /tf

After the recording, it plays back into rviz fairly well. Even with all of the scan overlap, it still resembled the room recorded.

The issue comes when I try to turn it into a map with:

>rosrun gmapping slam_gmapping scan:=scan

as soon as I start playing the bag file, it gives me this warning:

[ WARN] [1384916667.376566157, 1384914870.078301371]: Failed to compute laser pose, aborting initialization ("base_link" passed to lookupTransform argument target_frame does not exist. )

This warning repeatedly keeps coming up as the bag is playing. I've also tried:

>rosrun gmapping slam_gmapping scan:=base_scan _odom_frame:=odom

But it gives me the same warning.

  1. Am I not correctly recording my tf data into the bag file? Shouldn't the urdf provide the laser pose?

  2. The robot_state_publisher is in the topic named '/tf'. Why isn't it my base link from my urdf file? rosbag wouldn't record my base link when I tried.

  3. On a somewhat different note, if my odometry data isn't too accurate, what does it mean for gmapping and using the Navigation Stack?

Advice would be greatly appreciated! Thank you.

Edit: I've tried to create the map live with rviz. Similar to how the map was made here.


Unfortunately, it still gives me the same error. I thought the error came from the target frame, and tried setting that on rviz. Still nothing.

I also double checked my urdf file, and I don't believe the issue is there. The laser scan is leveled to the laser scanner visualized modeled on the urdf file.

Originally posted by pwong on ROS Answers with karma: 447 on 2013-11-19

Post score: 0


1 Answer 1


Rosanswers logo

I've tried quite a few ways of setting the parameters of base frame to run gmapping. I just missed the underscore.

>rosrun gmapping slam_gmapping scan:=scan _base_frame:=base

I think with the urdf and setting the base_frame to base, I fulfilled the tf requirements for gmapping. If there's anything I can find to clean up the map, I'll update the answer for the newcomers like me.

Edit: It was suppose to be _base_frame:=base, not odom as I had it before.

Here were some tips I found collectively from other ROS answers that helped me with my setup in a larger area with a hokuyo UTM-30LX.

1.Start near the corner of the room(if in a large empty room) and move slowly.

2.Use a launch file. Change the map_update_interval to around 30.

3.For the hokuyo I used, it had 270deg view, I made a mistake of trying to use all of the viewing angle. From another ROS answer post and the package page, I saw that its not stable and I think you would have to do some adjusting to the driver's angle resolution. It was best to use from -95 to 95 degree, or the defaults.

4.Set the maxUrange to the max distance your laser scanner is capable of.

Here is how the map turned out, which looks very good imo. http://i.imgur.com/73b4lkf.png

Originally posted by pwong with karma: 447 on 2013-11-21

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

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