Skip to content

Comments

Do not overload user with info at roundabouts#561

Merged
bsudekum merged 7 commits intomasterfrom
roundabout-exit
Sep 12, 2017
Merged

Do not overload user with info at roundabouts#561
bsudekum merged 7 commits intomasterfrom
roundabout-exit

Conversation

@bsudekum
Copy link
Contributor

Roundabouts will soon have an exit maneuver. In the past, we have tried to make up for the fact that it is not there by over loading the enter roundabout maneuver with as much info as we could grab onto.

Now, when the user is entering the roundabout, we don't need to link the instruction if the instruction contains exit information.

Before:

Enter the roundabout and take the 4th exit onto Foo St and then turn right onto Bar St.

Now

Enter the roundabout and take the 4th exit onto Foo St.

Note: when the new maneuver type is added, this PR needs to account for it.

/cc @miccolis @danpat @1ec5

@bsudekum bsudekum added the ⚠️ DO NOT MERGE PR should not be merged! label Aug 29, 2017
@ericrwolfe
Copy link
Contributor

cc @cammace @danesfeder

} else if alertLevel == .high && upcomingStepDuration < linkedInstructionMultiplier {
text = String.localizedStringWithFormat(NSLocalizedString("LINKED_UTTERANCE_FORMAT", bundle: .mapboxCoreNavigation, value: "%@, then %@", comment: "Format for speech string; 1 = current instruction; 2 = the following linked instruction"), upComingInstruction, followOnInstruction)
// If the user is entering the roundabout and there is exit information, don't link instruction
if let upcomingStep = routeProgress.currentLegProgress.upComingStep, (upcomingStep.maneuverType == .takeRotary || upcomingStep.maneuverType == .takeRoundabout) && upcomingStep.exitIndex != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simplify this logic by waiting until Project-OSRM/osrm-backend#4358 is deployed and removing this special case altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@1ec5 yep, that's the idea. This PR would be a regression until then. We'll also need to update osrm-text-instructions to account for the new type.

Copy link
Contributor

@1ec5 1ec5 Sep 11, 2017

Choose a reason for hiding this comment

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

I think this code would read more naturally as:

if followOnInstruction.maneuverType == .exitRoundabout || followOnInstruction.maneuverType == .exitRotary

That way, if the developer fails to specify includesRoundaboutExitManeuver in the original route options and there’s a turn close to the exit, that turn won’t be omitted entirely.

@ericrwolfe ericrwolfe modified the milestone: v0.8.0-2 Sep 11, 2017
@bsudekum bsudekum removed the ⚠️ DO NOT MERGE PR should not be merged! label Sep 12, 2017
@bsudekum
Copy link
Contributor Author

@1ec5 this is mergeable now that roundabout_exits is live.

if let upcomingStep = routeProgress.currentLegProgress.upComingStep, upcomingStep.maneuverType == .exitRoundabout || upcomingStep.maneuverType == .exitRotary {
text = upComingInstruction
} else {
text = String.localizedStringWithFormat(NSLocalizedString("LINKED_UTTERANCE_FORMAT", bundle: .mapboxCoreNavigation, value: "%@, %@", comment: "Format for speech string; 1 = current instruction; 2 = the following linked instruction"), upComingInstruction, followOnInstruction)
Copy link
Contributor

Choose a reason for hiding this comment

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

The value changed from %@, then %@ to %@, %@. Is that intentional?

} else if alertLevel == .high && upcomingStepDuration < linkedInstructionMultiplier {
text = String.localizedStringWithFormat(NSLocalizedString("LINKED_UTTERANCE_FORMAT", bundle: .mapboxCoreNavigation, value: "%@, then %@", comment: "Format for speech string; 1 = current instruction; 2 = the following linked instruction"), upComingInstruction, followOnInstruction)
// If the upcoming step is an .exitRoundabout or .exitRotary, don't link the instruction
if let upcomingStep = routeProgress.currentLegProgress.upComingStep, upcomingStep.maneuverType == .exitRoundabout || upcomingStep.maneuverType == .exitRotary {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why upComingStep? Wouldn’t the upComingStep be takeRoundabout and followOnStep be exitRoundabout?

Copy link
Contributor

Choose a reason for hiding this comment

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

  • If upComingStep is takeRoundabout and followOnStep is exitRoundabout, we announce takeRoundabout then exitRoundabout. 🙅‍♂️
  • If upComingStep is exitRoundabout and followOnStep is turn, we announce just the exitRoundabout and never announce the turn. 🙅‍♂️

@bsudekum
Copy link
Contributor Author

@1ec5 good call, fixed to look at the followOnStep.

@bsudekum bsudekum merged commit 7816790 into master Sep 12, 2017
@bsudekum bsudekum deleted the roundabout-exit branch September 12, 2017 22:46
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.

3 participants