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

Enhanced fork assignment logic #1912

Merged
merged 6 commits into from
Aug 23, 2019
Merged

Enhanced fork assignment logic #1912

merged 6 commits into from
Aug 23, 2019

Conversation

dgearhart
Copy link
Member

@dgearhart dgearhart commented Aug 23, 2019

Issue

Currently, there are instances where invalid fork instructions are produced or a ramp-to-ramp turn is missed.
Logic was added to do the following:

  1. Enhanced ramp fork determination - to make sure it is a forward direction road split
  2. Fixed logic to call out a ramp-to-ramp turn
  3. Collapse straight ramps

Improved 11% of the sample routes

Example

image

< BEFORE: invalid left fork, missing turn, and invalid right fork
< 2: Take the ramp on the right.
< 3: Keep left at the fork.
< 4: Keep right to take VA 286 North toward I 66/Reston.
> AFTER
> 2: Take the VA 286/SR 608/Fairfax County Parkway/West Ox Road ramp on the right.
> 3: Turn left to take the VA 286 North ramp toward I 66/Reston. | 0.3 mi

Tasklist

  • Add tests
  • Review - you must request approval to merge any PR to master
  • Generally use squash merge to rebase and clean comments before merging
  • Update the changelog

@@ -1243,6 +1243,21 @@ void ManeuversBuilder::SetManeuverType(Maneuver& maneuver, bool none_type_allowe
LOG_TRACE("ManeuverType=RAMP_STRAIGHT");
break;
}
case Maneuver::RelativeDirection::KReverse: {
Copy link
Member Author

Choose a reason for hiding this comment

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

this was to compensate for bad data

@@ -1645,6 +1660,10 @@ bool ManeuversBuilder::CanManeuverIncludePrevEdge(Maneuver& maneuver, int node_i
return false;
}
if (maneuver.ramp() && prev_edge->IsRampUse()) {
// Do not combine if ramp to ramp is not forward
Copy link
Member Author

Choose a reason for hiding this comment

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

to make sure we call out a ramp-to-ramp turn


// If node is fork
// and prev to curr edge is relative straight
if (node->fork() && ((turn_degree > 315) || (turn_degree < 45))) {
// and the intersecting edge count is less than 3
Copy link
Member Author

Choose a reason for hiding this comment

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

improved logic for fork determination - to remove the invalid forks

@@ -2195,7 +2220,8 @@ bool ManeuversBuilder::AreRampManeuversCombinable(std::list<Maneuver>::iterator
auto node = trip_path_->GetEnhancedNode(next_man->begin_node_index());
if (!node->HasTraversableOutboundIntersectingEdge(next_man->travel_mode()) ||
node->IsStraightestTraversableIntersectingEdgeReversed(curr_man->end_heading(),
next_man->travel_mode())) {
next_man->travel_mode()) ||
Copy link
Member Author

Choose a reason for hiding this comment

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

collapse straight ramps

@dgearhart dgearhart merged commit 479c42e into master Aug 23, 2019
@dgearhart dgearhart deleted the gdg_ramp_forks branch August 23, 2019 14:27
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.

None yet

2 participants