From 43389762471d275aef39315a326695477a528bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 27 Apr 2022 11:37:04 +0200 Subject: [PATCH] ActuatorEffectivenessRotors: add missing getEffectivenessMatrix Fixes MOTORS_6DOF --- .../ActuatorEffectivenessRotors.cpp | 11 +++++++++++ .../ActuatorEffectivenessRotors.hpp | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.cpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.cpp index 3833bf5459..ae7b65b2a3 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.cpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.cpp @@ -262,3 +262,14 @@ uint32_t ActuatorEffectivenessRotors::getUpwardsMotors() const return upwards_motors; } + +bool +ActuatorEffectivenessRotors::getEffectivenessMatrix(Configuration &configuration, + EffectivenessUpdateReason external_update) +{ + if (external_update == EffectivenessUpdateReason::NO_EXTERNAL_UPDATE) { + return false; + } + + return addActuators(configuration); +} diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp index 1572a1826d..b57822dae3 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessRotors.hpp @@ -81,6 +81,8 @@ public: bool tilt_support = false); virtual ~ActuatorEffectivenessRotors() = default; + bool getEffectivenessMatrix(Configuration &configuration, EffectivenessUpdateReason external_update) override; + void getDesiredAllocationMethod(AllocationMethod allocation_method_out[MAX_NUM_MATRICES]) const override { allocation_method_out[0] = AllocationMethod::SEQUENTIAL_DESATURATION; @@ -96,7 +98,7 @@ public: bool addActuators(Configuration &configuration); - const char *name() const override { return "Multirotor"; } + const char *name() const override { return "Rotors"; } /** * Sets the motor axis from tilt configurations and current tilt control.