Skip to content
Snippets Groups Projects
Commit 7ef3ae88 authored by bresch's avatar bresch Committed by Roman Bapst
Browse files

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.
parent 56ea1a82
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment