control_allocator: change SequentialDesaturation to existing MC mixer

And limit the operations to the number of configured outputs.

Only using the number of configured actuators reduces CPU load by ~2% on
F7 @1khz.
This commit is contained in:
Beat Küng
2020-08-13 08:20:47 +02:00
committed by Daniel Agar
parent 308f614735
commit 0e66b0876b
12 changed files with 259 additions and 82 deletions
@@ -249,6 +249,10 @@ ControlAllocator::Run()
parameter_update_s param_update;
_parameter_update_sub.copy(&param_update);
if (_control_allocation) {
_control_allocation->updateParameters();
}
updateParams();
parameters_updated();
}
@@ -520,6 +524,7 @@ int ControlAllocator::print_status()
const matrix::Matrix<float, NUM_AXES, NUM_ACTUATORS> &effectiveness = _control_allocation->getEffectivenessMatrix();
PX4_INFO("Effectiveness.T =");
effectiveness.T().print();
PX4_INFO("Configured actuators: %i", _control_allocation->numConfiguredActuators());
}
// Print perf