diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp index 0ddd4988f3..3dfea4f75f 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.hpp @@ -153,7 +153,7 @@ public: /** * Query if the roll, pitch and yaw columns of the mixing matrix should be normalized */ - virtual void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const + virtual void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const { for (int i = 0; i < MAX_NUM_MATRICES; ++i) { normalize[i] = false; diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMCTilt.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMCTilt.hpp index 848c8b8853..d886f05945 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMCTilt.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMCTilt.hpp @@ -50,7 +50,7 @@ public: allocation_method_out[0] = AllocationMethod::SEQUENTIAL_DESATURATION; } - void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const override + void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const override { normalize[0] = true; } diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMultirotor.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMultirotor.hpp index e0a355edd2..dcaa1c2f22 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMultirotor.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessMultirotor.hpp @@ -49,7 +49,7 @@ public: allocation_method_out[0] = AllocationMethod::SEQUENTIAL_DESATURATION; } - void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const override + void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const override { normalize[0] = true; } diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp index 3844df4c84..052f7d44bb 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp @@ -90,7 +90,7 @@ public: allocation_method_out[0] = AllocationMethod::SEQUENTIAL_DESATURATION; } - void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const override + void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const override { normalize[0] = true; } diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.hpp index 0e5d1bfa44..988f102474 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.hpp @@ -67,7 +67,7 @@ public: allocation_method_out[1] = AllocationMethod::PSEUDO_INVERSE; } - void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const override + void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const override { normalize[0] = true; normalize[1] = false; diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTailsitterVTOL.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTailsitterVTOL.hpp index 604f05f9e0..bb25c931ba 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTailsitterVTOL.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTailsitterVTOL.hpp @@ -64,7 +64,7 @@ public: allocation_method_out[1] = AllocationMethod::PSEUDO_INVERSE; } - void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const override + void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const override { normalize[0] = true; normalize[1] = false; diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.hpp index 310d937064..e70e373bc2 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.hpp @@ -70,7 +70,7 @@ public: allocation_method_out[1] = AllocationMethod::PSEUDO_INVERSE; } - void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const override + void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const override { normalize[0] = true; normalize[1] = false; diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessUUV.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessUUV.hpp index 57e86f9436..41165ce16c 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessUUV.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessUUV.hpp @@ -49,7 +49,7 @@ public: allocation_method_out[0] = AllocationMethod::SEQUENTIAL_DESATURATION; } - void getNormalizeRPY(bool normalize[MAX_NUM_MATRICES]) const override + void getNormalizeAsPlanarMC(bool normalize[MAX_NUM_MATRICES]) const override { normalize[0] = true; } diff --git a/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp b/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp index c60784a03c..123f34b9de 100644 --- a/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp +++ b/src/modules/control_allocator/ControlAllocation/ControlAllocation.hpp @@ -226,7 +226,7 @@ public: int numConfiguredActuators() const { return _num_actuators; } - void setNormalizeRPY(bool normalize_rpy) { _normalize_rpy = normalize_rpy; } + void setNormalizeAsPlanarMC(bool normalize_as_mc) { _normalize_matrix_as_planar_mc = normalize_as_mc; } protected: friend class ControlAllocator; // for _actuator_sp @@ -242,6 +242,6 @@ protected: matrix::Vector _control_sp; ///< Control setpoint matrix::Vector _control_trim; ///< Control at trim actuator values int _num_actuators{0}; - bool _normalize_rpy{false}; ///< if true, normalize roll, pitch and yaw columns + bool _normalize_matrix_as_planar_mc{false}; ///< if true, normalize roll, pitch and yaw columns optimized for planar MC bool _had_actuator_failure{false}; }; diff --git a/src/modules/control_allocator/ControlAllocation/ControlAllocationPseudoInverse.cpp b/src/modules/control_allocator/ControlAllocation/ControlAllocationPseudoInverse.cpp index ee1d2dceb2..6f51b42471 100644 --- a/src/modules/control_allocator/ControlAllocation/ControlAllocationPseudoInverse.cpp +++ b/src/modules/control_allocator/ControlAllocation/ControlAllocationPseudoInverse.cpp @@ -73,7 +73,7 @@ void ControlAllocationPseudoInverse::updateControlAllocationMatrixScale() { // Same scale on roll and pitch - if (_normalize_rpy) { + if (_normalize_matrix_as_planar_mc) { int num_non_zero_roll_torque = 0; int num_non_zero_pitch_torque = 0; diff --git a/src/modules/control_allocator/ControlAllocator.cpp b/src/modules/control_allocator/ControlAllocator.cpp index 3399bd6190..9c63cf2da9 100644 --- a/src/modules/control_allocator/ControlAllocator.cpp +++ b/src/modules/control_allocator/ControlAllocator.cpp @@ -168,8 +168,8 @@ 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); + bool normalize_as_planar_mc[ActuatorEffectiveness::MAX_NUM_MATRICES]; + _actuator_effectiveness->getNormalizeAsPlanarMC(normalize_as_planar_mc); for (int i = 0; i < _num_control_allocation; ++i) { AllocationMethod method = configured_method; @@ -197,7 +197,7 @@ ControlAllocator::update_allocation_method(bool force) _num_control_allocation = 0; } else { - _control_allocation[i]->setNormalizeRPY(normalize_rpy[i]); + _control_allocation[i]->setNormalizeAsPlanarMC(normalize_as_planar_mc[i]); _control_allocation[i]->setActuatorSetpoint(actuator_sp[i]); } }