ROS 2 "frame does not exist" after ros2 bag play

ROS 2 “frame does not exist” after ros2 bag play: /tf_static, transient_local and the QoS override, measured

[INFO] [1793240800.732229790] [tf2_echo]: Waiting for transform world ->  base: Invalid frame ID "world" passed to canTransform argument target_frame - frame does not exist
[WARN] [1793240800.742655343] [transform_listener_impl_61db43c3ae20]: New publisher discovered on topic '/tf_static', offering incompatible QoS. No messages will be sent to it. Last incompatible policy: DURABILITY_QOS_POLICY

In a Python node the same failure is LookupException: "world" passed to lookupTransform argument target_frame does not exist., repeated for as long as you keep asking.

Short answer: on current Humble, Jazzy and Lyrical, plain ros2 bag play already republishes /tf_static as TRANSIENT_LOCAL. A tf2 listener that started 2 seconds after play began got the static transform on all three. The frame goes missing in three other cases. The player offers /tf_static as VOLATILE (check with ros2 topic info /tf_static -v). The listener starts after ros2 bag play has exited. Or you used --start-offset and skipped the one static message at the start of the bag. The first case is fixed with a QoS override file that sets durability: transient_local for /tf_static. For the second, keep the player running, for example with --loop. For the third, nothing in ros2 bag play that I tried helped.

# tf_static_qos.yaml
/tf_static:
  history: keep_last
  depth: 1
  reliability: reliable
  durability: transient_local
ros2 bag play my_bag --qos-profile-overrides-path tf_static_qos.yaml
Find your case — measured results table
At a glance: the main measured table from this article. Full details below.

Find your case

Every row below is a measured result. “ok” and “fail” count lookups of world to base from a tiny rclpy tf2 listener (a Buffer plus TransformListener) that asked about every 0.5 s. The world to base transform exists only in /tf_static. The bag holds exactly one /tf_static message, recorded at its start.

Case Humble Jazzy Lyrical
(a) Default play, listener starts 2 s after play ok=42 fail=0 ok=31 fail=2 ok=41 fail=1
(b) Override transient_local, listener at +2 s ok=42 fail=0 ok=33 fail=1 ok=30 fail=3
Override volatile, listener at +2 s ok=0 fail=33 ok=0 fail=34 ok=0 fail=42
(e) Default play, listener started 2 s before play ok=66 fail=5 ok=54 fail=4 ok=66 fail=4
(e) Override volatile, listener started before play ok=0 fail=71 ok=0 fail=58 ok=0 fail=69
Listener starts 1 s after play has finished ok=0 fail=6 ok=0 fail=6 ok=0 fail=6
(d) --loop, listener at +8 s (second pass) ok=24 fail=4 ok=22 fail=5 ok=42 fail=2
--start-offset 2, listener started before play ok=0 fail=50 ok=0 fail=38 ok=0 fail=49
--start-offset 2 plus override transient_local ok=0 fail=50 ok=0 fail=38 ok=0 fail=49

The few failures in the working rows are the first lookups, before the listener had discovered the player. After that every lookup succeeded. In the failing rows not one lookup succeeded. The ok counts differ because the loop runs faster when messages arrive, so compare zero against non-zero, not the exact numbers.

tf2_echo world base, started at the same moment as the listener, matched it. With default play and with the transient_local override it printed one Waiting for transform line and then - Translation: [1.000, 2.000, 3.000] two or three times before my 4 s timeout. With the volatile override it printed only Waiting for transform lines and the incompatible-QoS warning at the top of this page. It never printed a translation.

What I ran

On 2026-10-29 I used the official ros:humble-ros-base, ros:jazzy-ros-base and ros:lyrical-ros-base Docker images, one distro after another, each in a single container on the default bridge network with ROS_DOMAIN_ID=78 and the default RMW (Fast DDS). Per distro:

  1. Start ros2 run tf2_ros static_transform_publisher --x 1 --y 2 --z 3 --frame-id world --child-frame-id base and a small rclpy node that publishes base to sensor on /tf at 10 Hz.
  2. Two seconds later, record /tf and /tf_static for about 6 s. On Humble and Jazzy that was ros2 bag record -o bag1 /tf /tf_static. Lyrical needs --topics /tf /tf_static (see Version notes).
  3. Stop everything, so the only source of /tf_static is the bag.
  4. Run each playback case from the table and print the player’s offered QoS with ros2 topic info /tf_static -v.

ros2 bag info showed the same shape on all three distros: Topic: /tf_static | Type: tf2_msgs/msg/TFMessage | Count: 1, and 64, 49 and 62 /tf messages. That single static message is what every late joiner depends on. static_transform_publisher sends it once, and the recorder got it once.

Why it happens: /tf_static is a durability problem

