Rosanswers logo

Hi, I'm following this tutorial: http://wiki.ros.org/laser_pipeline/Tutorials/IntroductionToWorkingWithLaserScannerData

However, I cannot see the point cloud if I try to reproduce a bagfile and in the console in which I launched the node that should convert the laser scans into a point cloud I'm getting a lot of messages like:

TF_OLD_DATA ignoring data from the past

I already used this command that should have solved the problem:

rosparam set use_sim_time true

Any ideas about how to solve this problem?

EDIT: I want to add a couple details. This is the exact error:

at line 260 in /tmp/buildd/ros-hydro-tf2-0.4.10-0precise-20140304-0005/src/buffer_core.cpp Warning: TF_OLD_DATA ignoring data from the past for frame wide_stereo_optical_frame at time 1.275e+09 according to authority /play_1407416604376477595 Possible reasons are listed at http://wiki.ros.org/tf/Errors 1.336857e-312xplained

The bagfile I'm using is the bagfile of this tutorial: http://wiki.ros.org/laser_assembler/Tutorials/HowToAssembleLaserScans

Apart from setting use_sim_time to true, I also used the "--clock" parameter when playing the bagfile. I noticed a couple interesting things:

  1. the first time I launch the bag file, no error pops out in the console window of the converting node. They come out from the second run on.

  2. I launched the command "rosrun tf tf_monitor odom_combined base_link" and I saw that the results were "avg = 0.0826798: max = 0.155032" that seem a little bit too high, but raising the tolerance to 1 second didn't make any difference.

Originally posted by lucaluca on ROS Answers with karma: 74 on 2014-08-06

Post score: 0


1 Answer 1


Rosanswers logo

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


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.

Originally posted by l0g1x with karma: 1526 on 2014-08-06

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by lucaluca on 2014-08-07:
@l0g1x thought the same, but I don't know how to solve the problem. The parameter "use_sim_time" should have solved it. However, I'm not passing the timestamps from the bag file, but I'm just using "rosbag play". Should I change the way I'm working?

Comment by lucaluca on 2014-08-07:
I added a couple details to the question

Comment by l0g1x on 2014-08-07:
Okay i coincidentally reproduced the same TF_OLD_DATA error last night except with robot_pose_ekf. I first started the ekf node, and THEN i played the bag data. Not 100% sure if this will work in your case though. Start your pointcloud converter node, and then play the bag. let me know what happens

Comment by lucaluca on 2014-08-07:
@l0g1x that was what I was doing, but it didn't make any difference. But I have a couple news that I'm going to add right now at the bottom of the question

Comment by l0g1x on 2014-08-08:
Any lucky?

Comment by lucaluca on 2014-08-13:
@l0g1x this is reasonable but it didn't seem to solve my problem. However, I'm very busy right now, so I will let you know in few days ;)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.