Closed 1ec5 closed 6 years ago
Noting here that the timing for the proposed distances of 1mi, 0.5mi, 1km, and 500m are inconsistent with our existing heuristics and can lead to premature announcements.
At 0.5mi, highway announcements are too early (28s) compared to our typical 15s announcement timing (https://github.com/mapbox/voyage-ios/issues/860).
The initial announcement should also be further out than 1mi and 1km on the highway, to allow sufficient time for switching across multiple lanes of traffic, exiting HOV lanes, etc.
Here's a refined set of highway timing heuristics based on some initial feedback until we can test more extensively:
2mi
(110s at highway speeds)0.25mi
(14s at highway speeds)2km
(72s at highway speeds)0.5km
(18s at highway speeds)I’d be interested in finding out whether the following approach could mitigate the concerns about lane switching time:
In some cases, these new thresholds would cause announcements to be delivered later than before. If this is a concern, we should investigate timing the announcement to end at the threshold rather than beginning at it, since we know how long a Polly-powered speech utterance will take to play.
These distances have been moved to the server.
This is a proposal to overhaul the logic that determines the current alert level to make voice announcements more straightforward and predictable for off-ramp steps, potentially as a first step to overhauling the rest of the alert level logic.
Essentially, the
medium
andhigh
alert levels would occur at specific distances ahead of the maneuver, with time thresholds still in place as fallbacks. Hopefully this approach will make the SDK feel more predictable to the user, so that they can better intuit the level of urgency of a particular voice announcement.Current behavior
RouteController.monitorStepProgress(_:)
tracks the expected time until the user reaches the maneuver point and the distance to the maneuver point. Whichever threshold is reached first determines when the alert level changes to medium then high. The time threshold gives us the flexibility to handle diverse speeds and traffic conditions, while the distance threshold serves as a failsafe for the time threshold.Unfortunately, we arrived at the current thresholds by trial and error, making them difficult to explain in a coherent manner. We’ve had to put lots of band-aids on top of this logic just to make it work. Some of these thresholds actually assume that the user is traveling in a parking lot, even if they’re on a freeway:
high
alert level 15 seconds or 100 meters ahead of a maneuver, regardless of the type of road. However, at a typical Canadian expressway speed of 100 km/h, a driver would cover 417 meters in 15 seconds or 100 meters in 3.6 seconds. In order for the distance threshold to kick in, the driver would need to be traveling no more than 24 km/h (15 mph).medium
alert level 70 seconds or 400 meters ahead of a maneuver. At 100 km/h, a driver would cover 1.9 km in 70 seconds or 400 meters in 14.4 seconds. The distance threshold assumes a speed of 21 km/h (13 mph).(65 mph / 100 km/h)
low
medium
1.9 km
<21 km/h
high
417 m
<24 km/h
Proposed rationale
Even though both time and distance thresholds are ultimately necessary, one as a backup for the other, we should consider deemphasizing the time threshold in favor of the distance threshold while driving on a freeway. Drivers have learned to receive instructions at specific distances on freeways, based on where advance guide signage is placed.
Here are some relevant passages from the MUTCD, which is the standard for road signage in the United States:
Proposed behavior
Based on the MUTCD guidelines, I propose the following set of heuristics as a starting point for discussion. On a freeway (where the road classes include
motorway
), we’d continue to change tolow
alert level when completing a maneuver. Otherwise:low
medium
high
The thresholds should vary based on the measurement system associated with the current system region: miles for the U.S. and UK, meters everywhere else. The values in the “effective time remaining” columns would inform the time thresholds we use as backup, but we can be flexible in order to accommodate a wider range of typical speeds. According to this survey of traffic engineering studies, the
high
threshold would comfortably allow for a couple lane changes.I’m uncertain about a few aspects of this proposal:
high
threshold is still far enough away from the maneuver that the user is unlikely to think of it as a “turn now” type of announcement, more like a “make sure you’re in the correct lane” announcement. Is it reasonable to expect the turn lane to be present a full half-mile out? Should we move thehigh
threshold to ¼ mile, so that the user expects this announcement to be more urgent?motorway
following the off-ramp instruction (at either aturn
ormerge
instruction)./cc @mapbox/navigation @mapbox/directions