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

Revision history [back]

The bag file in which you are running is using the timestamp from which you recorded the data. Are you passing on the timestamp from the bag file data? if you are, set the timestamp of the new data to ros::Time::now(). Let me know what happens

The bag file in which you are running is using the timestamp from which you recorded the data. Are you passing on the timestamp from the bag file data? if you are, set the timestamp of the new data to ros::Time::now(). Let me know what happens


EDIT:

Okay now it makes sense to why your getting this problem. When you start your converter node, it listens for your laser scan data which obviously contains time stamps in the header message. Once you run the bag the first time and it finishes, the time stamp that the last laser scan message contained will be stored in your converter node. Your time stamp in your converter node will now stay the same until it is updated again. Just for reference lets say that time_x is the beginning time of your bag (10:12am), and time_z is last time stamp of your bag (10:14am).

However, when you want to run the bag again, your converter node's time stamp was last set to time_z (10:14am). So it makes sense to why your getting a TF_OLD_DATA, because when you try to transform your data in the converter node, tf wont transform if your new piece of data (10:12am) is older then your current one (10:14am).

Hope that makes sense. This same thing happened to me except with robot_pose_ekf; I kept the node open and reran the bag data and i got same errors. Restart the node or add something that will reset that time stamp before you all the transform function.