From 8a2d2fb1cd66e85abb4ac038ee5fad1ab7748825 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Thu, 6 Apr 2023 20:13:03 +0200 Subject: [PATCH] HelicopterCoaxial: only publish unallocated thrust in the saturation case --- .../ActuatorEffectivenessHelicopterCoaxial.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopterCoaxial.cpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopterCoaxial.cpp index abb8351449..213df1e0ad 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopterCoaxial.cpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopterCoaxial.cpp @@ -185,6 +185,9 @@ void ActuatorEffectivenessHelicopterCoaxial::getUnallocatedControl(int matrix_in } else if (_saturation_flags.roll_neg) { status.unallocated_torque[0] = -1.f; + + } else { + status.unallocated_torque[0] = 0.f; } if (_saturation_flags.pitch_pos) { @@ -192,6 +195,9 @@ void ActuatorEffectivenessHelicopterCoaxial::getUnallocatedControl(int matrix_in } else if (_saturation_flags.pitch_neg) { status.unallocated_torque[1] = -1.f; + + } else { + status.unallocated_torque[1] = 0.f; } if (_saturation_flags.yaw_pos) { @@ -199,6 +205,9 @@ void ActuatorEffectivenessHelicopterCoaxial::getUnallocatedControl(int matrix_in } else if (_saturation_flags.yaw_neg) { status.unallocated_torque[2] = -1.f; + + } else { + status.unallocated_torque[2] = 0.f; } if (_saturation_flags.thrust_pos) { @@ -206,5 +215,8 @@ void ActuatorEffectivenessHelicopterCoaxial::getUnallocatedControl(int matrix_in } else if (_saturation_flags.thrust_neg) { status.unallocated_thrust[2] = -1.f; + + } else { + status.unallocated_torque[2] = 0.f; } }