A tf2 TransformListener subscribes to /tf_static as RELIABLE and TRANSIENT_LOCAL. TRANSIENT_LOCAL means the publisher keeps its last messages and hands them to subscribers that join later. That is how a static transform published once can reach a node that starts an hour later. I covered the general rule and its limits in transient local late joiners.

During playback the publisher is no longer static_transform_publisher. It is the rosbag2_player node. Three things follow from that, and each matched a row in the table.

  • If the player offers VOLATILE, nothing gets through. A TRANSIENT_LOCAL subscriber and a VOLATILE publisher are incompatible, so DDS doesn’t connect them at all. That’s why the listener started before play also got zero, even though it was online when the message went out. The warning names the policy: Last incompatible policy: DURABILITY in rclpy and DURABILITY_QOS_POLICY in tf2_echo.
  • When the player exits, the stored message goes with it. A listener started 1 s after the bag ended got ok=0 on every distro. This is the common RViz case: the bag is short, it has already finished, and then you open RViz.
  • If the player never publishes the message, there is nothing to store. With --start-offset 2 the player skipped the static message at t=0. Making the player TRANSIENT_LOCAL didn’t help, because it never had a message to keep.

If your error says “extrapolation” instead of “does not exist”, the frame is known and the timestamps are the problem. That’s a different fix, covered in tf2 lookup would require extrapolation into the future.

Does playback already use the recorded QoS? (c)

Yes, on all three distros in this run. The recorder writes the publisher’s offered QoS into metadata.yaml under offered_qos_profiles, and the player used it. Here is the /tf_static entry each distro wrote, and what the player offered with no override:

Distro offered_qos_profiles for /tf_static Player, no override
Humble (rosbag2 0.15.17) a YAML string: history: 3, depth: 0, reliability: 1, durability: 1 RELIABLE, History (Depth): UNKNOWN, TRANSIENT_LOCAL
Jazzy (rosbag2 0.26.11) history: unknown, depth: 0, reliability: reliable, durability: transient_local RELIABLE, UNKNOWN, TRANSIENT_LOCAL
Lyrical (rosbag2 0.33.4) history: keep_last, depth: 1, reliability: reliable, durability: transient_local RELIABLE, KEEP_LAST (10), TRANSIENT_LOCAL

On Humble the numbers are the rmw enum values. durability: 1 is transient local, and the /tf entry in the same file had durability: 2, which is volatile. Only Lyrical recorded the real history and depth. Even so, its player used depth 10 without an override and depth 1 with mine.

So if the player in your setup shows VOLATILE for /tf_static, look at that bag’s metadata first. rosbag2 issue #1237 shows a bag whose offered_qos_profiles for /tf_static was an empty string. I didn’t test a bag like that.

Fix 1: the QoS override file (b)

The override is the YAML at the top of this page. In every run the override decided the player’s durability. With durability: transient_local, ros2 topic info /tf_static -v showed Durability: TRANSIENT_LOCAL. With durability: volatile, it showed Durability: VOLATILE and every tf2 consumer went blind. The player logs the change on startup:

[INFO] [1793240792.010377710] [rosbag2_player]: Overriding QoS profile for topic /tf_static

Here is how to use it:

  • The top-level key is the full topic name, /tf_static, with the leading slash.
  • Set reliability: reliable as well. A tf2 static listener asks for reliable, and a best-effort publisher doesn’t match it.
  • If the player already says TRANSIENT_LOCAL, the override changes nothing you will notice. In my bags the default and the override gave the same result on all three distros.
  • Check the result with ros2 topic info /tf_static -v while the bag is playing. Look for Node name: rosbag2_player and its Durability line.

The flag is the same on all three distros. ros2 bag play --help printed identical text for it on Humble, Jazzy and Lyrical: “Path to a yaml file defining overrides of the QoS profile for specific topics.”

Fix 2: keep the player running, or use –loop (d)

Your bag can be correct and the player can be TRANSIENT_LOCAL, and the frame still disappears once playback ends. A late joiner can only get the message while the player is alive. The simplest fixes are to start RViz or your node before the bag finishes, or to play with --loop.

With --loop the player published the static message again on every pass. Two counter subscribers, started together with play, counted /tf_static messages over 20 s:

Subscriber Humble Jazzy Lyrical
TRANSIENT_LOCAL, reliable 4 4 4
VOLATILE, reliable 4 3 4

A listener that started 8 s into a looped play, after the first pass had ended, got the transform on all three (table above, row d). The same test with the transient_local override added gave ok=42 fail=0, ok=41 fail=1 and ok=41 fail=2.

Fix 3: –start-offset needs the beginning of the bag

With --start-offset 2 no lookup succeeded on any distro, with or without the override, even with the listener running before play. The only static message sat at the start of the bag and was skipped. This matches rosbag2 issue #1482 and #2333, which report latched topics being skipped with --start-offset. In my run that still happened on rosbag2 0.15.17, 0.26.11 and 0.33.4.

What does work: play from the beginning. The first row of the table shows that works. Or publish the static transform yourself next to the player with static_transform_publisher. I didn’t test that combination.

