control_allocator: restructure param update

recompute effectiveness on param change
clear update at the end
This commit is contained in:
bresch
2021-08-06 17:08:02 +02:00
committed by Daniel Agar
parent 9d974062d0
commit cf5917d188
@@ -245,16 +245,18 @@ ControlAllocator::Run()
// Check if parameters have changed
if (_parameter_update_sub.updated()) {
// clear update
parameter_update_s param_update;
_parameter_update_sub.copy(&param_update);
updateParams();
parameters_updated();
if (_control_allocation) {
_control_allocation->updateParameters();
}
updateParams();
parameters_updated();
update_effectiveness_matrix_if_needed();
// clear update
parameter_update_s param_update;
_parameter_update_sub.copy(&param_update);
}
if (_control_allocation == nullptr || _actuator_effectiveness == nullptr) {