Skip to content

Commit

Permalink
Changed most recents coords in read_usb_gps.cpp to contain altitude d…
Browse files Browse the repository at this point in the history
…ata so that altitude data is sent on from the gps on the rover outside of the simulation
  • Loading branch information
PatrickRung committed Nov 16, 2024
1 parent 413b681 commit bad512f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gps/usb_gps/read_usb_gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit bad512f

Please sign in to comment.