Skip to content

Commit

Permalink
Calmer representation of some values (#847)
Browse files Browse the repository at this point in the history
Due to the appearance and disappearance of some characters, the display in the car is unstable. This particularly affects the steering and acceleration values. Regarding the minus sign and the arrows. This PR reduces this behavior.
In addition, the links to the nightly builds in the `readme` are presented more clearly.
  • Loading branch information
SteWers authored Jan 1, 2025
1 parent d275121 commit c55f893
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The BMW/Mini IDrive NBT does not offer native Android Auto integration, but does

By relying on the Connected Apps technology, this app greatly extends the functionality of the car without any modifications or hacks. Any MY2014 or newer BMW or Mini equipped with NBT or NBT Evo and the "BMW Apps (6NR)" feature, an active [BMW ConnectedDrive subscription](https://bimmergestalt.github.io/AAIdrive/images/bmw-connected-subscription.png), or the "Mini Connected (SA6NM)" option should be compatible.

[![App List](docs/images/demo-applist.gif)<br />Gallery](https://bimmergestalt.github.io/AAIdrive/gallery.html)
[![App List](https://bimmergestalt.github.io/AAIdrive/images/demo-applist.gif)](https://bimmergestalt.github.io/AAIdrive/gallery.html)
[Gallery](https://bimmergestalt.github.io/AAIdrive/gallery.html)

Overview
--------
Expand All @@ -31,8 +32,8 @@ This app requires that the MyBMW or MINI app for your car is installed and that

Download the APK of the latest stable release from the [Releases page](https://github.com/BimmerGestalt/AAIdrive/releases/latest). Choose the one that says "sentry" to automatically upload crash reports, or choose "nonalytics" otherwise. It is also available on the [Google Play Store](https://play.google.com/store/apps/details?id=me.hufman.androidautoidrive). After starting, the app should detect the MyBMW app and start waiting for the car connection.

Also consider trying out the nightly build! It has the latest features and is a preview of the next release, so please consider installing the [Sentry build](https://bimmergestalt.s3.amazonaws.com/aaidrive/builds/androidautoidrive-latest-main-mapbox-sentry-release.apk) to automatically report crashes.
The [nonalytics](https://bimmergestalt.s3.amazonaws.com/aaidrive/builds/androidautoidrive-latest-main-mapbox-nonalytics-release.apk) build is available too.
Also consider trying out the nightly build! It has the latest features and is a preview of the next release, so please consider installing the [nightly sentry build](https://bimmergestalt.s3.amazonaws.com/aaidrive/builds/androidautoidrive-latest-main-mapbox-sentry-release.apk) to automatically report crashes.
The [nightly nonalytics build](https://bimmergestalt.s3.amazonaws.com/aaidrive/builds/androidautoidrive-latest-main-mapbox-nonalytics-release.apk) is available too.

Check out the [FAQ](https://bimmergestalt.github.io/AAIdrive/faq.html) if you run into problems.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,46 @@ class CarDetailedInfo(carCapabilities: Map<String, Any?>, cdsMetrics: CDSMetrics

// driving detail fields, as examples
// real ones would need translated labels
val accelContact = cdsMetrics.accelerator.format("%d%%").map { "$it ${L.CARINFO_ACCEL}"}
val accelContact = cdsMetrics.accelerator.format("% 3d%%").map { "$it ${L.CARINFO_ACCEL}"}
// val clutchContact = cdsMetrics.clutch.map { "Clutch $it"}
// val brakeContact = cdsMetrics.brake.map { "Brake $it ${Integer.toBinaryString(it).padStart(8, '0')}"}
val steeringAngle = cdsMetrics.steeringAngle.map {
val icon = if (it < 0) {""} else if (it > 0) {""} else {""}
"$icon %.0f°".format(it.absoluteValue)
val icon = if (it <= -0.5) {""} else if (it >= 0.5) {""} else {""}
"$icon % 3.0f°".format(it.absoluteValue)
}.map { "$it ${L.CARINFO_STEERING}" }
val speed = cdsMetrics.speedActual.format("%.0f").addPlainUnit(unitsSpeedLabel)
val speedGPS = cdsMetrics.speedGPS.format("%.0f").addPlainUnit(unitsSpeedLabel)
val torque =cdsMetrics.torque.format("%.0fNM").map { "$it ${L.CARINFO_TORQUE}" }
val speed = cdsMetrics.speedActual.format("% 3.0f").addPlainUnit(unitsSpeedLabel)
val speedGPS = cdsMetrics.speedGPS.format("% 3.0f").addPlainUnit(unitsSpeedLabel)
val torque =cdsMetrics.torque.format("% 3.0fNm").map { "$it ${L.CARINFO_TORQUE}" }
val engineRpm = cdsMetrics.engineRpm.map { "$it ${L.CARINFO_RPM}"}
val heading = cdsMetrics.heading.map { heading ->
val direction = CDSMetrics.compassDirection(heading)
val arrow = CDSMetrics.compassArrow(heading)
"$arrow $direction (${heading.toInt()}°)"
}
val gforces = cdsMetrics.accel.map { accel ->
val lat = accel.first?.let { "↔%.2f".format(it / 9.8) } ?: ""
val long = accel.second?.let { "↕%.2f".format(it / 9.8) } ?: ""
"$lat $long ${L.CARINFO_GFORCE}"
val lat = accel.first?.let {
(if (it > 0.048) {""} else if (it < -0.048) {""} else {""}) + // 0.048 ≈ 0.005 * 9.81
"%.2f".format(it.absoluteValue / 9.81)
} ?: ""
val long = accel.second?.let {
(if (it > 0.048) {""} else if (it < -0.048) {""} else {""}) + // 0.048 ≈ 0.005 * 9.81
"%.2f".format(it.absoluteValue / 9.81)
} ?: ""
"$lat $long${L.CARINFO_GFORCE}"
}
val gforceLat = cdsMetrics.accel.map { accel ->
val lat = accel.first?.let {"↔%.2f".format(it/9.8)} ?: ""
val lat = accel.first?.let {
(if (it > 0.048) {""} else if (it < -0.048) {""} else {""}) + // 0.048 ≈ 0.005 * 9.81
"%.2f".format(it.absoluteValue / 9.81)
} ?: ""
"$lat"
}
val gforceLong = cdsMetrics.accel.map { accel ->
val long = accel.second?.let {"↕%.2f".format(it/9.8)} ?: ""
"$long ${L.CARINFO_GFORCE}"
val long = accel.second?.let {
(if (it > 0.048) {""} else if (it < -0.048) {""} else {""}) + // 0.048 ≈ 0.005 * 9.81
"%.2f".format(it.absoluteValue / 9.81)
} ?: ""
"$long${L.CARINFO_GFORCE}"
}

// advanced driving fields that aren't translated
Expand Down

0 comments on commit c55f893

Please sign in to comment.