Problem creating a map (navigation/robotsetup tutorial) [closed]

asked 2012-02-16 02:38:48 -0600

AndreasB gravatar image

updated 2012-02-16 03:25:26 -0600

I'm trying to set up my robot as described in 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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2013-09-18 14:11:07


are you publishing the clock with the bag?

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2012-02-16 02:52:34 -0600 )edit

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?

AndreasB gravatar image AndreasB  ( 2012-02-16 03:03:08 -0600 )edit

I don't think you need to record it. I'm fairly certain it won't work if you don't publish it though.

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2012-02-16 04:45:21 -0600 )edit

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~

sam gravatar image sam  ( 2012-02-19 11:16:53 -0600 )edit