EKF: reset position when stopping GPS use and EV is active

This commit is contained in:
Jan Brehmer
2019-09-18 08:33:40 +10:00
committed by Paul Riseborough
parent 267195a11b
commit 93eb1266f6
+4
View File
@@ -616,6 +616,10 @@ void Ekf::controlGpsFusion()
// Handle the case where we are using GPS and another source of aiding and GPS is failing checks
if (_control_status.flags.gps && gps_checks_failing && (_control_status.flags.opt_flow || _control_status.flags.ev_pos)) {
_control_status.flags.gps = false;
// Reset position state to external vision if we are going to use absolute values
if (_control_status.flags.ev_pos && !(_params.fusion_mode & MASK_ROTATE_EV)) {
resetPosition();
}
ECL_WARN("EKF GPS data quality poor - stopping use");
}