From e4b8d8a9b640495ca6db4898c9e47fea9c968034 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Thu, 1 Dec 2022 19:10:40 +0000 Subject: [PATCH] AP_NavEKF3: ensure wind estimation from airspeed can be used on its own --- libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp b/libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp index b7e6866123..eaec4df54e 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp +++ b/libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp @@ -179,12 +179,14 @@ void NavEKF3_core::getVelNED(Vector3f &vel) const // returns false if estimate is unavailable bool NavEKF3_core::getAirSpdVec(Vector3f &vel) const { - if (inhibitWindStates || PV_AidingMode == AID_NONE) { + if (PV_AidingMode == AID_NONE) { return false; } vel = (outputDataNew.velocity + velOffsetNED).tofloat(); - vel.x -= stateStruct.wind_vel.x; - vel.y -= stateStruct.wind_vel.y; + if (!inhibitWindStates) { + vel.x -= stateStruct.wind_vel.x; + vel.y -= stateStruct.wind_vel.y; + } Matrix3f Tnb; // rotation from nav to body frame outputDataNew.quat.inverse().rotation_matrix(Tnb); vel = Tnb * vel;