mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
mixer_module: more robust logic to set 'stop_motors' flag
Checking the first output_limited for a disarmed value is fragile. For example a disarmed value might be within the range of min/max output values and could then be triggered while armed.
This commit is contained in:
parent
177da1f923
commit
72a8be538a
@ -285,18 +285,15 @@ bool MixingOutput::update()
|
||||
}
|
||||
}
|
||||
|
||||
bool stop_motors = mixed_num_outputs == 0 || !_throttle_armed;
|
||||
|
||||
/* overwrite outputs in case of lockdown or parachute triggering with disarmed values */
|
||||
if (_armed.lockdown || _armed.manual_lockdown) {
|
||||
for (size_t i = 0; i < mixed_num_outputs; i++) {
|
||||
output_limited[i] = _disarmed_value[i];
|
||||
}
|
||||
}
|
||||
|
||||
bool stop_motors = true;
|
||||
|
||||
if (mixed_num_outputs > 0) {
|
||||
/* assume if one (here the 1.) motor is disarmed, all of them should be stopped */
|
||||
stop_motors = (output_limited[0] == _disarmed_value[0]);
|
||||
stop_motors = true;
|
||||
}
|
||||
|
||||
/* apply _param_mot_ordering */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user