Skip to content

Fix road boundary parsing for XODR#65

Closed
maximilianigl wants to merge 5 commits into
NVlabs:mainfrom
maximilianigl:migl/fix-road-boundaries
Closed

Fix road boundary parsing for XODR#65
maximilianigl wants to merge 5 commits into
NVlabs:mainfrom
maximilianigl:migl/fix-road-boundaries

Conversation

@maximilianigl

Copy link
Copy Markdown

Updates the parsing of XODR to address (some of) the issues mentioned here: NVlabs/alpasim#61

The fundamental problem is that our XODR files don't have road boundaries. instead, we try to infer which lane-boundary is also a road boundary.

Before: Take the rightmost lane boundary in driving direction. It's not entirely clear to me why that didn't work reliably, but it didn't.

Now: Take the outermost lane-boundary on either side.

Guillermo did some analysis on the faulty scenes and it seems to fix most reported issues. The remaining ones might also be data problems: https://docs.google.com/document/d/1Lys_rCapKg0z1TLyBJ3WkAUNwy9-wKdZaXNOH1anl3Q/edit?tab=t.62pzl5e0asj

BorisIvanovic and others added 5 commits October 14, 2025 15:36
…otobuf4, removal of map rasterization, etc).
* Add MADS dataset support

Add the MADS dataset module, which provides:
- MADSDataset: full dataset integration for loading MADS clipgt data
  including ego and obstacle agent parsing with cubic interpolation,
  overlap filtering, and map caching
- populate_vector_map: constructs VectorMap instances from MADS parquet
  map data (lanes, road edges, traffic signs, wait lines)
- MadsSceneRecord and env_utils registration for dataset discovery

* Fix test

* Update src/trajdata/dataset_specific/mads/mads_utils.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/dataset_specific/mads/mads_utils.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/utils/env_utils.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/dataset_specific/mads/mads_utils.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/dataset_specific/mads/mads_utils.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/dataset_specific/mads/mads_dataset.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/dataset_specific/mads/mads_dataset.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/dataset_specific/mads/mads_dataset.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update src/trajdata/dataset_specific/mads/mads_dataset.py

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>

* Update mads_dataset.py

* fixes

* Update env_utils.py

* Update mads_utils.py

---------

Co-authored-by: Boris Ivanovic <8534290+BorisIvanovic@users.noreply.github.com>
_extract_road_edges read lg.left_edge from the outermost left lane to
get the left road boundary.  In v1.4.3 the edge convention changed
(left_edge = inner for all lanes), but _extract_road_edges was not
updated, so the left boundary ended up at the centerline.

Replace the indirect lookup with direct capture: after the edge-chaining
loop finishes each side, current_edge is already the outermost road
edge.  Record it there and delete _extract_road_edges entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maximilianigl

Copy link
Copy Markdown
Author

Mistakenly tried to merge into the wrong branch.

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.

2 participants