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

Obvious maneuvers #2436

Merged
merged 20 commits into from
Jun 30, 2020
Merged

Obvious maneuvers #2436

merged 20 commits into from
Jun 30, 2020

Conversation

dgearhart
Copy link
Member

@dgearhart dgearhart commented Jun 24, 2020

Issue

Identify and collapse obvious maneuvers

Fixes #1744
Fixes #91
Fixes #82

Stats for 1k user routes

  • Improved 67% of the route narratives
  • Reduced maneuvers by 12%

Example#1

< BEFORE
< 2: Turn left onto US 422/West Chocolate Avenue.
< 3: Continue on US 322 West.
< 4: Take the exit toward Middletown/Hummelstown.
< 5: Turn left onto Quarry Road.
< 6: Continue on Waltonville Road.
< 7: You have arrived at your destination.
> AFTER
> 2: Turn left onto US 422/West Chocolate Avenue.
> 3: Take the exit toward Middletown/Hummelstown.
> 4: Turn left onto Quarry Road.
> 5: You have arrived at your destination.

image

Example#2

< BEFORE
< 2: Take exit 31C on the left onto White Marsh Boulevard toward White Marsh.
< 3: Continue on MD 43/White Marsh Boulevard.
< 4: Turn right onto Perry Hills Court.
> AFTER
> 2: Take exit 31C on the left onto MD 43 East/White Marsh Boulevard toward White Marsh.
> 3: Turn right onto Perry Hills Court.

image

Example#3

< BEFORE
< 2: Turn left onto Britzer Damm.
< 3: Continue on Britzer Brücke.
< 4: Continue on Britzer Damm.
< 5: Turn left onto Franz-Körner-Straße.
> AFTER
> 2: Turn left onto Britzer Damm.
> 3: Turn left onto Franz-Körner-Straße.

image

Tasklist

  • Add RAD tests
  • Update gurka tests
  • Add pinpoint tests
  • Add gurka tests
  • Add #fixes with the issue number that this PR addresses
  • Generally use squash merge to rebase and clean comments before merging
  • Update the changelog

@@ -1297,6 +1300,24 @@ bool EnhancedTripLeg_Node::HasIntersectingEdgeCurrNameConsistency() const {
return false;
}

bool EnhancedTripLeg_Node::HasNonBackwardTraversableSameNameIntersectingEdge(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add some comments on what this function does?

Copy link
Member Author

Choose a reason for hiding this comment

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

@mandeepsandhu i added comments

@@ -2421,8 +2519,14 @@ void ManeuversBuilder::ProcessRoundaboutNames(std::list<Maneuver>& maneuvers) {
// Process roundabout exit names and signs
if (next_man->type() == DirectionsLeg_Maneuver_Type_kRoundaboutExit) {
if (next_man->HasBeginStreetNames()) {
curr_man->set_roundabout_exit_begin_street_names(next_man->begin_street_names().clone());
curr_man->set_roundabout_exit_street_names(next_man->street_names().clone());
if (next_man->contains_obvious_maneuver()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any concerns that this will cause issues when we merge it with #2437 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

No issues

Copy link
Member Author

Choose a reason for hiding this comment

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

@danpaz I tested - this looks good

Fixed the FormVerbalPostTransitionInstruction method for obvious maneuvers
No default values for the test_instructions method
@dgearhart dgearhart self-assigned this Jun 26, 2020
"Continue toward B1, Little Italy. Then You will arrive at your destination.",
"Continue for 200 meters.");
}
// TODO: expand map for obvious maneuver
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this still a TODO @dgearhart ?

Copy link
Member Author

@dgearhart dgearhart Jun 30, 2020

Choose a reason for hiding this comment

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

yes - I will update in separate PR

@@ -2369,6 +2397,76 @@ bool ManeuversBuilder::AreRampManeuversCombinable(std::list<Maneuver>::iterator
return false;
}

bool ManeuversBuilder::IsNextManeuverObvious(std::list<Maneuver>& maneuvers,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think all the args can be const refs? Or are we modifying them somewhere within (I couldn't find any place where we were, but I might've missed something)?

Copy link
Member Author

Choose a reason for hiding this comment

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

made params const


// Return true if a short continue maneuver
// and the following maneuver is not a continue
if (next_man->length(Options_Units_kilometers) < kShortContinueThreshold) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this function be called with next_man pointing to the last/arrival maneuver? If so, should we return false if next_next_man == maneuvers.end() ?

Copy link
Member Author

Choose a reason for hiding this comment

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

next_man must be a DirectionsLeg_Maneuver_Type_kContinue

@@ -0,0 +1,128 @@
#include "gurka.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for these tests! Its really easy to visualize how the continue collapsing is working! 🙏

mandeepsandhu
mandeepsandhu previously approved these changes Jun 30, 2020
Copy link
Contributor

@mandeepsandhu mandeepsandhu left a comment

Choose a reason for hiding this comment

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

Just a few minor comments. Rest LGTM!

Copy link
Collaborator

@danpaz danpaz left a comment

Choose a reason for hiding this comment

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

👍 nice work!

@dgearhart dgearhart merged commit 0f160fd into master Jun 30, 2020
@dgearhart dgearhart deleted the obvious_maneuvers branch June 30, 2020 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants