EKF: Fix bug in calculation of terrain estimator Kalman gain

This commit is contained in:
Paul Riseborough
2016-03-11 11:03:43 +11:00
parent cc5512905a
commit 1a2da887ab
+1 -1
View File
@@ -104,7 +104,7 @@ void Ekf::fuseHagl()
if (test_ratio <= 1.0f) {
// calculate the Kalman gain
float gain = obs_variance / _hagl_innov_var;
float gain = _terrain_var / _hagl_innov_var;
// correct the state
_terrain_vpos -= gain * _hagl_innov;
// correct the variance