Rosanswers logo


I am trying to build a map from a bag file (captured from a real Hokuyo) but when I run map server to save the map I receive a massage that saying “waiting for a map”.

I have already searched ros wiki for the same problem and someone said that the problem happens because the topics of bag file and gmapping can not link to each other, so I remapped the topic of bag file to gmapping(from /base to /base_scan). However, the problem has still remained. I would appreciate it if you help me out.

Here is the steps I follow


2-rosparam set use_sim_time true

3-rosrun gmapping slam_gmapping scan:=base_scan

4-rosbag play --clock mylaserdata.bag /base:=/base_scan

5-rosrun map_server map_saver

Originally posted by A.M Dynamics on ROS Answers with karma: 93 on 2015-12-10

Post score: 1

Original comments

Comment by mgruhler on 2015-12-11:
Do you actually see that the map is being built from gmapping in rviz? If yes, check what the topics from gmapping are with rosnode info /slam_gmapping and that the /map topic is sent out correctly.

Comment by A.M Dynamics on 2015-12-12:
Thanks but I do not understand you at all. I think the message "waiting for a map" means that no map is produced, so how I can visualize it rviz? and for your second statement I do not understand to exactly check what with what? I would appreciate it if you clear it out.

Comment by A.M Dynamics on 2015-12-12:
This is the information that provides: Node [/slam_gmapping] Publications:

  • /map_metadata [nav_msgs/MapMetaData]
  • /rosout [rosgraph_msgs/Log]
  • /tf [tf2_msgs/TFMessage]
  • /map [nav_msgs/OccupancyGrid]
  • /slam_gmapping/entropy [std_msgs/Float64]

Comment by A.M Dynamics on 2015-12-12:
and the rest is: Subscriptions:

  • /tf_static [unknown type]
  • /base_scan [unknown type]
  • /tf [tf2_msgs/TFMessage] Now what I should do?

Comment by mundobot on 2017-11-01:
/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

Comment by KcR on 2020-08-19:
@A.M.Dynamics I am having the same issue here. Can you please let me know how did you fix this. I am using ROS Melodic Ubuntu 18.04.


1 Answer 1


Rosanswers logo

Given your output, you have no subscription from the slam_gmapping node to any laserscanner message. You can see this from the following line:

* /base_scan [unknown type]
* /tf [tf2_msgs/TFMessage]

It should read

* /base_scan [sensor_msgs/LaserScan]
* /tf [tf2_msgs/TFMessage]

Then you know, that there is actually (at least) one of each, subscriber and publisher, open on this topic. So you most probably have a wrong remapping on the scan topic.

If you need more help, please upload the relevant parts of your launch file and probably the rosbag play command you use.

Originally posted by mgruhler with karma: 12390 on 2015-12-18

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

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