pageldev / libOpenDRIVE

Small, lightweight C++ library for handling OpenDRIVE files
Apache License 2.0
388 stars 136 forks source link

Add support for signals and lane validity records #76

Closed pranavashok closed 1 year ago

pranavashok commented 1 year ago

This PR makes the following changes

I tested it on this map with signals and this map with objects. The maps were slightly modified, e.g.,

<object id="0" s="0" t="6.8" subtype="None" dynamic="no" zOffset="0.4" pitch="0" roll="0" height="0.3" name="guardRail" type="barrier" orientation="none" hdg="3.141592653589793">
    <repeat length="1000" distance="0" s="0" tStart="6.8" tEnd="6.8" heightStart="0.3" heightEnd="0.3" zOffsetStart="0.4" zOffsetEnd="0.4"/>
     <validity fromLane="-1" toLane="2"/>
</object>

or

<signal id="0" s="98.0" t="-4" subtype="1" dynamic="no" zOffset="1.5" pitch="0" roll="0" type="R1" orientation="+" country="USA" hOffset="0">
    <validity fromLane="-2"/>
</signal>

Would love to have this feature merged. Looking forward to suggestions/comments.

PS: Thanks for making this amazing tool @grepthat

pageldev commented 1 year ago

Also best provide the .xodr Opendrive files directly as an attachment.

pranavashok commented 1 year ago

Thanks for the comments! Here are the two maps I used for testing (had to add a .txt suffix so that GitHub allows them to be uploaded):

  1. junction_with_signals.xodr.txt
  2. simple_road_with_objects.xodr.txt

I've pushed a new commit implementing the suggestions. Please let me know if more changes are needed :-)