Skip to content

ROS2 bridge: stamp message headers/TF with sim time from each message's time_stamp - #194

Closed
andrewjong wants to merge 1 commit into
iamaisim:mainfrom
castacks:fix/bridge-sim-time-stamps
Closed

ROS2 bridge: stamp message headers/TF with sim time from each message's time_stamp#194
andrewjong wants to merge 1 commit into
iamaisim:mainfrom
castacks:fix/bridge-sim-time-stamps

Conversation

@andrewjong

Copy link
Copy Markdown
Contributor

About

Split out of #177 per review. One commit: the ROS2 C++ bridge stamps sensor/pose message headers (and TF broadcasts) from each message's own sim time_stamp field instead of the bridge's wall clock at receive time. Previously an RGB/depth pair rendered on the same sim tick received two different header stamps offset by network jitter, which breaks message_filters time synchronization downstream and makes header stamps inconsistent with the /clock topic the bridge itself publishes.

Relationship to the planned sim-published clock topic (and to #182's /clock fix): complementary rather than competing. A native Project AirSim clock topic that the bridge forwards is the right design for /clock publication (replacing today's GetSimTime polling), but per-message header stamps should come from each sample's own acquisition time regardless of how /clock is delivered — that is what this PR wires up, and it stays correct unchanged once the native clock topic lands. Happy to rebase/adapt this on top of that work when it exists.

How Has This Been Tested?

Linux (Ubuntu 22.04), Blocks + custom UE 5.7.4 environments, ROS 2 Humble, camera + non-physics robot scenes. Before: RGB/depth pairs from the same sim tick differed by network-jitter-sized offsets and drifted from /clock. After: pairs from the same tick carry identical stamps (verified with an exact-time pairing downstream), consistent with /clock; an RGB-D mapping pipeline consuming the bridge has run extended sessions on these stamps, including recording and replaying sim-time rosbags.

Screenshots and videos (if appropriate):

N/A — behavioral fix; evidence described above.

🤖 Generated with Claude Code

Sensor and pose handlers previously stamped ROS headers with the bridge's
wall clock at receive time, discarding the sim-clock time_stamp every
Project AirSim message carries. That broke exact RGB/depth/pose sync
downstream (ApproximateTimeSynchronizer saw network jitter) and made
header stamps inconsistent with the /clock topic. Prefer the message's
time_stamp (sim nanos) when present; fall back to wall clock. TF
broadcasts reuse the owning message's stamp.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrewjong

Copy link
Copy Markdown
Contributor Author

Withdrawing this per discussion in #177 — deferring the clock/timing area to #182 and the planned sim-published clock topic. We'll keep carrying this header-stamping commit on our fork (castacks/ProjectAirSim, branch fix/bridge-sim-time-stamps) for our own pipeline; happy to resubmit rebased on the native clock topic if useful once that lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant