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

Why map_saver is waiting for map (slam_gmapping)?

asked 2012-03-23 12:34:44 -0500

Torres gravatar image

updated 2012-03-23 12:40:24 -0500

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

In the second step:

2) 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

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

The rxgraph is shown below (The slam_gmapping node does have the tf and base_scan inputs): image description

I am still not sure why map_saver is waiting for the map(as shown in the diagram below). Hmm... image description

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

edit retag flag offensive close merge delete


can you post larger image of rxgraph?

prince gravatar image prince  ( 2012-03-23 19:46:47 -0500 )edit

And this is why images should be directly embedded into a question instead of using a hosting site...

jayess gravatar image jayess  ( 2017-11-13 23:58:38 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2012-03-27 12:15:11 -0500

tfoote gravatar image

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

edit flag offensive delete link more


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.

Torres gravatar image Torres  ( 2012-03-28 07:04:17 -0500 )edit

answered 2017-11-01 01:23:39 -0500

mundobot gravatar image

updated 2017-11-14 00:00:17 -0500

jayess gravatar image

/slam_gmapping node is waiting for messages in a few topics. You need to publish also /tf_static, so you need to run

rosbag record -O data.bag /scan /tf /tf_static

Other option is to execute in shell:

rosparam set /robot_state_publisher/use_tf_static false

This will make robot_state_publisher to publish in tf the missing data

edit flag offensive delete link more

answered 2012-04-14 13:19:03 -0500

Saba gravatar image

Hi Torres, I have the same problem, would you please tell me how you solved it.

edit flag offensive delete link more


Hi Saba, I am not sure how similar your problem is compared to mine. Perhaps if you are able to provide your tf view_frames and the rxgraph, I might be able to help. Thanks.

Torres gravatar image Torres  ( 2012-04-19 04:24:26 -0500 )edit

Question Tools



Asked: 2012-03-23 12:34:44 -0500

Seen: 3,579 times

Last updated: Nov 14 '17