TomTom Routing

This commit is contained in:
Dimitris
2026-02-09 13:36:05 +01:00
parent e9474695bf
commit 5141041b5c
12 changed files with 612 additions and 580 deletions

View File

@@ -88,7 +88,7 @@ class MainActivity : ComponentActivity() {
val routeModel = RouteModel()
var tilt = 50.0
val useMock = true
val type = 3 // simulate 2 test 3 gpx
val type = 1 // simulate 2 test 3 gpx
var currentIndex = 0
val stepData: MutableLiveData<StepData> by lazy {
@@ -309,20 +309,16 @@ class MainActivity : ComponentActivity() {
&& lastLocation.longitude != location.position.longitude
) {
val currentLocation = location(location.position.longitude, location.position.latitude)
// if (currentIndex == 0)
// navigationViewModel.loadTraffic(applicationContext, currentLocation, 0f)
// currentIndex = 1
val bearing = bearing(lastLocation, currentLocation, cameraPosition.value!!.bearing)
with(routeModel) {
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()
}
if (maneuverType in 39..42
&& leftStepDistance() < DESTINATION_ARRIVAL_DISTANCE
&& routeCalculator.leftStepDistance() < DESTINATION_ARRIVAL_DISTANCE
) {
// stopNavigation()
arrived = true
@@ -410,9 +406,6 @@ class MainActivity : ComponentActivity() {
)
val step = routeModel.currentStep()
println("Step: ${step.instruction} ${step.leftStepDistance}")
if (step.leftStepDistance == 70.0) {
println("")
}
if (index + 1 <= routeModel.curLeg.steps.size) {
//nextStepData.value = routeModel.nextStep()
}

View File

@@ -34,7 +34,7 @@ fun NavigationSheet(
val distance = (step.leftDistance / 1000).round(1)
if (step.lane.isNotEmpty()) {
routeModel.addLanes( step)
routeModel.iconMapper.addLanes( step)
}
Column {