Skip to content

fix(opendrive): tolerate malformed junction connections instead of failing the whole parse - #87

Closed
kosuke55 wants to merge 1 commit into
mainfrom
fix/junction-connection-robustness
Closed

fix(opendrive): tolerate malformed junction connections instead of failing the whole parse#87
kosuke55 wants to merge 1 commit into
mainfrom
fix/junction-connection-robustness

Conversation

@kosuke55

@kosuke55 kosuke55 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

A single malformed record inside a junction previously aborted the entire OpenDRIVE parse, so no roads were imported at all.

  • Resolve OpenDRIVE 1.7+ direct/virtual connections via linkedRoad when connectingRoad is absent
  • Skip only the malformed connection record (with a warning on OdrMap.warnings) when neither attribute is present; adjacent connections survive
  • Keep strict errors for genuinely unrenderable input (missing road/geometry attributes)

Testing: 290 passed (parser: linkedRoad direct, skip+warning, missing incomingRoad, broken laneLink, legacy regression; end-to-end: all roads still convert to lanes with a warning present). Build green.

…iling the whole parse

A <connection> missing its connectingRoad attribute used to throw and
abort parsing of the entire document, so a single bad junction record
prevented every road from importing. Junction records are topology
metadata - roads render fine without them - so they now degrade
gracefully:

- connections that omit connectingRoad resolve their target road from
  the OpenDRIVE 1.7+ linkedRoad attribute (direct/virtual connections);
  the raw type attribute is kept on the parsed record
- connections missing both target attributes (or incomingRoad) are
  skipped with a warning instead of throwing; malformed <laneLink>
  records are likewise skipped individually
- junctions without an id are skipped with a warning
- parse notes are carried on OdrMap.warnings and surfaced through the
  odrToShapes result warnings

Plan-view geometry attributes stay strict: a road without valid
geometry cannot be drawn at all, so errors there still throw.
@kosuke55 kosuke55 closed this Aug 8, 2026
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