problem with building a map from a bag file
Hello
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
1-roscore
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
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.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.
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]
and the rest is: Subscriptions: * /tf_static [unknown type] * /base_scan [unknown type] * /tf [tf2_msgs/TFMessage] Now what I should do?
/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
@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.