From 51a7fbeee091c20eb52bafade3e2041e26a785cc Mon Sep 17 00:00:00 2001 From: tumbili Date: Mon, 15 Dec 2014 22:12:11 +0100 Subject: [PATCH] added sanity checkto prevent false low airspeed readings during transition --- src/modules/vtol_att_control/vtol_att_control_main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/vtol_att_control/vtol_att_control_main.cpp b/src/modules/vtol_att_control/vtol_att_control_main.cpp index 126ec5832e..e3a2dd72e4 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.cpp +++ b/src/modules/vtol_att_control/vtol_att_control_main.cpp @@ -557,6 +557,11 @@ VtolAttitudeControl::scale_mc_output() { airspeed = math::max(0.5f, _airspeed.true_airspeed_m_s); } + // Sanity check if airspeed is consistent with throttle + if(_manual_control_sp.z >= 0.35f && airspeed < _params.mc_airspeed_trim) { // XXX magic number, should be hover throttle param + airspeed = _params.mc_airspeed_trim; + } + /* * For scaling our actuators using anything less than the min (close to stall) * speed doesn't make any sense - its the strongest reasonable deflection we