AP_Motors: get_compensation_gain gets div-by-zero check
This commit is contained in:
parent
1b381b5675
commit
bae1722946
@ -368,6 +368,11 @@ void AP_Motors::update_throttle_low_comp()
|
||||
|
||||
float AP_Motors::get_compensation_gain() const
|
||||
{
|
||||
// avoid divide by zero
|
||||
if (_lift_max <= 0.0f) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float ret = 1.0f / _lift_max;
|
||||
|
||||
// air density ratio is increasing in density / decreasing in altitude
|
||||
|
Loading…
Reference in New Issue
Block a user