Rosanswers logo

I was following this this tutorial in the hope of getting slam_gmapping working with kinect and nxt.

In the second step:

  1. Get a bag. You have a couple of choices:

(i) Download an existing bag to test with ("basic_localization_stage.bag"), or

(ii)Create a bag with your robot ("differentfrequencybag.bag"-->created by myself using nxt_teleop)

image description http://i1214.photobucket.com/albums/cc484/torresho/differentfrequencybagfiletfandbasescanzoom.png

I have manage to get the map.pgm for the downlaoded "basic_localization_stage.bag" but not for the bag file I have created ("differentfrequencybag.bag"). By using the commands below:

  1. roscore

  2. rosparam set use_sim_time true

  3. rosrun gmapping slam_gmapping scan:=base_scan

  4. rosbag play "name of the bag that you downloaded / created in step 2"

  5. rosrun map_server map_saver

Question: Do i need to have the EXACT same frequency for base_scan topic and tf topic?*****

Since I have noticed that the downloaded .bag file has the same frequency for both topics (tf and base_scan):

base_scan | | | | | (align so nicely) tf | | | | | (align so nicely)

The one I have created is like:

base_scan | (about 1.9Hz: on the right of the diagram below) tf | || | | (about 33.25Hz on the right of the diagram below)

image description http://i1214.photobucket.com/albums/cc484/torresho/tf3325vsscan19hz.png

The rxgraph is shown below (The slam_gmapping node does have the tf and base_scan inputs): image description http://i1214.photobucket.com/albums/cc484/torresho/rxgraphzoom.png

I am still not sure why map_saver is waiting for the map(as shown in the diagram below). Hmm... image description http://i1214.photobucket.com/albums/cc484/torresho/waitingformap.png

Question: Do i need to have the EXACT same frequency for base_scan topic and tf topic?***

Originally posted by Torres on ROS Answers with karma: 112 on 2012-03-23

Post score: 1

Original comments

Comment by prince on 2012-03-23:
can you post larger image of rxgraph?

Comment by jayess on 2017-11-14:
And this is why images should be directly embedded into a question instead of using a hosting site...


1 Answer 1


Rosanswers logo

Thanks for the good graphics. Your problem is that you are not publishing the clock which is required for simulated time. You should use the --clock option for rosbag.

For more info see the Clock wiki page

Originally posted by tfoote with karma: 58457 on 2012-03-27

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by Torres on 2012-03-28:
Hi prince and tfoote, thank you for your help. I am now able to save the map and view it in rviz. (The root problem behind this is because of my mistake of mixing up the tf parameters). The map still needs to be improve. Might need to adjust the tf parameter values.Thanks again. Have a nice day.


Your Answer

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