From 9d22f140dd6f5efc2b873a7827588f1fa8d67074 Mon Sep 17 00:00:00 2001 From: bresch Date: Thu, 10 Dec 2020 12:34:31 +0100 Subject: [PATCH] gps_alt: constrain var using 1.5 as a typical ratio of vacc/hacc --- EKF/ekf_helper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/EKF/ekf_helper.cpp b/EKF/ekf_helper.cpp index 4234cb1d52..685ebfa28b 100644 --- a/EKF/ekf_helper.cpp +++ b/EKF/ekf_helper.cpp @@ -1247,8 +1247,9 @@ void Ekf::updateBaroHgtOffset() float Ekf::getGpsHeightVariance() { // observation variance - receiver defined and parameter limited - const float lower_limit = fmaxf(_params.gps_pos_noise, 0.01f); - const float upper_limit = fmaxf(_params.pos_noaid_noise, lower_limit); + // use 1.5 as a typical ratio of vacc/hacc + const float lower_limit = fmaxf(1.5f * _params.gps_pos_noise, 0.01f); + const float upper_limit = fmaxf(1.5f * _params.pos_noaid_noise, lower_limit); const float gps_alt_var = sq(math::constrain(_gps_sample_delayed.vacc, lower_limit, upper_limit)); return gps_alt_var; }