mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:26:50 +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
|
// Check if parameters have changed
|
||||||
if (_parameter_update_sub.updated()) {
|
if (_parameter_update_sub.updated()) {
|
||||||
// clear update
|
updateParams();
|
||||||
parameter_update_s param_update;
|
parameters_updated();
|
||||||
_parameter_update_sub.copy(¶m_update);
|
|
||||||
|
|
||||||
if (_control_allocation) {
|
if (_control_allocation) {
|
||||||
_control_allocation->updateParameters();
|
_control_allocation->updateParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateParams();
|
update_effectiveness_matrix_if_needed();
|
||||||
parameters_updated();
|
|
||||||
|
// clear update
|
||||||
|
parameter_update_s param_update;
|
||||||
|
_parameter_update_sub.copy(¶m_update);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_control_allocation == nullptr || _actuator_effectiveness == nullptr) {
|
if (_control_allocation == nullptr || _actuator_effectiveness == nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user