Fixed invalid speed being reported to telemetry system
This commit is contained in:
parent
2221629315
commit
91883a0510
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue