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:
Beat Küng
2019-10-21 09:42:08 +02:00
parent 380247168d
commit a8f6622831
6 changed files with 36 additions and 20 deletions
+5 -3
View File
@@ -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