From 38a8a772f86f023750a6756ace6aa4240b8f8c0f Mon Sep 17 00:00:00 2001 From: mirkix Date: Thu, 18 Jun 2015 16:53:28 +0200 Subject: [PATCH] AP_GPS: Add fix status 3D+DGPS --- libraries/AP_GPS/AP_GPS_UBLOX.cpp | 10 ++++++++-- libraries/AP_GPS/AP_GPS_UBLOX.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/AP_GPS/AP_GPS_UBLOX.cpp b/libraries/AP_GPS/AP_GPS_UBLOX.cpp index 7938645384..c32b27969e 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.cpp +++ b/libraries/AP_GPS/AP_GPS_UBLOX.cpp @@ -468,7 +468,10 @@ AP_GPS_UBLOX::_parse_gps(void) _buffer.status.fix_status, _buffer.status.fix_type); if (_buffer.status.fix_status & NAV_STATUS_FIX_VALID) { - if( _buffer.status.fix_type == AP_GPS_UBLOX::FIX_3D) { + if( (_buffer.status.fix_type == AP_GPS_UBLOX::FIX_3D) && + (_buffer.status.fix_status & AP_GPS_UBLOX::NAV_STATUS_DGPS_USED)) { + next_fix = AP_GPS::GPS_OK_FIX_3D_DGPS; + }else if( _buffer.status.fix_type == AP_GPS_UBLOX::FIX_3D) { next_fix = AP_GPS::GPS_OK_FIX_3D; }else if (_buffer.status.fix_type == AP_GPS_UBLOX::FIX_2D) { next_fix = AP_GPS::GPS_OK_FIX_2D; @@ -490,7 +493,10 @@ AP_GPS_UBLOX::_parse_gps(void) _buffer.solution.fix_status, _buffer.solution.fix_type); if (_buffer.solution.fix_status & NAV_STATUS_FIX_VALID) { - if( _buffer.solution.fix_type == AP_GPS_UBLOX::FIX_3D) { + if( (_buffer.solution.fix_type == AP_GPS_UBLOX::FIX_3D) && + (_buffer.solution.fix_status & AP_GPS_UBLOX::NAV_STATUS_DGPS_USED)) { + next_fix = AP_GPS::GPS_OK_FIX_3D_DGPS; + }else if( _buffer.solution.fix_type == AP_GPS_UBLOX::FIX_3D) { next_fix = AP_GPS::GPS_OK_FIX_3D; }else if (_buffer.solution.fix_type == AP_GPS_UBLOX::FIX_2D) { next_fix = AP_GPS::GPS_OK_FIX_2D; diff --git a/libraries/AP_GPS/AP_GPS_UBLOX.h b/libraries/AP_GPS/AP_GPS_UBLOX.h index 041f34bd81..2ce09f5119 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.h +++ b/libraries/AP_GPS/AP_GPS_UBLOX.h @@ -276,7 +276,8 @@ private: FIX_TIME = 5 }; enum ubx_nav_status_bits { - NAV_STATUS_FIX_VALID = 1 + NAV_STATUS_FIX_VALID = 1, + NAV_STATUS_DGPS_USED = 2 }; enum ubx_hardware_version { ANTARIS = 0,