Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid calling out "keep left/right" when passing an exit #3349

Merged
merged 29 commits into from
Nov 10, 2021
Merged

Conversation

ktatterso
Copy link
Contributor

@ktatterso ktatterso commented Oct 7, 2021

Issue

If passing by an exit that is preceded by a "standard length" deceleration lane, avoid calling out a maneuver, e.g., "Keep left/right" to stay on the main road.

Examples

Example 1

Before

Screen Shot 2021-11-02 at 4 20 14 PM

After

Screen Shot 2021-11-02 at 4 51 51 PM

Example 2

Before

Screen Shot 2021-11-02 at 4 33 28 PM

After

Screen Shot 2021-11-02 at 4 47 28 PM

Solution

If we detect that the lane bifurcation/split is due to a deceleration lane, we avoid calling out the "keep left/right" maneuver.

The length of a deceleration lane is predictable as a function of road speed. I used the results from this research paper.

The logic works backwards from the bifurcation, adding up edge lengths until 1) the extra lane goes away, or 2) we exceed the standard (+tol) length of a deceleration lane.

If we determine that the length of the additional lane fits the standard length of a deceleration lane (within tolerance), we do not call out the "keep left/right" maneuver.

Tasklist

  • Add tests
  • Add #fixes with the issue number that this PR addresses
  • Update the docs with any new request parameters or changes to behavior described
  • Update the changelog
  • If you made changes to the lua files, update the taginfo too.

@ktatterso ktatterso changed the title trying a diff angle for fork WIP: trying a diff angle for fork Oct 14, 2021
uint32_t curr_lane_count = curr_edge->lane_count();
// Going from N+1 lanes to N lanes by virtue of a deceleration/exit lane.
if (prev_lane_count == curr_lane_count + 1) {
if (prev_edge->HasTurnLane(kTurnLaneSlightRight) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about when we have an odd number of lanes on the previous edge - that the middle lane needs to have two directions (split) for us to use as fork. The only downside would be that the lane info must be present for us to mark as fork in these cases.

@ktatterso ktatterso changed the title WIP: trying a diff angle for fork WIP: avoid calling out "keep left/right" when passing an exit Nov 2, 2021
if (prev_edge->IsHighway() &&
((curr_edge->IsHighway() && (xedge->use() == TripLeg_Use_kRampUse)) ||
(xedge->IsHighway() && curr_edge->IsRampUse())) &&
has_lane_bifurcation(trip_path_, node_index, prev_edge, curr_edge, xedge) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for the lane-bifurcation now has precedence over the fork-forward angle checks.

@ktatterso ktatterso changed the title WIP: avoid calling out "keep left/right" when passing an exit Avoid calling out "keep left/right" when passing an exit Nov 2, 2021
@ktatterso ktatterso marked this pull request as ready for review November 2, 2021 23:04
@dgearhart
Copy link
Member

@ktatterso I am trying to understand this diff between master and branch - since I do not see a deceleration lane

Request:

j '{"locations":[{"lat":36.089000,"lon":-96.032177,"street":"I 44 West"},{"lat":36.068354,"lon":-96.065311,"street":"I 44 West"}],"costing":"auto","units":"miles"}'

Master

image

Branch

image

Transition point:

image

@ktatterso
Copy link
Contributor Author

@dgearhart Brilliant find. There are a couple things going on. I'm testing a fix.

@ktatterso
Copy link
Contributor Author

I've tried a bunch of things to more accurately determine the length of a deceleration lane. In short, I've empirically determined that 1) decel lane length as a function of speed is linear, and 2) I've run a whole bunch of routes so I could apply a linear regression to determine the best real world equation for "deceleration lane length as a function of speed".

Copy link
Member

@dgearhart dgearhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent - test results looked good to me. Thanks for the explanation of your analysis. Thank you @ktatterso 🚢

@ktatterso ktatterso merged commit d197821 into master Nov 10, 2021
@ktatterso ktatterso deleted the fork-tweak branch November 10, 2021 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants