TomTom Routing

This commit is contained in:
Dimitris
2026-02-09 08:44:57 +01:00
parent 0d51c6121d
commit e9474695bf
8 changed files with 95 additions and 70 deletions

View File

@@ -87,8 +87,8 @@ class MainActivity : ComponentActivity() {
val routeModel = RouteModel()
var tilt = 50.0
val useMock = false
val type = 1 // simulate 2 test 3 gpx
val useMock = true
val type = 3 // simulate 2 test 3 gpx
var currentIndex = 0
val stepData: MutableLiveData<StepData> by lazy {
@@ -317,6 +317,7 @@ class MainActivity : ComponentActivity() {
if (isNavigating()) {
updateLocation(currentLocation, navigationViewModel)
stepData.value = currentStep()
println("Step: ${stepData.value!!.instruction} ${stepData.value!!.leftStepDistance}")
if (route.currentStepIndex + 1 <= curLeg.steps.size) {
nextStepData.value = nextStep()
}
@@ -390,7 +391,7 @@ class MainActivity : ComponentActivity() {
for ((index, waypoint) in routeModel.curRoute.waypoints.withIndex()) {
if (routeModel.isNavigating()) {
val deviation = 0.0
if (index in 300..routeModel.curRoute.waypoints.size) {
if (index in 0..routeModel.curRoute.waypoints.size) {
mock.setMockLocation(waypoint[1], waypoint[0])
delay(500L) //
}
@@ -408,7 +409,7 @@ class MainActivity : ComponentActivity() {
navigationViewModel
)
val step = routeModel.currentStep()
println("Step: ${step}")
println("Step: ${step.instruction} ${step.leftStepDistance}")
if (step.leftStepDistance == 70.0) {
println("")
}