abstreet icon indicating copy to clipboard operation
abstreet copied to clipboard

LTN routing bug

Open dabreegster opened this issue 2 years ago • 6 comments

routing_bug Found by @nickmalleson

dabreegster avatar Nov 15 '22 17:11 dabreegster

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

dabreegster avatar Nov 15 '22 17:11 dabreegster

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. Screenshot from 2022-12-12 11-03-17 Screenshot from 2022-12-12 11-03-10 I don't think the problem is about turns from driveways; we're already using TripEndpoint::path_req which calls PathRequest::leave_from_driveway

dabreegster avatar Dec 12 '22 11:12 dabreegster

Screenshot from 2022-12-12 11-14-47 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.

dabreegster avatar Dec 12 '22 11:12 dabreegster

I have a smaller repro and am also being more clear when there's some problem: Screenshot from 2022-12-12 15-21-34

dabreegster avatar Dec 12 '22 15:12 dabreegster

Screenshot from 2023-03-03 13-26-31 Another puzzler to look into later...

dabreegster avatar Mar 03 '23 13:03 dabreegster

OK, the problem seems to be when we start on a road with a filter somewhere. Utterly broken: Screenshot from 2023-03-03 13-44-56 Working fine: Screenshot from 2023-03-03 13-45-14

dabreegster avatar Mar 03 '23 13:03 dabreegster