Create Map from Rosbag
Hi I am having problem with creating map(.pgm and .yaml) files. First i tried to create a map using the existing bag file following this tutorial. I was successful to create map. Now I created a bag file following this tutorial. I created a bag file. But when I try to create a map using this newly created bag file I am getting the message
ras@ubuntu:~/bagfiles$ rosrun map_server map_saver -f ~/testmap
[ INFO] [1470969136.155361289]: Waiting for the map
Edit2:
I have kinect which gives PointCloud2 data over the topic /camera/depth/points . I want to convert is first to LaserScan type and then create the bag file.
The steps how i created bag files are given below :
- roscore
- roslaunch freenect_launch freenect.launch
- rosrun pointcloud_to_laserscan pointcloud_to_laserscan_node
- rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/camera/depth/image_raw
- rostopic echo /scan --//and here I can see the converted data of LaserScan type. I am sure now it is publishing LaserScan data
- rosbag record -O subset /scan /tf --//Recording /scan and /tf data. it will create a subset.bag file
Now its time to Create the map from the logged data Steps are given below:
- rosparam set use_sim_time true
- rosrun gmapping slam_gmapping scan:=base_scan /I have confusion on the base_scan as my data on /scan/
- rosbag play --clock ~/bagfiles/subset.bag //play the bag file
- rosrun map_server map_saver -f /home/ras/bagfiles/rastest_kinect
Here in the step 4, it just shows waitng for the map. But if I change the file name from step 3 which I downloaded from here, I get a map generated. The sample bag file which I generated is attached and the rqt graph is here
the comparision of the two bag files are as below:
the downloaded file --this is okay and successfully generates map
ras@ubuntu:~/mynect_ws$ rosbag info ~/bagfiles/downloaded.bag path: /home/ras/bagfiles/downloaded.bag version: 2.0 duration: 1:32s (92s) start: Jan 01 1970 01:00:34.60 (34.60) end: Jan 01 1970 01:02:06.80 (126.80) size: 8.2 MB messages: 3693 compression: none [11/11 chunks] types: sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369] tf/tfMessage [94810edda583a504dfda3829e70d7eec] topics: /base_scan 924 msgs : sensor_msgs/LaserScan
/tf 2769 msgs : tf/tfMessage
My generated file -- for this one map_saver waits for the map
ras@ubuntu:~/mynect_ws$ rosbag info ~/bagfiles/subset.bag path: /home/ras/bagfiles/subset.bag version: 2.0 duration: 1:31s (91s) start: Aug 21 2016 18:30:19.07 (1471797019.07) end: Aug 21 2016 18:31:50.32 (1471797110.32) size: 7.7 MB messages: 6379 compression: none [11/11 chunks] types: sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369] tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec] topics: /scan 2735 msgs : sensor_msgs/LaserScan
/tf 3644 msgs : tf2_msgs/TFMessage (4 connections)
Can anyone please help me regarding this. Thanks.
EDIT1: As I am pretty new I did not checked first about recording topic and. Now I understand that it requires LaserScan type messages. I am using Robotino and I do not have Laser Scanner hardware. I can get data of PointCloud2 and ...
Hi, Can you add more details about what topics you recorded? Also, any error from rosout when you run gmapping while playing the bag? Were you able to view the map from RVIZ?
Thanks for your concern. I have updated the main question. Can you please suggest me now what can i DO? I tried rostopic echo /scan But it shows nothing.
This is not enough information to answer your question. Please provide any error messages appearing, a screenshot of
rosrun rqt_graph rqt_graph
showing all topics, the configuration and launch files you use for mapping... In short: http://www.sscce.org/Remember to record the /tf topic too. If you have tf set up probably, then you should be able to see the map.
@DavidN, thanks fro your suggestion but unfortunately no luck for me. I edited the main question and attched the bag file. I recorded /scan and /tf. Can you please have a look.
@mig I attached the link of the rqt_grah. I hope it can give you proper information.
@DavidN: Somehow I am able to create a map file. I recorded /scan /tf /odom. Then using that map file and gmapping slam I am able to create a map. The kinect was set to the top of robotino. But the map is not as expected. The map file is attached.
Rasoo, did you fix the 'waiting for map' issue, I have the exact same issue, not sure how to fix