From 0ededd7c62f9b14bcf7709be56e73d9fb267e0d7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Jul 2022 11:45:47 +1000 Subject: [PATCH] AP_AHRS: use wind from simulation if available with EKF type 10 --- libraries/AP_AHRS/AP_AHRS.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_AHRS/AP_AHRS.cpp b/libraries/AP_AHRS/AP_AHRS.cpp index 38ed227259..2d7ba00c24 100644 --- a/libraries/AP_AHRS/AP_AHRS.cpp +++ b/libraries/AP_AHRS/AP_AHRS.cpp @@ -822,7 +822,10 @@ Vector3f AP_AHRS::wind_estimate(void) const #if AP_AHRS_SIM_ENABLED case EKFType::SIM: - wind.zero(); + if (_sitl) { + const auto &fdm = _sitl->state; + wind = fdm.wind_ef; + } break; #endif