pageldev / libOpenDRIVE

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

Lane Height not generated correctly between adjacent lanes #92

Open ge25bec opened 8 months ago

ge25bec commented 8 months ago

I'm trying to generate a heightened curb on the side of a road, so there should be 90 degree angle between it and the adjacent driving lane. But the library generates a diagonal between the driving lane and the curb, which I don't think is how it is intended in the OpenDRIVE standard. I think specifying super elevation, instead of lane height, would be the more accurate approach in that case.

This is what it generates:                           This is what I think it should look like:
       

I generated the second picture by adding a very narrow lane between the two lanes (The part that I commented out from the OpenDRIVE below), which effectively does the height transition for them. But I don't think that is the most elegant solution.

<?xml version="1.0" standalone="yes"?>
<OpenDRIVE>
    <header revMajor="1" revMinor="4" name="" version="1.00" date="Mon Nov 20 07:28:45 2023" north="0.0" south="0.0" east="0.0" west="0.0">
    </header>
    <road name="straight road" length="1.0000000000000000e+02" id="0" junction="-1">
        <link>
        </link>
        <planView>
            <geometry s="0.0000000000000000e+00" x="0.0000000000000000e+00" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="1.0000000000000000e+02">
                <line/>
            </geometry>
        </planView>
        <lateralProfile>
        </lateralProfile>
        <lanes>
            <laneSection s="0">
                <left>
                    <lane id="2" type="sidewalk" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="2.5" b="0.0" c="0.0" d="0.0"/>
                        <height sOffset="0.0" inner="0.0" outer="0.0"/>
                    </lane>
                    <lane id="1" type="driving" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="3.2" b="0.0" c="0.0" d="0.0"/>
                    </lane>
                </left>
                <center>
                    <lane id="0" type="driving" level= "false">
                        <link>
                        </link>
                    </lane>
                </center>
                <right>
                    <lane id="-1" type="driving" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="3.2" b="0.0" c="0.0" d="0.0"/>
                        <height sOffset="0.0" inner="0.0" outer="0.0"/>                        
                    </lane>
                    <!-- <lane id="-2" type="curb" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="0.000000000000001" b="0.0" c="0.0" d="0.0"/>
                        <height sOffset="0.0" inner="0.0" outer="1.0"/>                        
                    </lane> -->
                    <lane id="-3" type="curb" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="2.5" b="0.0" c="0.0" d="0.0"/>
                        <height sOffset="0.0" inner="1.0" outer="1.0"/>
                    </lane>
                </right>
            </laneSection>
        </lanes>
        <objects/>     
        <signals/>
        <surface/>
    </road>
</OpenDRIVE>

I'm currently trying to fix the issue myself, but haven't succeeded yet. Do you know where the problem could lie, or is it behaving the way you intended it to?