From de8625d2556fec4573e2d86b9bcb84e9a396e1e7 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Thu, 10 Jun 2021 17:52:08 +1000 Subject: [PATCH] EKF: fix sign error in bluff body drag fusion --- EKF/drag_fusion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/drag_fusion.cpp b/EKF/drag_fusion.cpp index 69614943cd..9f87cfafde 100644 --- a/EKF/drag_fusion.cpp +++ b/EKF/drag_fusion.cpp @@ -92,7 +92,7 @@ void Ekf::fuseDrag() const float mea_acc = _drag_sample_delayed.accelXY(axis_index) - _state.delta_vel_bias(axis_index) / _dt_ekf_avg; // predicted drag force sign is opposite to predicted wind relative velocity - const float drag_sign = (rel_wind_body(axis_index) >= 0.f) ? 1.f : -1.f; + const float drag_sign = (rel_wind_body(axis_index) >= 0.f) ? -1.f : 1.f; float pred_acc; // predicted drag acceleration if (axis_index == 0) {