Skip to content

Various OpenDRIVE fixes#468

Open
dfremont wants to merge 6 commits into
mainfrom
xodr_fixes
Open

Various OpenDRIVE fixes#468
dfremont wants to merge 6 commits into
mainfrom
xodr_fixes

Conversation

@dfremont
Copy link
Copy Markdown
Collaborator

Description

Fixes various bugs with the OpenDRIVE parser and makes it more robust to some issues in maps we've been sent. In particular:

  • fix code that ensures we generate vertices at transtions between geometries (thanks @Eric-Vin for implementing this)
  • tolerate negative lane widths
  • tolerate zero-width portions of lanes (by eliding them)
  • only clean polygons if they are invalid (our prior eager approach sometimes unnecessarily corrupted very thin lanes)
  • fix differencing of adjacent lane polygons
  • skip spirals with very high curvature rates (which are probably artifacts)
  • simplify and improve code for skipping suspicious geometries
  • lane overlap removal shrinks the larger lane
  • fix combineSections logic for sidewalks/shoulders so that left and right edges are properly computed (there are still issues with dropping certain parts of these regions, particularly on one-way roads, but the fix will require changes to the roads API so I'm deferring that)
  • tolerate linkage to junctions missing corresponding connections

Thanks @Eric-Vin for independently fixing some of these bugs in #193.

Issue Link

Fixes #189. Fixes #274. Fixes #459.

Checklist

  • I have tested the changes locally via pytest and/or other means
  • I have added or updated relevant documentation
  • I have autoformatted the code with black and isort
  • I have added test cases (if applicable)

Eric-Vin and others added 5 commits May 19, 2026 20:57
* tolerate negative lane widths
* tolerate zero-width portions of lanes (by eliding them)
* only clean polygons if they are invalid
* fix differencing of adjacent lane polygons
* skip spirals with very high curvature rates (which are probably artifacts)
* simplify and improve code for skipping suspicious geometries
* lane overlap removal shrinks the larger lane
* fix combineSections logic for sidewalks/shoulders
* tolerate linkage to junctions missing corresponding connections
@dfremont dfremont requested a review from Eric-Vin May 21, 2026 14:46
@dfremont dfremont mentioned this pull request May 21, 2026
3 tasks
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.78%. Comparing base (62da37a) to head (9fc566b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
+ Coverage   89.70%   89.78%   +0.07%     
==========================================
  Files          48       48              
  Lines       13287    13322      +35     
==========================================
+ Hits        11919    11961      +42     
+ Misses       1368     1361       -7     
Files with missing lines Coverage Δ
src/scenic/formats/opendrive/xodr_parser.py 92.04% <100.00%> (+0.54%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Scenic crashes on custom map Custom road map crashes Scenic I think that there are some typo in the code

2 participants