From 673b309c45e7a766c9475b2216022f066fb9a94f Mon Sep 17 00:00:00 2001 From: kamilritz Date: Sat, 27 Jun 2020 11:52:07 +0200 Subject: [PATCH] Fix bug: pos gain used instead of vel gain --- EKF/ekf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/ekf.cpp b/EKF/ekf.cpp index 4e8527c675..1ae582e6b0 100644 --- a/EKF/ekf.cpp +++ b/EKF/ekf.cpp @@ -454,7 +454,7 @@ void Ekf::calculateOutputStates() // calculate a velocity correction that will be applied to the output state history // using a PD feedback tuned to a 5% overshoot - const float vert_vel_correction = vert_vel_integ_err * pos_gain + vert_vel_err * pos_gain * 1.1f; + const float vert_vel_correction = vert_vel_integ_err * pos_gain + vert_vel_err * vel_gain * 1.1f; /* * Calculate corrections to be applied to vel and pos output state history.