Ask Your Question

Revision history [back]

In order for the timestamps of the transforms output by the static_transform_publisher to be valid, you'll need to set ROS to use simulation time and have rosbag output the clock when it plays back. To do that, do the following after starting up a roscore:

rosparam set use_sim_time true
rosrun tf static_transform_publisher 0 0 0 0 0 0 base_link base_laser 100
rosrun gmapping slam_gmapping scan:=base_scan
rosbag play --clock gmapping_data.bag

Note the setting of the use_sim_time parameter as well as the --clock option to rosbag. This way, all of ROS (until you kill that roscore or otherwise unset the use_sim_time parameter) will use the timestamps that match what was recorded in your bagfile instead of the current wall time.

Also, you should not need to set the ~base_frame on gmapping, since it defaults to base_link as documented on the gmapping wiki page.

You will also need to actual set the transform between base_link and base_laser or your output map may contain errors. The identity transform (what you specified) should be good enough for testing if gmapping will work at all though.

In order for the timestamps of the transforms output by the static_transform_publisher to be valid, you'll need to set ROS to use simulation time and have rosbag output the clock when it plays back. To do that, do the following after starting up a roscore:

rosparam set use_sim_time true
rosrun tf static_transform_publisher 0 0 0 0 0 0 base_link base_laser laser 100
rosrun gmapping slam_gmapping scan:=base_scan
rosbag play --clock gmapping_data.bag

Note the setting of the use_sim_time parameter as well as the --clock option to rosbag. This way, all of ROS (until you kill that roscore or otherwise unset the use_sim_time parameter) will use the timestamps that match what was recorded in your bagfile instead of the current wall time.

Also, you should not need to set the ~base_frame on gmapping, since it defaults to base_link as documented on the gmapping wiki page.

You will also need to actual set the transform between base_link and base_laser or your output map may contain errors. The identity transform (what you specified) should be good enough for testing if gmapping will work at all though.

In order for the timestamps of the transforms output by the static_transform_publisher to be valid, you'll need to set ROS to use simulation time and have rosbag output the clock when it plays back. To do that, do the following after starting up a roscore:

rosparam set use_sim_time true
rosrun tf static_transform_publisher 0 0 0 0 0 0 base_link laser 100
rosrun gmapping slam_gmapping scan:=base_scan
rosbag play --clock gmapping_data.bag

Note the setting of the use_sim_time parameter as well as the --clock option to rosbag. This way, all of ROS (until you kill that roscore or otherwise unset the use_sim_time parameter) will use the timestamps that match what was recorded in your bagfile instead of the current wall time.

Also, you should not need to set the ~base_frame on gmapping, since it defaults to base_link as documented on the gmapping wiki page.

You will also need to actual set the transform between base_link and base_laserlaser or your output map may contain errors. The identity transform (what you specified) should be good enough for testing if gmapping will work at all though.