pageldev / libOpenDRIVE

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

<outline> should supersede the object's bounding box #64

Closed dpjiitkgp closed 1 year ago

dpjiitkgp commented 1 year ago

As per the Opendrive (1.6 and 1.7) documentation: Complex objects may be further described using <outline> elements. If an <outline> is defined, it supersedes the bounding box.

object_outline

Issue: In my case, element doesn't supersede object's attribute. I don't see any impact of element. As per above docs, Object should be drawn according to element if it is provided.

Here is a sample Object element with outline. This snippet can be placed inside any road object .

<objects>
            <object type="crosswalk" id="10" s="10.0" t="0.0" zOffset="0.0"
            orientation="none" length="15.0" width="10.0" hdg="0.0" pitch="0.0" roll="0.0">
            <outlines>
                  <outline id="0">
                  <cornerRoad s="5.0" t="3.5" dz="0.0" height="4.0" id="0"/>
                  <cornerRoad s="8.0" t="-3.5" dz="0.0" height="4.0" id="1"/>
                  <cornerRoad s="12.0" t="-3.5" dz="0.0" height="4.0" id="2"/>
                  <cornerRoad s="15.0" t="3.5" dz="0.0" height="4.0" id="3"/>
               </outline>
            </outlines>
            </object>
 </objects>

How to reproduce:

  1. let's open any xodr file for edit.
  2. find any road element and place above snippet just before the closing element
  3. Save the file and load this file into opendrive viewer.
  4. We will find that there is no impact of element as length and width of the object is 15 and 10 respectively. As per the outline element it should 10 and 7 respectively.
  5. Now let's remove the element from element and open it again in opendrive viewer, We will find that object looks same as before.

    References: OD1.6 -> https://releases.asam.net/OpenDRIVE/1.6.0/ASAM_OpenDRIVE_BS_V1-6-0.html#_objects OD1.7 -> https://www.asam.net/index.php?eID=dumpFile&t=f&f=4422&token=e590561f3c39aa2260e5442e29e93f6693d1cccd#top-e12007a5-2961-4fa0-9de7-cf748a4f26ab

    pageldev commented 1 year ago

    Thank you for reporting this detailed and how to reproduce! Should be fixed now:

    Background is that the <outlines> tag (parent tag for <outline>) was introduced in OpenDrive v1.45. When creating this library I targeted v1.4.

    Here are the changes in the format sepcification from 1.4 => 1.45. This is the relevant part: image