AP_TECS: prevent numerical error with zero max throttle

This commit is contained in:
Andrew Tridgell 2019-03-04 17:37:13 +11:00
parent 587aa33617
commit d72ded4a9e

View File

@ -988,6 +988,9 @@ void AP_TECS::update_pitch_throttle(int32_t hgt_dem_cm,
}
_THRminf = aparm.throttle_min * 0.01f;
// min of 1% throttle range to prevent a numerical error
_THRmaxf = MAX(_THRmaxf, _THRminf+0.01);
// work out the maximum and minimum pitch
// if TECS_PITCH_{MAX,MIN} isn't set then use
// LIM_PITCH_{MAX,MIN}. Don't allow TECS_PITCH_{MAX,MIN} to be