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:
Beat Küng
2021-12-20 17:27:21 +01:00
committed by Daniel Agar
parent 460a0df850
commit 5259877b1b
9 changed files with 89 additions and 30 deletions
@@ -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]);
}
}