From 91883a051085fa4e43453e6ff58c67196e10cacc Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 15 Nov 2024 17:06:33 +0100 Subject: [PATCH] Fixed invalid speed being reported to telemetry system --- docs/example_plugins/gpsd_location.py | 2 +- sbapp/sideband/sense.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/example_plugins/gpsd_location.py b/docs/example_plugins/gpsd_location.py index 2c3e713..06d47cd 100644 --- a/docs/example_plugins/gpsd_location.py +++ b/docs/example_plugins/gpsd_location.py @@ -67,7 +67,7 @@ class GpsdLocationPlugin(SidebandTelemetryPlugin): self.latitude = gpsd_latitude self.longitude = gpsd_longitude self.altitude = gpsd_altitude - self.speed = gpsd_speed + self.speed = gpsd_speed*3.6 # Convert from m/s to km/h self.bearing = gpsd_bearing epx = result.get("epx", None); epy = result.get("epy", None) diff --git a/sbapp/sideband/sense.py b/sbapp/sideband/sense.py index aa1c3fa..843149e 100644 --- a/sbapp/sideband/sense.py +++ b/sbapp/sideband/sense.py @@ -744,7 +744,8 @@ class Location(Sensor): if "altitude" in self._raw: self.altitude = self._raw["altitude"] if "speed" in self._raw: - self.speed = self._raw["speed"] + # Android GPS reports speed in m/s, convert to km/h + self.speed = self._raw["speed"]*3.6 if self.speed < 0: self.speed = 0 if "bearing" in self._raw: