forked from Archive/PX4-Autopilot
Merge pull request #997 from PX4/mc_mix_safe_limit
mc mixer: additional safe limiting of mixed out
This commit is contained in:
commit
dc3b496655
|
@ -351,9 +351,9 @@ MultirotorMixer::mix(float *outputs, unsigned space)
|
||||||
scale_out = 1.0f;
|
scale_out = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* scale outputs to range _idle_speed..1 */
|
/* scale outputs to range _idle_speed..1, and do final limiting */
|
||||||
for (unsigned i = 0; i < _rotor_count; i++) {
|
for (unsigned i = 0; i < _rotor_count; i++) {
|
||||||
outputs[i] = _idle_speed + (outputs[i] * (1.0f - _idle_speed) * scale_out);
|
outputs[i] = constrain(_idle_speed + (outputs[i] * (1.0f - _idle_speed) * scale_out), _idle_speed, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _rotor_count;
|
return _rotor_count;
|
||||||
|
|
Loading…
Reference in New Issue