From 6354ca7096af853b3e6d42fcb96adfdde5647395 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 1 Jun 2017 18:02:59 -0400 Subject: [PATCH] AP_AHRS: Set the new gps_fusion notify flag Uses EKF filter state to set the new gps_fusion notify flag. This allows the GCS and notify devices to specifically be notified if the GPS is or is not usable. --- libraries/AP_AHRS/AP_AHRS_NavEKF.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp index 0a6d3ff76e..89070c3aed 100644 --- a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp +++ b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp @@ -192,6 +192,9 @@ void AP_AHRS_NavEKF::update_EKF2(void) } } _accel_ef_ekf_blended = _accel_ef_ekf[primary_imu>=0?primary_imu:_ins.get_primary_accel()]; + nav_filter_status filt_state; + EKF2.getFilterStatus(-1,filt_state); + AP_Notify::flags.gps_fusion = filt_state.flags.using_gps; // Drives AP_Notify flag for usable GPS. } } } @@ -260,6 +263,9 @@ void AP_AHRS_NavEKF::update_EKF3(void) } } _accel_ef_ekf_blended = _accel_ef_ekf[_ins.get_primary_accel()]; + nav_filter_status filt_state; + EKF3.getFilterStatus(-1,filt_state); + AP_Notify::flags.gps_fusion = filt_state.flags.using_gps; // Drives AP_Notify flag for usable GPS. } } }