From b84196189409308c832c8e73d57852a20ed7e5c2 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 4 Jan 2020 19:12:50 +0100 Subject: [PATCH] hotfix gps position data wrong in payload --- src/gpsread.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gpsread.cpp b/src/gpsread.cpp index 99d4de77..03318284 100644 --- a/src/gpsread.cpp +++ b/src/gpsread.cpp @@ -74,12 +74,8 @@ int gps_config() { void gps_storelocation(gpsStatus_t *gps_store) { if (gps.location.isUpdated() && gps.location.isValid() && (gps.location.age() < 1500)) { - // gps_store->latitude = (int32_t)(gps.location.lat() * 1e6); - // gps_store->longitude = (int32_t)(gps.location.lng() * 1e6); - gps_store->latitude = - (int32_t)((gps.location.lat() + 90) / 180.0) * 16777215; - gps_store->longitude = - (int32_t)((gps.location.lng() + 180) / 360.0) * 16777215; + gps_store->latitude = (int32_t)(gps.location.lat() * 1e6); + gps_store->longitude = (int32_t)(gps.location.lng() * 1e6); gps_store->satellites = (uint8_t)gps.satellites.value(); gps_store->hdop = (uint16_t)gps.hdop.value(); gps_store->altitude = (int16_t)gps.altitude.meters();