make constrain airspeed actually constrain the airspeed

This commit is contained in:
Thomas Gubler
2015-05-16 19:05:31 +02:00
parent 03ef6a30ec
commit 8a891591a8
+2 -2
View File
@@ -132,9 +132,9 @@ float ECL_Controller::constrain_airspeed(float airspeed, float minspeed, float m
float airspeed_result = airspeed; float airspeed_result = airspeed;
if (!isfinite(airspeed)) { if (!isfinite(airspeed)) {
/* airspeed is NaN, +- INF or not available, pick center of band */ /* airspeed is NaN, +- INF or not available, pick center of band */
airspeed = 0.5f * (minspeed + maxspeed); airspeed_result = 0.5f * (minspeed + maxspeed);
} else if (airspeed < minspeed) { } else if (airspeed < minspeed) {
airspeed = minspeed; airspeed_result = minspeed;
} }
return airspeed_result; return airspeed_result;
} }