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

Revision history [back]

rosbag records ros::Time::now() of when the message is received on the "rosbag record" computer. This helps the playback system emulate the latency of the logged messages.

Your imu publisher likely fills in the msg.header.stamp with ros::Time::now() of the robot the imu is attached to.

To change the timestamps, have a look at the rosbag APIs, you can read in the bagfile and write a new one with whatever timestamps you want.

http://www.ros.org/wiki/rosbag/Cookbook#Rewrite_bag_with_header_timestamps

http://www.ros.org/doc/api/rosbag/html/c++/

Finally, to prevent this from happening in the future, take a look at a solution like chrony. It's great for ROS because ROS requires two way communication; and that's all it takes for chrony to synchronize your timestamps.

http://answers.ros.org/question/11570/ros-time-across-machines/