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
+4 -2
View File
@@ -79,11 +79,13 @@ PWMSim::Run()
_mixing_output.updateSubscriptions(true);
}
void
bool
PWMSim::updateOutputs(bool stop_motors, uint16_t outputs[MAX_ACTUATORS], unsigned num_outputs,
unsigned num_control_groups_updated)
{
// nothing to do, as we are only interested in the actuator_outputs topic publication
// Nothing to do, as we are only interested in the actuator_outputs topic publication.
// That should only be published once we receive actuator_controls (important for lock-step to work correctly)
return num_control_groups_updated > 0;
}
int
+1 -1
View File
@@ -66,7 +66,7 @@ public:
int ioctl(device::file_t *filp, int cmd, unsigned long arg) override;
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;
private: