ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Playing back logfiles with tf data for offline SLAM

asked 2011-03-24 21:57:25 -0500

updated 2014-01-28 17:09:25 -0500

ngrennan gravatar image

I want to use bag data to run LIDAR-based SLAM algorithms (for example gmapping) offline. For this, I use a erratic_robot in simulation with a separate launch files for simulated robot enviromnent and the SLAM system so both can be used independently. If I start both my test scenario and my SLAM launch file at the same time:

roslaunch erratic_gazebo_no_slam.launch
roslaunch slam.launch

Everything works as expected, I get a map, a transform from map->odom and everything works as expected.

However, if I drive the robot around using pr2_teleop and record data using:

roslaunch erratic_gazebo_no_slam.launch
rosbag record /base_scan/scan /tf

and afterwards try processing the data using:

roslaunch slam.launch
rosbag play [the_bag_file]

gmapping manages to build a map, but fails to correctly publish the transform between map and odom. Any pointers on what's wrong are greatly appreciated. I was expecting to see my robot (or better, the tf tree) driving around in the map in rviz, but with the missing transform this is of course not possible.

/edit: use_sim_time is set to true all the time

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-03-24 22:47:00 -0500

To answer my own question, one has to use the --clock option so the clock is actually published by rosbag. So the correct playback command line is:

rosbag play [the_bag_file] --clock
edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-03-24 21:57:25 -0500

Seen: 1,476 times

Last updated: Mar 24 '11