When a measurement was captured in a moving sensor frame and must be expressed relative to a robot at a later time, state both times in the transform request. A lookup using one historical timestamp evaluates the source and target relationship at that same past time. The advanced tf2 lookup can instead connect a past source frame to a target frame at another time through a fixed reference frame.
The API discussion here follows the official Jazzy C++ tutorials, pinned to their repository revision checked on October 13, 2026. No listener, broadcaster or robot was run for this article. The proposed request record is intended to make a timing question reviewable before changing transform code.
Name the relationship before choosing a lookup
Consider a robot that moved after a camera captured a feature. There are two different questions: where was that feature relative to the robot at capture, and where is its recorded world location relative to the robot now? The frame names can be identical in both questions. The target time is what separates them.
The official time-travel tutorial demonstrates this distinction with a delayed follower. Its advanced C++ lookupTransform takes the target frame and target time, source frame and source time, fixed frame, and timeout. The fixed frame bridges the two times. The tutorial’s delay is an example, not a recommended sensor latency or control setting.
Write the requested relationship in a short record before selecting arguments:
| Item | What to identify | Mismatch to catch |
|---|---|---|
| Source frame and time | Measurement frame and intended capture instant | Reception time substituted for capture |
| Target frame and time | Consumer frame and the instant it should represent | Robot pose evaluated at the old instant |
| Fixed reference | The frame assumed unchanged between those instants | A reference reset hidden between observations |
| Waiting budget | How long the consumer can wait for required transforms | Availability timeout mistaken for allowable data age |
Keep this record beside the measurement’s frame identifier and timestamp. A helper that always asks for the latest transform may hide the immediate error while answering a different physical question.
Availability and freshness are separate checks
The Jazzy time tutorial explains that zero time requests the latest available transform. It also shows why a request for now may initially require future extrapolation: the transform has not yet reached the listener’s buffer. A timeout can wait for availability; it does not choose a better timestamp or establish that the measurement is fresh enough for the application.
For a failed two-time request, retain the requested source and target times and the exception. Then identify which required interval was unavailable. Check clock agreement and startup history before extending a cache or replacing the request with latest. If the source stamp is incorrect, waiting longer can only preserve an incorrect question.
For a successful request, record the relationship actually used. Compare its age with the consumer’s requirement. A transform returned without an exception can still be unsuitable for a fast moving task if the measurement itself arrived too late.
A coordinate change does not predict object motion
Using a fixed reference lets the robot’s frame move between capture and consumption. It does not establish that the observed object stayed at its recorded location. A stationary landmark and a moving part on a conveyor need different assumptions after capture. Preserve the observation time even when the resulting coordinates are expressed in the current robot frame.
If the application predicts object motion, keep that prediction and its uncertainty separate from the tf2 coordinate conversion. Also record changes to the fixed reference or its registration. Reusing a frame name across a localization reset is insufficient evidence that the old and new reference have the same meaning.
Use the robot coordinate-frame guide when the uncertainty concerns path ownership, axes or calibration. For this two-time problem, the next step is more specific: retain one failing or suspicious measurement, write down the two instants and reference assumption, and verify that the lookup asks the intended question.