OpenDRIVE import: support <object>/<repeat> placement - #94
Merged
Conversation
Add an OdrObjectRepeat type and parse every <repeat> child of an <object> into it (s, length, distance, tStart/tEnd, zOffsetStart/End, and optional width/length/height start/end). Optional start/end dimensions use a new optNumAttr helper so 'attribute present' stays distinct from a zero value. Re-exported from the exporter entry point.
odrToShapes now expands an object's <repeat> into discrete instances instead of drawing a single footprint at the object's own t. Each instance's (s, t), footprint length/width, and repeat-line heading tilt are interpolated from the start values to the end values across the span, spaced by distance; instances that would run past the road end are dropped. distance=0 (a continuous object) collapses to one footprint at the span start. cornerLocal outlines are scaled and re-placed per instance; cornerRoad outlines are re-based to each instance station; objects without an outline fall back to the oriented-rectangle footprint. Placement mirrors the ASAM OpenDRIVE 1.8 repeat model.
Add unit fixtures for two repeat rows offset to opposite sides (tStart=tEnd =-12.7 / +12.7) and for a continuous distance=0 object, asserting instance count, per-row spacing, and lateral separation. Update the parking_demo fixture expectations for the now-expanded polygon count and assert the two opposite rows land 25.4 m apart (they previously overlapped at the centre).
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
Parse
<object>/<repeat>records and place repeated object instances along the road reference line, per ASAM OpenDRIVE 1.8 搂13.2 (validated against esmini's RMObject::GetRepeatInstances as the authoritative reference).distancemetres with linear start鈫抏nd interpolation of t / dimensions; heading includes the repeat-line tilt atan2(tEnd鈭抰Start, length)Previously, objects declaring their lateral offset only via
<repeat tStart/tEnd>(e.g. parking rows without<outlines>) collapsed onto the road centreline.Not covered (follow-ups)
radiusStart/End interpolation for circular objects; exact curvature-following re-evaluation for cornerRoad outlines (approximated by station re-basing).
Tests