From 937d27f8eef89efbd9c56ec1bb12371a3c2be4c0 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 1 Nov 2022 17:53:36 +0100 Subject: [PATCH] Helicopter: add offset for yaw compensation based on collective pitch --- .../ActuatorEffectivenessHelicopter.cpp | 4 +++- .../ActuatorEffectivenessHelicopter.hpp | 2 ++ src/modules/control_allocator/module.yaml | 19 ++++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp index f5a7aaedbb..9faae22ca4 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp @@ -61,6 +61,7 @@ ActuatorEffectivenessHelicopter::ActuatorEffectivenessHelicopter(ModuleParams *p } _param_handles.yaw_collective_pitch_scale = param_find("CA_HELI_YAW_CP_S"); + _param_handles.yaw_collective_pitch_offset = param_find("CA_HELI_YAW_CP_O"); _param_handles.yaw_throttle_scale = param_find("CA_HELI_YAW_TH_S"); _param_handles.yaw_ccw = param_find("CA_HELI_YAW_CCW"); _param_handles.spoolup_time = param_find("COM_SPOOLUP_TIME"); @@ -95,6 +96,7 @@ void ActuatorEffectivenessHelicopter::updateParams() } param_get(_param_handles.yaw_collective_pitch_scale, &_geometry.yaw_collective_pitch_scale); + param_get(_param_handles.yaw_collective_pitch_offset, &_geometry.yaw_collective_pitch_offset); param_get(_param_handles.yaw_throttle_scale, &_geometry.yaw_throttle_scale); param_get(_param_handles.spoolup_time, &_geometry.spoolup_time); int32_t yaw_ccw = 0; @@ -142,7 +144,7 @@ void ActuatorEffectivenessHelicopter::updateSetpoint(const matrix::Vector