AP_GPS: understand uBlox fix_type of 4 as being GNSS and dead reckoning

This commit is contained in:
Peter Barker 2024-08-13 18:08:56 +10:00
parent d225683d69
commit c5cc89b894

View File

@ -1663,18 +1663,18 @@ AP_GPS_UBLOX::_parse_gps(void)
state.have_undulation = true; state.have_undulation = true;
state.undulation = (_buffer.pvt.h_msl - _buffer.pvt.h_ellipsoid) * 0.001; state.undulation = (_buffer.pvt.h_msl - _buffer.pvt.h_ellipsoid) * 0.001;
set_alt_amsl_cm(state, _buffer.pvt.h_msl / 10); set_alt_amsl_cm(state, _buffer.pvt.h_msl / 10);
switch (_buffer.pvt.fix_type) switch (_buffer.pvt.fix_type) {
{ case 0: // no fix
case 0:
state.status = AP_GPS::NO_FIX; state.status = AP_GPS::NO_FIX;
break; break;
case 1: case 1: // dead-reckoning only
state.status = AP_GPS::NO_FIX; state.status = AP_GPS::NO_FIX;
break; break;
case 2: case 2: // 2D-fix
state.status = AP_GPS::GPS_OK_FIX_2D; state.status = AP_GPS::GPS_OK_FIX_2D;
break; break;
case 3: case 3: // 3D-fix
case 4: // GNSS + dead-reckoning combined
state.status = AP_GPS::GPS_OK_FIX_3D; state.status = AP_GPS::GPS_OK_FIX_3D;
if (_buffer.pvt.flags & 0b00000010) // diffsoln if (_buffer.pvt.flags & 0b00000010) // diffsoln
state.status = AP_GPS::GPS_OK_FIX_3D_DGPS; state.status = AP_GPS::GPS_OK_FIX_3D_DGPS;
@ -1683,15 +1683,10 @@ AP_GPS_UBLOX::_parse_gps(void)
if (_buffer.pvt.flags & 0b10000000) // carrsoln - fixed if (_buffer.pvt.flags & 0b10000000) // carrsoln - fixed
state.status = AP_GPS::GPS_OK_FIX_3D_RTK_FIXED; state.status = AP_GPS::GPS_OK_FIX_3D_RTK_FIXED;
break; break;
case 4: case 5: // time only fix
GCS_SEND_TEXT(MAV_SEVERITY_INFO,
"Unexpected state %d", _buffer.pvt.flags);
state.status = AP_GPS::GPS_OK_FIX_3D;
break;
case 5:
state.status = AP_GPS::NO_FIX; state.status = AP_GPS::NO_FIX;
break; break;
default: default:
state.status = AP_GPS::NO_FIX; state.status = AP_GPS::NO_FIX;
break; break;
} }