mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-21 21:55:34 +08:00
control_allocator: restructure param update
recompute effectiveness on param change clear update at the end
This commit is contained in:
@@ -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(¶m_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(¶m_update);
|
||||
}
|
||||
|
||||
if (_control_allocation == nullptr || _actuator_effectiveness == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user