广告广告位招商联系 ads@irunion.comA5 · 728×90(移动端 320×100) · 参考价 ¥300/月了解详情 →

【Editorial】TF_OLD_DATA and a jumping robot pose: do you fix the timestamp, or the clock domain first?

Started by FPGA_ARM_Linux · 2026-11-14 02:30 UTC · 44 views · 2 replies
F Member
【Editorial Discussion】

A robot that “teleports” in RViz, or a stream of TF_OLD_DATA / lookup failures, is often treated as a transform tree problem. Many of those cases are actually two clocks, a delayed bag, or an extrapolated stale parent frame. Editing the URDF will not fix a time-domain bug.

1) Establish one time authority before you retune the tree. If the driver uses the device clock, the host uses system time, and a bag is replayed with --clock, lookups will fail or jump even when the frames are correct. Print stamp vs now() at the driver, tf, and the consumer, and see whether the offset is stable or drifting.

2) Distinguish late data from a broken graph. A frame that arrives 200 ms late is not the same as a missing parent or a loop in the tree. tf2’s buffer can be enlarged, but that hides a driver or network delay that will still break closed-loop control. If the delay is real, fix the source or the QoS, not only the cache.

3) Static vs dynamic transforms get mixed up after a restart. A static publisher that dies, or a robot_state_publisher that starts after the first laser scan, will produce a burst of “frame does not exist” and then look fine. Check bring-up order and whether the static transforms are latched / transient-local as you think.

4) Use a single lookup policy in control code. Some nodes use Time(0) (latest), others use the message stamp, others use a fixed offset. Mixing them will look like the robot jumped only in one node. Agree on “stamp of the sensor message, with a documented timeout,” and log the exception, not only the pose.

Open question: the last time the pose jumped or TF_OLD_DATA appeared, was it a clock domain, a late driver, bring-up order, or a real tree mistake? Any case that was clean in live teleop and only broke on bag replay? Please share ROS 1 vs 2 and how large the time offset was.
I Editorial
机器人位姿在显示里跳动,或出现 TF_OLD_DATA,应先统一时间权威,再去改坐标树。设备时钟、主机时钟和录包时钟混用时,外推和查找会在未来或过去之间来回跳,看起来像 URDF 或外参错了。先确认驱动使用哪一路时间戳、是否与系统时钟同步、录包回放是否在用原时间。延迟很大的父坐标系被用来外推时,子坐标系会“瞬移”,这时要限制外推时间并排查延迟来源,而不是加大缓存了事。多个节点同时发布同一坐标系,也会表现为跳动,先查发布者唯一性。改完在同一时间轴上看位姿连续性和查找失败计数,确认跳动与时间警告一起消失。时间域没理顺之前,不要先重做外参或改树结构。
R Member
先修时钟域这个判断很对,我们之前也踩过类似的坑。补充两点排查经验:第一,确认 use_sim_time 是否全网一致最容易被忽略,实机、仿真、录包回放混用时,只要有一个节点没开,时间戳就会一边走系统时间一边走仿真时间,TF 表现为间歇性跳变而不是持续报错。可以用 ros2 topic echo 看 header.stamp 与各节点 now() 的差值,差值稳定是固定偏移,差值漂移就是时钟源不同步,需要查 chrony 或 PTP。第二,区分“旧数据”和“重复发布”,用 tf2_monitor 看各条链路的延迟和频率,再用 view_frames 检查有没有两个节点同时发布同一条 transform,重复发布会让缓存里新旧帧交替,表现和时钟问题很像。改时间戳只能掩盖问题,时钟域统一后,TF_OLD_DATA 大多自己就消失了。
广告广告位招商联系 ads@irunion.comA6 · 728×90(移动端 320×100) · 参考价 ¥200/月了解详情 →
Log in or register to reply.