mapbox / mapbox/mapbox-navigation-android

Free Drive START events have always null location

Aperta
#3,797 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

archived Core
Lingua principale
Kotlin
Stelle
651
Fork
321
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Follow up ticket from https://github.com/mapbox/mapbox-navigation-android/pull/3791#issuecomment-729733263

From my tests START events never have location (is always null) 😞

We should check when the locationsCollector observer is registered because maybe trip session doesn't provide a location until the session is started but when it is started we immediately send event. The issue may be fixed if we do it after registering 🤔

cc @korshaknn

2020-11-18 11:29:20.995 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: Valid initialization
2020-11-18 11:29:43.459 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: session state is FREE_DRIVE
2020-11-18 11:29:43.459 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: sessionStop
2020-11-18 11:29:43.459 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: resetOriginalRoute
2020-11-18 11:29:43.459 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: resetRouteProgress
2020-11-18 11:29:43.459 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: trackFreeDrive START
2020-11-18 11:29:43.460 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: createFreeDriveEvent START
2020-11-18 11:29:43.476 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: populateFreeDriveEvent
2020-11-18 11:29:43.477 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: class com.mapbox.navigation.core.telemetry.events.NavigationFreeDriveEvent event sent
2020-11-18 11:29:43.504 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: Lifecycle monitor created
2020-11-18 11:29:43.509 25573-25573/com.mapbox.navigation.examples D/MAPBOX_TELEMETRY: onRawLocationChanged

onRawLocation is received after onNavigationSessionStateChanged when the event has been already sent.

override fun start() {
       if (state == TripSessionState.STARTED) {
           return
       }
       tripService.startService()
       startLocationUpdates()
       state = TripSessionState.STARTED
   }

startLocationUpdates is async and state executes the onSessionStateChanged right away before onRawLocationChanged.

We should investigate a different way to wait for the first location https://github.com/mapbox/mapbox-navigation-android/pull/3751#discussion_r521379048 and also discuss what to do if a session is started and no locations are received. Refs. https://github.com/mapbox/mapbox-navigation-android/issues/2827

cc @korshaknn @kmadsen @LukasPaczos

cc @korshaknn @kmadsen @LukasPaczos

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il flusso start() di TripSession, in particolare startLocationUpdates(), e traccia quando vengono recapitati onNavigationSessionStateChanged e onRawLocationChanged. Riproduci un evento FREE_DRIVE START e verifica se la prima posizione arriva dopo l’invio dell’evento. Il lavoro è completato quando è stato deciso e testato come START gestisce la prima posizione, incluso il caso in cui non venga ricevuta alcuna posizione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
kotlin
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.