mapbox/mapbox-navigation-android

mapboxreplay jumping to specific location in virtual driving

gaqraa92 opened this issue · 0 comments

Hi
While demonstrating the virtual drive using replay location, I sometimes need to skip to specific points, I do this by pushing the events as you can see in the below code then calling seek to function.
For unknown reasons sometimes it is not working and I got " [nav-native]: Location is not coherent with previous one. Filtering... , [nav-native]: Location at timestamp 37348087802165ns was filtered out." in the logs

`val events: ArrayList = arrayListOf()
var constTime = 1000
locations?.forEach { location->
val time = Date().time.toDouble() + constTime
Log.d("currentTimeMillis",time.toString())
val e = ReplayRouteMapper.mapToUpdateLocation(
time,
location
)
constTime += 1000
events.add(e)
}

//push the events

mapboxReplayer.pushEvents(events)
//to seek to event
val point = mapBoxViewModel.jumpingLocations.value?.get(step) ?: return
mapboxReplayer.stop()
// mapboxReplayer.pushEvents(events = listOf(event))
//mapboxReplayer.playFirstLocation()
mapboxReplayer.seekTo(event)
mapboxReplayer.play()
`

Android API: 34
**Mapbox Navigation SDK version:**2.5.3

Steps to trigger behavior

1.push the events to mapboxplayer
2.at run time stop, seek to an event then play
3.sometimes it is not seek

Expected behavior

Expected to seek to the point all the time

Actual behavior

some times it is stay at the same position with the below logs :
[nav-native]: Location is not coherent with previous one. Filtering...
[nav-native]: Location at timestamp 37348087802165ns was filtered out.
[nav-native]: Got location timestamp from the past: 30773684685738ns <= 30773881864863ns. No status will be produced.