From bad512f7e86c804244120e6957ec53dece081c45 Mon Sep 17 00:00:00 2001 From: PatrickRung Date: Sat, 16 Nov 2024 00:47:37 -0800 Subject: [PATCH] Changed most recents coords in read_usb_gps.cpp to contain altitude data so that altitude data is sent on from the gps on the rover outside of the simulation --- src/gps/usb_gps/read_usb_gps.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gps/usb_gps/read_usb_gps.cpp b/src/gps/usb_gps/read_usb_gps.cpp index ab961298..454d52cb 100644 --- a/src/gps/usb_gps/read_usb_gps.cpp +++ b/src/gps/usb_gps/read_usb_gps.cpp @@ -60,14 +60,15 @@ void gps_loop() { } else { double lat = newdata->fix.latitude; double lon = newdata->fix.longitude; - LOG_F(2, "Received fresh GPS data: (lat %.6f, lon %.6f).", lat, lon); + double alt = newdata->fix.altitude; + LOG_F(2, "Received fresh GPS data: (lat %.6f, lon %.6f).", lat, lon, alt); gps_mutex.lock(); if (!has_fix) { // This is our first fix has_fix = true; } - most_recent_coords = {lat, lon}; + most_recent_coords = {lat, lon, alt}; gps_time = dataclock::now(); gps_mutex.unlock(); }