fix(opendrive): tolerate malformed junction connections instead of failing the whole parse - #87
Closed
kosuke55 wants to merge 1 commit into
Closed
fix(opendrive): tolerate malformed junction connections instead of failing the whole parse#87kosuke55 wants to merge 1 commit into
kosuke55 wants to merge 1 commit into
Conversation
…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.
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.
A single malformed record inside a junction previously aborted the entire OpenDRIVE parse, so no roads were imported at all.
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.