From c52b64a78a448ac62cf7e9860fa9399fd084596e 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 972a26e73d..456e66ce6e 100644 --- a/libraries/AP_AHRS/AP_AHRS.cpp +++ b/libraries/AP_AHRS/AP_AHRS.cpp @@ -790,7 +790,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