Multicopter mixer - Recompute safe roll_pitch_scale if not in air-mode

If not in air-mode the mixer is not able to apply positive boosting
and roll_pitch_scale is recomputed to apply symmetric - reduced - thrust.
This has the consequence to cut completely the outputs when the thrust is
set to zero.
This commit is contained in:
bresch
2018-03-23 10:35:08 +01:00
committed by Roman Bapst
parent 56ea1a82aa
commit 7ef3ae8828
+7 -2
View File
@@ -217,7 +217,6 @@ MultirotorMixer::mix(float *outputs, unsigned space)
} else if (max_out > 1.0f) {
boost = -(max_out - 1.0f);
}
} else {
@@ -226,7 +225,13 @@ MultirotorMixer::mix(float *outputs, unsigned space)
}
if (!_airmode) {
boost = math::min(boost, 0.0f); // Disable positive boosting if not in air-mode
// disable positive boosting if not in air-mode
// boosting is positive when min_out < 0.0
// roll_pitch_scale is reduced accordingly
if (boost > 0.0f) {
roll_pitch_scale = thrust / (thrust - min_out);
boost = 0.0f;
}
}
// capture saturation