Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating 90 degree angle on adjacent lanes with different lane heights #93

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

ge25bec
Copy link
Contributor

@ge25bec ge25bec commented Nov 23, 2023

Fixes issue #92

It seems the problem is that Road::get_surface_pt uses LaneSection::get_lane_id, which doesn't take a height parameter. For a point on the border of two lanes, the method will always create a vertex with the outer height of the inner lane. I changed Road::get_lane_mesh so it now generates another vertex, which has the inner height of the outer lane and is linked in the mesh accordingly.

ge25bec and others added 12 commits November 21, 2023 17:43
uses additional height parameter
- Lane::get_height_offset(const double s)
- overload for LaneSection::get_lane_id using height value
Adjacent lanes with different lane heights now have additional vertices in the mesh, to generate a 90 degree transition between them
uses additional height parameter
- Lane::get_height_offset(const double s)
- overload for LaneSection::get_lane_id using height value
Adjacent lanes with different lane heights now have additional vertices in the mesh, to generate a 90 degree transition between them
- added s values of inner lane height offsets to mesh generation of the outer lane
…ion' into fix/adjacent-lane-height-transition
@ge25bec
Copy link
Contributor Author

ge25bec commented Nov 27, 2023

I also added a fix for situations like this:

generated in the Online OpenDRIVE viewer with this .xodr file

<?xml version="1.0" standalone="yes"?>
<OpenDRIVE>
    <header revMajor="1" revMinor="4" name="" version="1.00" date="Wed Jul  1 07:28:45 2020" north="0.0" south="0.0" east="0.0" west="0.0">
    </header>
    <road name="test road" length="2.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>
            <geometry s="1.0000000000000000e+02" x="1.0000000000000000e+02" y="0.0000000000000000e+00" hdg="0.0000000000000000e+00" length="1.0000000000000000e+02">
                <arc curvature="0.02"/>
            </geometry>
        </planView>
        <lateralProfile>
        </lateralProfile>
        <lanes>
            <laneSection s="0">
                <left>
                    <lane id="1" type="driving" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="3.0" 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.0" b="0.0" c="0.0" d="0.0"/>                     
                    </lane>
                    <lane id="-2" type="driving" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="3.0" b="0.0" c="0.0" d="0.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="0.0" outer="0.0"/>
                        <height sOffset="25.0" inner="1.0" outer="1.0"/>
                    </lane>
                    <lane id="-4" type="border" level= "false">
                        <link>
                        </link>
                        <width sOffset="0.0" a="5.0" b="0.0" c="0.0" d="0.0"/>
                    </lane>
                </right>
            </laneSection>
        </lanes>
        <objects/>     
        <signals/>
        <surface/>
    </road>
</OpenDRIVE>

where the inner lane has multiple height offsets different from the outer lane. Now the outer lane also generates vertices at the s_to_height_offset values from the inner lane and connects to them in the mesh.

@ge25bec ge25bec marked this pull request as ready for review November 27, 2023 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant