mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 15:40:36 +08:00
control_allocator: update matrix normalization
- only normalize rpy for MC matrices - for thrust use the 3D vector, so it works for FW and tilt rotors as well This keeps MC unchanged.
This commit is contained in:
@@ -157,6 +157,9 @@ ControlAllocator::update_allocation_method(bool force)
|
||||
AllocationMethod desired_methods[ActuatorEffectiveness::MAX_NUM_MATRICES];
|
||||
_actuator_effectiveness->getDesiredAllocationMethod(desired_methods);
|
||||
|
||||
bool normalize_rpy[ActuatorEffectiveness::MAX_NUM_MATRICES];
|
||||
_actuator_effectiveness->getNormalizeRPY(normalize_rpy);
|
||||
|
||||
for (int i = 0; i < _num_control_allocation; ++i) {
|
||||
AllocationMethod method = configured_method;
|
||||
|
||||
@@ -183,6 +186,7 @@ ControlAllocator::update_allocation_method(bool force)
|
||||
_num_control_allocation = 0;
|
||||
|
||||
} else {
|
||||
_control_allocation[i]->setNormalizeRPY(normalize_rpy[i]);
|
||||
_control_allocation[i]->setActuatorSetpoint(actuator_sp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user