osrm-backend
osrm-backend copied to clipboard
Fix a bug caused by support OSM traffic signal directions
I try fix a bug caused by support OSM traffic signal directions. With mjjbell's help, I learned a lot. I hope to get @mjjbell help and support.
Issue
https://github.com/Project-OSRM/osrm-backend/pull/6153#issuecomment-1763937197
- Problem 1: When crossing a directed traffic signal, the directed traffic signal sometimes does not work.
- Problem 2: There is a bug in the duration penalty of traffic signal, and the master branch also supports https://github.com/Project-OSRM/osrm-backend/pull/6339. When weight_name = duration or weight_name = routability, a crash of the macth_api may be triggered. Because the directed traffic signal sometimes does not work in the Edge-expanded Graph, but it does in the "duplicate" edges created for the restriction graph. Finally, the sum of the forwad_weight and reverse_weight is not equal to total_weight. Last but not least, they are not loop. https://github.com/Project-OSRM/osrm-backend/blob/31e31a63d062fb804f5f4695ed3036ca7a269ead/src/engine/routing_algorithms/routing_base_ch.cpp#L149 And then, it will crash in the line. https://github.com/Project-OSRM/osrm-backend/blob/31e31a63d062fb804f5f4695ed3036ca7a269ead/include/engine/routing_algorithms/routing_base.hpp#L182 https://github.com/Project-OSRM/osrm-backend/blob/31e31a63d062fb804f5f4695ed3036ca7a269ead/include/engine/routing_algorithms/routing_base.hpp#L184
Tasklist
- [x] CHANGELOG.md entry (How to write a changelog entry)
- [ ] update relevant Wiki pages
- [x] add tests (see testing documentation)
- [x] review
- [ ] adjust for comments
- [ ] cherry pick to release branch
Requirements / Relations
https://github.com/Project-OSRM/osrm-backend/pull/6153 https://github.com/Project-OSRM/osrm-backend/pull/6339 https://github.com/Project-OSRM/osrm-backend/pull/6153#issuecomment-1772192537
Hi, @SiarheiFedartsou. I added CHANGELOG and removed the comment. Thanks!
It would be beneficial to add minimal test cases to the Cucumber suite that capture the two problems you have identified.
It would be beneficial to add minimal test cases to the Cucumber suite that capture the two problems you have identified.
Hi, @mjjbell. I added two test cases to the Cucumber suite, but it only capture one problems (Problem 1). Another problem may require a more complex routing network to catch.😔
@GitBenjamin I'm going to add the fix to this PR for problem 1.
It's unclear if problem 2 would also be fixed, but we can address that in a separate PR once we have identified a minimal reproduction test case.
@GitBenjamin I'm going to add the fix to this PR for problem 1.
It's unclear if problem 2 would also be fixed, but we can address that in a separate PR once we have identified a minimal reproduction test case.
Problem 2 no longer occurs when I call Match API again, after I modify the traffic light compressed logic. I can try to do an analysis of that part of osm data again.