Plane: if airspeed enabled, require 5m/s to unsuppress throttle

This commit is contained in:
Andrew Tridgell 2013-04-25 20:01:59 +10:00
parent 300a8d2bbc
commit 4f225eff57
1 changed files with 8 additions and 3 deletions

View File

@ -470,10 +470,15 @@ static bool suppress_throttle(void)
if (g_gps != NULL && if (g_gps != NULL &&
g_gps->status() >= GPS::GPS_OK_FIX_2D && g_gps->status() >= GPS::GPS_OK_FIX_2D &&
g_gps->ground_speed >= 500) { g_gps->ground_speed >= 500) {
// if we have an airspeed sensor, then check it too, and
// require 5m/s. This prevents throttle up due to spiky GPS
// groundspeed with bad GPS reception
if (!airspeed.use() || airspeed.get_airspeed() >= 5) {
// we're moving at more than 5 m/s // we're moving at more than 5 m/s
throttle_suppressed = false; throttle_suppressed = false;
return false; return false;
} }
}
// throttle remains suppressed // throttle remains suppressed
return true; return true;