abstreet
abstreet copied to clipboard
LTN routing bug
Found by @nickmalleson
Quick guess: if we exit the driveway and turn left, there's no choice but to go through the filter at the pathfinding layer. (No u-turns are generated at the filter.) Probably need to use PathRequest::leave_from_driveway
to allow right turns out
I can repro this bug. It's fine to start on Hawksworth Grove, but if we force a start on Vesper Road, the problem happens.
I don't think the problem is about turns from driveways; we're already using
TripEndpoint::path_req
which calls PathRequest::leave_from_driveway
If I adjust the filter slightly, it's fine.
The bug: we can't start a route on the same road where there's a filter, even if the route would go the other way on the road. https://github.com/a-b-street/abstreet/blob/1f24af176cc6c25b685361b8a31f0fd0a113b05d/map_model/src/pathfind/mod.rs#L191 is too blunt.
Additionally there's some kind of weird bug with https://github.com/a-b-street/abstreet/blob/1f24af176cc6c25b685361b8a31f0fd0a113b05d/apps/ltn/src/route_planner.rs#L210. If I uncomment, no blue path is drawn, and we show "driving time after 0", because the path calculation was actually unsuccessful. Need to be more careful here.
I have a smaller repro and am also being more clear when there's some problem:
Another puzzler to look into later...
OK, the problem seems to be when we start on a road with a filter somewhere. Utterly broken:
Working fine: