a-b-street / abstreet

Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
https://a-b-street.github.io/docs/
Apache License 2.0
7.71k stars 343 forks source link

LTN routing bug #1029

Open dabreegster opened 1 year ago

dabreegster commented 1 year ago

routing_bug Found by @nickmalleson

dabreegster commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

dabreegster commented 1 year ago

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