stadiamaps / stadiamaps/ferrostar
Check route deviation before step advance
- Dominant language
- Kotlin
- Stars
- 419
- Forks
- 81
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 7
Description
Hi,
I've been testing new step advance and route deviation conditions implemented recently by @Archdoog. I use following config:
```
SwiftNavigationControllerConfig(
waypointAdvance: .waypointAlongAdvancingStep(20.0),
stepAdvanceCondition: stepAdvanceOr(conditions: [
stepAdvanceDistanceEntryAndSnappedExit(
distanceToEndOfStep: 20,
distanceAfterEndOfStep: 2,
minimumHorizontalAccuracy: NavigationConfig.minimumHorizontalAccuracy
),
stepAdvanceDistanceFromStep(
distance: UInt16(NavigationConfig.maxRouteDeviation) + 5,
minimumHorizontalAccuracy: NavigationConfig.minimumHorizontalAccuracy,
calculateWhileOffRoute: false
)
]),
arrivalStepAdvanceCondition: stepAdvanceDistanceToEndOfStep(
distance: 20,
minimumHorizontalAccuracy: NavigationConfig.minimumHorizontalAccuracy
),
routeDeviationTracking: .staticThreshold(
minimumHorizontalAccuracy: NavigationConfig.minimumHorizontalAccuracy,
maxAcceptableDeviation: NavigationConfig.maxRouteDeviation
),
snappedLocationCourseFiltering: .snapToRoute
)
```
Now, if I'm on route and then I jump to NavigationConfig.maxRouteDeviation + 10m, Ferrostar will advance step (via stepAdvanceDistanceFromStep) before triggering off route state. That's incorrect behavior. If user position is updated in small increments, the problem often won't be visible, but still, I'd consider that a bug.
I think this could be fixed by first checking the off route condition and then step advance. What do you think?
Contributor guide
Research direction
Start by tracing the implementation of stepAdvanceCondition and routeDeviationTracking in the navigation engine, using the SwiftNavigationControllerConfig example as the reproduction setup. Verify the behavior when a location jumps beyond maxRouteDeviation, then add or update coverage so off-route handling occurs before step advancement and the regression is captured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin, swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100