Fix traffic light timestamp desync when loading WOMD scenarios (#60)#93
Open
Abhishek21g wants to merge 1 commit into
Open
Fix traffic light timestamp desync when loading WOMD scenarios (#60)#93Abhishek21g wants to merge 1 commit into
Abhishek21g wants to merge 1 commit into
Conversation
Resample logged traffic-light states onto the SDC agent timeline when per-step timestamp_micros diverge (~10% of WOMD v1.1/v1.2 per waymo-research#60). Adds alignment tests and tools/validate_traffic_lights.py.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes waymax#60 — traffic light states can appear out of sync with logged agent motion in ~10% of WOMD v1.1/v1.2 scenarios (also reported in waymo-open-dataset#853).
Root cause:
traffic_lights_from_womd_dictcouples TL states to agents by timestep index only, ignoringtraffic_light_state/*/timestamp_micros. When per-step TL timestamps diverge from the SDC agent timeline (often by one 100 ms step), visualization and index-based lookup show the wrong phase (e.g. agent moving while TL shows STOP).Fix: New
traffic_light_alignmentmodule resamples TL states onto the SDC reference timeline when timestamps differ (integer offset search, then nearest-timestamp fallback). Hooked fromsimulator_state_from_womd_dictwhentime_key='all'.Repro scenario
training_tfexample.tfrecord-00008-of-01000(Requires WOMD v1.2.1 motion download — not in repo testdata.)
Test plan
python -m pytest waymax/dataloader/traffic_light_alignment_test.py -v— 7 passedpython -m pytest waymax/dataloader/womd_factories_test.py -v— 23 passed (no regressions)python tools/validate_traffic_lights.py --tfrecord waymax/dataloader/testdata/tfrecord_with_routes --max-scenarios 3— PASS (0 timestamp mismatches on bundled shard)Design notes
timestamp_microsalready match (common case).TrafficLightsdataclass shape — alignment runs at load time only.tools/validate_traffic_lights.pyflags scenarios bytimestamp_mismatch_count; kinematic heuristics only run when mismatches exist to limit false positives from CAUTION phases.Related
Companion open-source validation tool (not part of this PR): waymax-sim-receipts — traffic-light consistency doctor.