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

Does tf2 rely on current time?

asked 2023-02-06 02:17:53 -0500

We recorded some rosbags and now we want to play them for simulation. But Ros2 Foxy doesn't have a feature like Ros1's use_sim_time and we can't switch to a newer version. In order to use the rosbags we need to know whether our code relies only on time provided in message headers (as recorded in the rosbag), or also the current time. Since we're using tf2 as well, I'd like to know whether tf2 relies only on time provided in message headers, or also the current time. Anyone knows?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-02-06 13:25:41 -0500

tfoote gravatar image

In general tf2 does not rely on the current time. It only knows about the timestamps requested and the timestamps of published frame data. If you query it with the current time while providing simulation/logged data it will likely fail.

You will run into problems if different components of your system are on different timelines. This can happen if some are in world time, and some are in simulation time in which case queries might fail.

edit flag offensive delete link more

Comments

Ok thank you. It's unlikely we'll be using current time while providing simulation/logged data, since we're using the timestamps from that data. So then it should be fine. Thanks again for clarifying.

oddbotwl gravatar image oddbotwl  ( 2023-02-07 03:51:41 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2023-02-02 04:51:50 -0500

Seen: 82 times

Last updated: Feb 06 '23