Skip to content

Fix curbs to spawn in correct heights#111

Draft
PabloVD wants to merge 4 commits intoue5-digitaltwinsfrom
pablo/splines_layers
Draft

Fix curbs to spawn in correct heights#111
PabloVD wants to merge 4 commits intoue5-digitaltwinsfrom
pablo/splines_layers

Conversation

@PabloVD
Copy link
Contributor

@PabloVD PabloVD commented Sep 19, 2025

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.

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