mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
mixer_module: check for motor test after topic update
Otherwise if a module restricts the update rate via setMaxTopicUpdateRate() and then motor_test is used, the module might run faster than expected.
This commit is contained in:
parent
a6d88cad18
commit
61e3ec53b0
@ -351,21 +351,6 @@ bool MixingOutput::update()
|
||||
}
|
||||
}
|
||||
|
||||
// check for motor test
|
||||
if (!_armed.armed && !_armed.manual_lockdown) {
|
||||
unsigned num_motor_test = motorTest();
|
||||
|
||||
if (num_motor_test > 0) {
|
||||
if (_interface.updateOutputs(false, _current_output_value, num_motor_test, 1)) {
|
||||
actuator_outputs_s actuator_outputs{};
|
||||
setAndPublishActuatorOutputs(num_motor_test, actuator_outputs);
|
||||
}
|
||||
|
||||
handleCommands();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_param_mot_slew_max.get() > FLT_EPSILON) {
|
||||
updateOutputSlewrateMultirotorMixer();
|
||||
}
|
||||
@ -396,6 +381,21 @@ bool MixingOutput::update()
|
||||
}
|
||||
}
|
||||
|
||||
// check for motor test (after topic updates)
|
||||
if (!_armed.armed && !_armed.manual_lockdown) {
|
||||
unsigned num_motor_test = motorTest();
|
||||
|
||||
if (num_motor_test > 0) {
|
||||
if (_interface.updateOutputs(false, _current_output_value, num_motor_test, 1)) {
|
||||
actuator_outputs_s actuator_outputs{};
|
||||
setAndPublishActuatorOutputs(num_motor_test, actuator_outputs);
|
||||
}
|
||||
|
||||
handleCommands();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* do mixing */
|
||||
float outputs[MAX_ACTUATORS] {};
|
||||
const unsigned mixed_num_outputs = _mixers->mix(outputs, _max_num_outputs);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user