Skip to content

Commit

Permalink
AP_GPS: SBF report correct satellite count on NrSV DNU value
Browse files Browse the repository at this point in the history
When the NrSV field of the SBF PVTGeodetic message contains the
Do-Not-Use value of 255, set the satellite count to 0 instead of
ignoring the change.
  • Loading branch information
flyingthingsintothings committed Mar 26, 2024
1 parent ac271cf commit 716166a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libraries/AP_GPS/AP_GPS_SBF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,8 @@ AP_GPS_SBF::process_message(void)
set_alt_amsl_cm(state, ((float)temp.Height - temp.Undulation) * 1e2f);
}

if (temp.NrSV != 255) {
state.num_sats = temp.NrSV;
}
// Important to reset count if DNU to use IMU instead
state.num_sats = temp.NrSV != 255 ? temp.NrSV : 0;

Debug("temp.Mode=0x%02x\n", (unsigned)temp.Mode);
switch (temp.Mode & 15) {
Expand Down

0 comments on commit 716166a

Please sign in to comment.