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

Work with tf data timestamped from bag file

asked 2019-12-18 06:29:07 -0500

ignazwrobel gravatar image

updated 2019-12-18 06:29:56 -0500

I am replaying a bag file containing point clouds, and right now can only work on that bag file.

Now rosbag play publishes the data with the original time stamps, which makes sense.

However this makes working with tf somewhat difficult, since a tfBuffer.lookupTransform at ros::Time::now() with any reasonable duration obviously gets me an empty buffer and any ros::TimerEvent last_real also returns the Unix Epoch, which does not directly translate to the timestamps from the bag data.

What is the proper way to handle Timestamping differences like this? How can I efficiently work on the data, just like it is from a real-world, live robot?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-12-18 06:31:55 -0500

gvdhoorn gravatar image

What is the proper way to handle Timestamping differences like this? How can I efficiently work on the data, just like it is from a real-world, live robot?

I would say configuring rosbag to publish the clock (ie: adding --clock to your rosbag play command line), and set use_sim_time to true before starting your nodes.

If you then only make use of ros::Time, things should "just work".

edit flag offensive delete link more

Comments

Thank you very much, adding <param name="/use_sim_time" value="true"/> to the launch file and changing all ros::Time::now() to ros::Time() did the trick.

ignazwrobel gravatar image ignazwrobel  ( 2019-12-18 07:14:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-18 06:29:07 -0500

Seen: 399 times

Last updated: Dec 18 '19