Error in creating 2D global map of the Environment [closed]
Hi, I am going through the [slam_gmapping](http://wiki.ros.org/slam_gmapping/Tutorials/MappingFromLoggedData) I can move my P3AT in the environment through keyboard. I try to follow the steps mentioned in the tutorial but unable to generate the map.
step:1 terminal:1 rosparam set use_sim_time true
step:2 terminal:2 rosrun gmapping slam_gmapping scan:=lms200 _odom frame:=odom
step:3 terminal:3 rosbag record -O mylaserdata.bag /lms200 /tf
INFO 1383223128.547387984: Subscribing to /lms200 INFO 1383223128.548429961: Subscribing to /tf INFO 1383223128.549742465: Recording to mylaserdata.bag.
WARN 1383223128.549933629: Less than 5GB of space free on disk with mylaserdata.bag.active.
After step 3 the mylaserdata.bag should be created.ATLAST BAG IS CREATED.
small success
step:4 terminal:4 rosbag play mylaserdata.bag
INFO 1383224702.381804366: Opening mylaserdata.bag
Waiting 0.2 seconds after advertising topics... done.
Hit space to toggle paused, or 's' to step.
RUNNING Bag Time: 1383223567.472784 Duration: 438.600031 / 438.658882
Done.
command list
Start-up roscore
rosbag record -O mylaserdata.bag /lms200 /tf
INFO 1383223128.547387984: Subscribing to /lms200
INFO 1383223128.548429961: Subscribing to /tf
INFO 1383223128.549742465: Recording to mylaserdata.bag.
WARN 1383223128.549933629: Less than 5GB of space free on disk with mylaserdata.bag.active
Start-up USARSim on the windows pc environment started in usarsim
Start-up the ROS interface, roslaunch usarsim_inf usarsim.launch(robot placed in environment)
5.Run the tele-op keyboard which should allow you to drive the robot around.:
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
6.$ rosrun gmapping slam_gmapping scan:=lms200 _odom_frame:=odom
- rosbag play mylaserdata.bag
successfully completed.
- rosrun map_server map_saver
o/p=MAP GENERATED BUT IT IS EMPTY:)
MAP.YAML FILE
image: map.pgm
resolution: 0.050000
origin: [-100.000000, -100.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
//////////END OF MAP.YAML///////////////////
- then I run
rosrun rviz rviz
Now laser messages are properly published and the tf tree looks ok. But no transform from [/GrndTruth] to frame[/map] and no transform from [/base_GrndTruth to frame[/map].
Thanks in advance
It seems that the problem is in opening bag file. First I would suggest you to just run rosbag play ..file.name and see if its running...Look here http://wiki.ros.org/rosbag/Commandline for more details. Try rosbag -fix parameter and see if theat changes or solves ur problem
rosbag record -O mylaserdata.bag /lms200 /tf It should generate the mylaserdata.bag and after moving the robot related information must be included here. Am I right?
yes...still not solved?
mylaserdata.bag has not been generated. Whats's the problem I can't figure out.
rosbag record -a
It will record all topics, I think. Will it help in creating the map?
Yes, having all topics will be able to create map. you can map even without using the logged data, for that you must use the data from laser and wheel odom online.
Hello Sai, can you mention the procedure what should be done after rosbag record -a. As you have said map can be obtained using online how it is possible. I have not found out any tutorial.
http://wiki.ros.org/p2os-vanderbilt/Tutorials/GMapping%20With%20Pioneer-3dx
Logging the data and creating a map are two different things. Better try one first and figure that out. The simplest should be to play the standard bagfile and check that gmapping works on that as a base line.
dornhege, sir I have used a standard bag file downloaded from willow garage named as basic_localization_stage.bag. when I typed rosbag play basic_localization_stage.bag , then [RUNNING] Bag Time: 168.554342 Duration: 133.954342 / 1239670987.745222 (snapshot) comes and it runs continuously in an increasing manner, I have kept my laptop on for almost 12 hours it reaches to 6 digit. That's why I stop there. So, can I conclude from this experiment that logging data should work in my experiment also? My rxgraph output includes the slam_gmapping node, so can I say that I am in correct path to get the global map.
sai, I need a static 2d global map only. I will handle the remaining dynamic local map later. Can you help me regarding this?
Were you getting a map in rviz? Then everything is fine. The logfile probably does only contain data for 1 or 2 minutes + some spurious time stamp that makes it appear longer.
using slam_gmapping, you can generate static 2d map only. As told by dornhege, while running the logged data and gmapping node, open rviz and select /map frame and check if u can visualize a map.
rosrun rviz rviz /root/.rviz/display_config does not exist! Global status error Fixed Frame Fixed Frame [/map] does not exist INFO 1383153449.086235057: rviz revision number 1.8.17 INFO 1383153449.086334749: compiled against OGRE version 1.7.3 (Cthugha) INFO 1383153450.434721571: Loading general config from /root/.rviz/config INFO 1383153451.202554212: Texture for pass 0: creating with size 1 x 1 INFO 1383153451.202840286]: Texture for pass 1: creating with size 1 x 1 INFO 1383153577.610798599: Setting goal: Frame:/map, Position(2.493, -1.564, 0.000), Orientation(0.000, 0.000, 0.829, 0.559) = Angle: 1.955 INFO 1383153587.704759103: Saving general config to /root/.rviz/config
Please edit your original post and append to that. Those things are unreadable as comments. Always state exactly which commands you executed in total and what you observed/expected as a result.
Sir I have changed question and put rviz output as well.
Did you add a map display and set the map topic?
try adding --clock parameter when running a bag: rosbag play --clock filename.bag . it will make row act as though it is running at the time bag was created.