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.
This commit is contained in:
Matt 2017-06-01 18:02:59 -04:00 committed by Randy Mackay
parent 545e417348
commit 6354ca7096
1 changed files with 6 additions and 0 deletions

View File

@ -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()]; _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()]; _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.
} }
} }
} }