Checking /tf_static by hand with ros2 topic echo (f)

I started ros2 topic echo /tf_static 2 s after play, gave it 3 s, and counted child_frame_id: base in the output. All three distros gave the same counts:

echo command Default play Override transient_local Override volatile
ros2 topic echo /tf_static 1 1 0
... --qos-durability transient_local 0 0 0, plus incompatible QoS warning
... --qos-durability transient_local --qos-reliability reliable 1 1 0, plus incompatible QoS warning

The middle row trips people up. Passing only --qos-durability transient_local printed nothing in 3 s on every distro, even when the player was TRANSIENT_LOCAL. Adding --qos-reliability reliable fixed it. Plain ros2 topic echo without QoS flags also worked against a TRANSIENT_LOCAL player. Against a VOLATILE player, the late echo got nothing whatever flags I gave it. That makes echo a fast test: if the full command prints nothing while the bag is playing, your tf2 nodes won’t get the transform either.

Version notes

  • Lyrical rejects positional topics in ros2 bag record. ros2 bag record -o bag1 /tf /tf_static failed with ros2: error: unrecognized arguments: /tf /tf_static. Use --topics /tf /tf_static. Humble and Jazzy took the positional form. ros2 bag play still takes the bag path as a positional argument on Lyrical.
  • Metadata format. Humble 0.15.17 stores offered_qos_profiles as a YAML string with enum numbers. Jazzy 0.26.11 stores a list with names and history: unknown, depth: 0. Lyrical 0.33.4 stores the real keep_last and depth: 1.
  • Player history. ros2 topic info -v showed History (Depth): UNKNOWN on Humble and Jazzy and KEEP_LAST (10) on Lyrical without an override.
  • Lyrical’s player prints a progress block (====== Playback Progress ======) to stdout.
  • Lyrical’s ros2 bag record --help lists --static-topics-path, --repeat-transient-local and --repeat-all-transient-local. I didn’t test them.
  • The help text for --qos-profile-overrides-path and --loop was identical on all three distros.

Not tested

  • RViz2 itself. I used a tf2 Python listener and tf2_echo. RViz’s TF display also relies on a tf2 listener, but I didn’t open RViz.
  • CycloneDDS, Zenoh or any RMW other than the default Fast DDS.
  • Bags with an empty or missing offered_qos_profiles entry, or bags recorded by older rosbag2 releases.
  • --repeat-transient-local, --repeat-all-transient-local and --static-topics-path at record time, and split bags.
  • Running static_transform_publisher next to an offset playback.
  • Bags with several static publishers, --clock or sim time.

FAQ

Why does tf2_echo say frame does not exist after ros2 bag play?

In my runs that happened when the player offered /tf_static as VOLATILE, when tf2_echo started after ros2 bag play had exited, or with --start-offset. With default play on Humble, Jazzy and Lyrical, tf2_echo started 2 s into playback printed the static translation.

Do I need –qos-profile-overrides-path for /tf_static on Humble?

Not for a bag recorded by the current Humble rosbag2 (0.15.17). Its player already offered TRANSIENT_LOCAL from the recorded metadata. Use the override when ros2 topic info /tf_static -v shows Durability: VOLATILE for rosbag2_player.

Why does RViz lose static frames when I open it after the bag finished?

The player is the publisher that stores the static message for late joiners, and it exits when the bag ends. A listener started 1 s after playback ended got zero lookups on all three distros. Start RViz while the bag is playing, or play with --loop.

Does ros2 bag play –start-offset skip /tf_static?

Yes, in my run. With --start-offset 2 the static message at the start of the bag was never published, and the override didn’t change that. Play from the beginning, or publish the static transform separately.

Why does ros2 topic echo –qos-durability transient_local show nothing?

With only that flag, echo printed nothing in 3 s on all three distros. Adding --qos-reliability reliable made it print the static message. Plain ros2 topic echo /tf_static also worked.

Measured on 2026-10-29 with ros:humble-ros-base (sha256:d9bcf2e6f72d..., rosbag2 0.15.17, tf2_ros 0.25.24), ros:jazzy-ros-base (sha256:8eed0a4669bb..., rosbag2 0.26.11, tf2_ros 0.36.23) and ros:lyrical-ros-base (sha256:3224ee150cb0..., rosbag2 0.33.4, tf2_ros 0.45.10), default RMW (Fast DDS), Docker bridge network, ROS_DOMAIN_ID=78. Full digests are in digests.txt.

Script and raw output: evidence folder. Questions this answers: tf_static doesnt work with rosbag2 but tf does, Humble ros2 bag play qos_override doesn’t change topic durability, Topics with TRANSIENT_LOCAL QoS are not replayed with –start-offset, Latched topics skipped with ros2 bag play –start-offset, static_transform_publisher doesn’t latch on ROS2, Playback of rosbag with tf2-static transforms.