mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
make constrain airspeed actually constrain the airspeed
This commit is contained in:
parent
03ef6a30ec
commit
8a891591a8
@ -132,9 +132,9 @@ float ECL_Controller::constrain_airspeed(float airspeed, float minspeed, float m
|
||||
float airspeed_result = airspeed;
|
||||
if (!isfinite(airspeed)) {
|
||||
/* 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) {
|
||||
airspeed = minspeed;
|
||||
airspeed_result = minspeed;
|
||||
}
|
||||
return airspeed_result;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user