APM_Control: validate parameter ARSPD_FBW_MIN

This commit is contained in:
Mark Whitehorn 2020-04-02 11:44:02 -06:00 committed by Tom Pittenger
parent 9c8a5a7392
commit 442fa60651

View File

@ -278,7 +278,7 @@ float AP_PitchController::_get_coordination_rate_offset(float &aspeed, bool &inv
// don't do turn coordination handling when at very high pitch angles
rate_offset = 0;
} else {
rate_offset = cosf(_ahrs.pitch)*fabsf(ToDeg((GRAVITY_MSS / MAX((aspeed * _ahrs.get_EAS2TAS()) , float(aparm.airspeed_min))) * tanf(bank_angle) * sinf(bank_angle))) * _roll_ff;
rate_offset = cosf(_ahrs.pitch)*fabsf(ToDeg((GRAVITY_MSS / MAX((aspeed * _ahrs.get_EAS2TAS()) , MAX(aparm.airspeed_min, 1))) * tanf(bank_angle) * sinf(bank_angle))) * _roll_ff;
}
if (inverted) {
rate_offset = -rate_offset;