Playing back logfiles with tf data for offline SLAM
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