From e346190e6386ed2a7e68a7d992d0ab170e0499a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 14 Jul 2022 17:41:54 +0200 Subject: [PATCH] helicopter: use tail motor & add CA_HELI_YAW_CP_S --- .../ActuatorEffectivenessHelicopter.cpp | 10 ++++++++-- .../ActuatorEffectivenessHelicopter.hpp | 2 ++ src/modules/control_allocator/module.yaml | 17 +++++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp index 41fc850954..bd2bff61c1 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp @@ -57,6 +57,8 @@ ActuatorEffectivenessHelicopter::ActuatorEffectivenessHelicopter(ModuleParams *p _param_handles.pitch_curve[i] = param_find(buffer); } + _param_handles.yaw_collective_pitch_scale = param_find("CA_HELI_YAW_CP_S"); + updateParams(); } @@ -84,6 +86,8 @@ void ActuatorEffectivenessHelicopter::updateParams() param_get(_param_handles.throttle_curve[i], &_geometry.throttle_curve[i]); param_get(_param_handles.pitch_curve[i], &_geometry.pitch_curve[i]); } + + param_get(_param_handles.yaw_collective_pitch_scale, &_geometry.yaw_collective_pitch_scale); } bool @@ -97,8 +101,8 @@ ActuatorEffectivenessHelicopter::getEffectivenessMatrix(Configuration &configura // As the allocation is non-linear, we use updateSetpoint() instead of the matrix configuration.addActuator(ActuatorType::MOTORS, Vector3f{}, Vector3f{}); - // Tail (yaw) servo - configuration.addActuator(ActuatorType::SERVOS, Vector3f{0.f, 0.f, 1.f}, Vector3f{}); + // Tail (yaw) motor + configuration.addActuator(ActuatorType::MOTORS, Vector3f{}, Vector3f{}); // N swash plate servos _first_swash_plate_servo_index = configuration.num_actuators_matrix[0]; @@ -134,6 +138,8 @@ void ActuatorEffectivenessHelicopter::updateSetpoint(const matrix::Vector