mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 20:03:35 +08:00
OutputModuleInterface::updateOutputs return bool to control actuator_outputs pub
Required for pwm_out_sim: only publish actuator_outputs when we get actuator_controls. Otherwise lockstep startup does not work. The issue was there before but hidden, due to a long poll timeout. Works with HIL too.
This commit is contained in:
@@ -146,7 +146,7 @@ public:
|
||||
hrt_abstime edge_time, uint32_t edge_state,
|
||||
uint32_t overflow);
|
||||
|
||||
void updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS],
|
||||
bool updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS],
|
||||
unsigned num_outputs, unsigned num_control_groups_updated) override;
|
||||
|
||||
void mixerChanged() override;
|
||||
@@ -686,11 +686,11 @@ void DShotOutput::mixerChanged()
|
||||
updateTelemetryNumMotors();
|
||||
}
|
||||
|
||||
void DShotOutput::updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS],
|
||||
bool DShotOutput::updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS],
|
||||
unsigned num_outputs, unsigned num_control_groups_updated)
|
||||
{
|
||||
if (!_outputs_on) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
int requested_telemetry_index = -1;
|
||||
@@ -740,6 +740,8 @@ void DShotOutput::updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS
|
||||
if (stop_motors || num_control_groups_updated > 0) {
|
||||
up_dshot_trigger();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user