Fix curbs to spawn in correct heights#111
Draft
PabloVD wants to merge 4 commits intoue5-digitaltwinsfrom
Draft
Conversation
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.
In current implementation, curbs are generated from splines spawned with a edge detection algorithm from a bird-eye render of the road. This works fine unless there are different layers of roads: for instance, a bridge over a highway. In that case, the road below the bridge does not have the correspondent curb since is overlapped in the render.
To represent different height roads, in this PR we split roads in two layers: layer 0 as the roads whose points are all on the floor and layer 1 for those which can go higher, such as bridges. The edge detection scripts are thus run for each of the layers, avoiding overlap with roads below bridges.
Moreover, in current implementation, splines are projected to the floor rather than to the exact height of the road, which does not work well for bridges.
In this PR, once the curb spline is generated, it is placed at the correct height using a raycast. This part of the algorithm is done by UOpenDriveToMap::AlignSplineToRoadMesh, but it is not fully working yet, since not all curbs are spawned at the correct height yet but some are.
A possible problem which may arise is the joint between roads of different layers, which may input an inexistent curb there. We need to test if that issue happens and find a way to avoid that.
OSM map used for testing (bridge over highway close to UAB):
https://overpass-api.de/api/map?bbox=2.094655,41.490948,2.096264,41.492812
Linked to this content PR.