From 7da40a45a4356d488c681784f6ed9985873d1de0 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Tue, 16 Feb 2016 10:04:37 +1100 Subject: [PATCH] EKF: Add control mode for wind state estimation --- EKF/common.h | 1 + EKF/control.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/EKF/common.h b/EKF/common.h index 2e9b9f77ef..9cf70fef8c 100644 --- a/EKF/common.h +++ b/EKF/common.h @@ -220,6 +220,7 @@ union filter_control_status_u { uint8_t mag_dec : 1; // 6 - true if synthetic magnetic declination measurements are being fused uint8_t in_air : 1; // 7 - true when the vehicle is airborne uint8_t armed : 1; // 8 - true when the vehicle motors are armed + uint8_t wind : 1; // 9 - true when wind velocity is being estimated } flags; uint16_t value; }; diff --git a/EKF/control.cpp b/EKF/control.cpp index bb33b11fcf..a5596fbd77 100644 --- a/EKF/control.cpp +++ b/EKF/control.cpp @@ -145,6 +145,12 @@ void Ekf::controlFusionModes() _control_status.flags.mag_dec = false; } + // Placeholder for control of wind velocity states estimation + // TODO add methods for true airspeed and/or sidelsip fusion or some type of drag force measurement + if (false) { + _control_status.flags.wind = false; + } + } void Ekf::calculateVehicleStatus()