pageldev / libOpenDRIVE

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

Incorrect Successor/Predecessor Mapping Causing Path Planning Failures #77

Open Novadgaf opened 1 year ago

Novadgaf commented 1 year ago

I've been experiencing an issue regarding the routing graph within the libOpenDRIVE project, where the mapping of successors and predecessors does not seem to be functioning as expected. This misalignment in the routing graph is causing my path planning to fail.

To reproduce this issue, you can load the Carla Map Town 10HD on https://odrviewer.io/ and attempt to plot a route from road 90 to road 6. It's currently not possible to find this route, even though physically, the path is feasible. Instead, the tool indicates road 90 has only road 7 as a successor, leaving out road 6.

My understanding is that the correct behavior should involve a valid path from road 90 to road 6, indicating the correct successor/predecessor relations.

This problem likely resides in the part of the code responsible for constructing the routing graph. I would appreciate any insights into why this problem may be happening or tips on how to correct the issue in the routing graph.

markomiz commented 9 months ago

I could be misunderstading the code or the openDRIVE standard but maybe this is due to the routing graph assuming that if B is the successor of A then A is the predecessor of B. However, if the roads point toward each other (i.e. the reflines end in the same place) then the behaviour should be that A is also the successor of B. https://github.com/pageldev/libOpenDRIVE/blob/06cd665adf76a8909746bc849c3dd7b0bdc49133/src/RoutingGraph.cpp#L19

markomiz commented 8 months ago

@Novadgaf take a look at my fork - https://github.com/markomiz/libOpenDRIVE/tree/feature/fix_routes I fixed the issue and created a PR to the original