Problem creating a map (navigation/robotsetup tutorial) [closed]
I'm trying to set up my robot as described in http://www.ros.org/wiki/navigation/Tutorials/RobotSetup. I'm using a PeopleBot (p2os) with a SICK scanner on the base.
When I get to the "create a map" stage, something goes wrong, and I'm not sure what. I start roscore, sicktoolbox_wrapper, p2os_driver and my laser_to_robot_transform, all of which I have confirmed works individually.
sicktoolbox_wrapper publishes laserscans with "frame_id: laser" to "/scan".
p2os_driver publishes, among other things, pose data with "frame_id: odom" and "child_frame_id: base_link" to "/pose", and also transform frames with "frame_id: /odom" and "child_frame_id: /base_link"
my Laser_to_robot_transform publishes transforms with "frame_id: /base_link", "child_frame_id: /laser"
I then create a bag with recordings of /scan and /tf, and play it back after setting the use_sim_time preference to true and running "rosrun gmapping slam_gmapping".
slam_gmapping does not give any output, and neither does running "rosrun map_server map_save" after the bag has played back.
Am I missing some transformations, or is my current transformation not correct? When using the bag linked to from the tutorial (basic_localization_stage.bag), everything works, and slam_gmapping gives output while playing back.
EDIT: Solved Well, don't I feel stupid. After hours of poking at this problem I find out what's wrong in half an hour after finally asking for help.
If anyone's interested, I had neglected to put a sleep in the body of my while loop for my robot_to_laser_transform, making it publish data much more often than it should. This ended up with a bag file where there were no actual transform frames recorded from the p2os_driver, making mapping impossible.
are you publishing the clock with the bag?
Adding --clock as a parameter to rosbag play doesnt seem to make a difference. Would I also need explicitly record this when creating the bag?
I don't think you need to record it. I'm fairly certain it won't work if you don't publish it though.
I'm not quite understand why p2os_driver's frame_id is odom and child_frame_id is base_link?I'm also new to gmapping. Thank you~