Auto Drive Simulation
This commit is contained in:
@@ -3,6 +3,7 @@ plugins {
|
||||
alias(libs.plugins.kotlin.compose)
|
||||
kotlin("plugin.serialization") version "2.2.21"
|
||||
alias(libs.plugins.kotlin.kapt)
|
||||
//id("com.google.protobuf") version "0.9.6"
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
@@ -125,12 +125,13 @@ object Constants {
|
||||
|
||||
const val MAXIMAL_ROUTE_DEVIATION = 80.0
|
||||
|
||||
const val DESTINATION_ARRIVAL_DISTANCE = 40.0
|
||||
const val DESTINATION_ARRIVAL_DISTANCE = 20.0
|
||||
|
||||
const val NEAREST_LOCATION_DISTANCE = 10F
|
||||
|
||||
const val MAXIMUM_LOCATION_DISTANCE = 100000F
|
||||
|
||||
const val TRAFFIC_UPDATE = 300
|
||||
const val GMS_CAR_SPEED_PERMISSION = "com.google.android.gms.permission.CAR_SPEED"
|
||||
|
||||
const val AUTOMOTIVE_CAR_SPEED_PERMISSION = "android.car.permission.CAR_SPEED"
|
||||
|
||||
@@ -21,6 +21,9 @@ private const val tomtomFields =
|
||||
|
||||
const val useAsset = false
|
||||
|
||||
const val useAssetTraffic = false
|
||||
|
||||
|
||||
class TomTomRepository : NavigationRepository() {
|
||||
override fun getRoute(
|
||||
context: Context,
|
||||
@@ -63,7 +66,7 @@ class TomTomRepository : NavigationRepository() {
|
||||
val repository = getSettingsRepository(context)
|
||||
val tomtomApiKey = runBlocking { repository.tomTomApiKeyFlow.first() }
|
||||
val bbox = calculateSquareRadius(location.latitude, location.longitude, 15.0)
|
||||
return if (useAsset) {
|
||||
return if (useAssetTraffic) {
|
||||
val trafficJson = context.resources.openRawResource(R.raw.tomtom_traffic)
|
||||
trafficJson.bufferedReader().use { it.readText() }
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user