Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
gps_alt: constrain var using 1.5 as a typical ratio of vacc/hacc
Browse files Browse the repository at this point in the history
  • Loading branch information
bresch authored and priseborough committed Dec 13, 2020
1 parent b0cf45e commit 9d22f14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EKF/ekf_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9d22f14

Please sign in to comment.