From d757ffa8530b631fa3a625bfe4d61be4e48155e1 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Sat, 22 Nov 2025 05:11:46 +0300 Subject: [PATCH] Move yaw dead zone handling from mavlink to control subsystem So yaw dead zone works the same for rc and mavlink. --- flix/control.ino | 2 ++ flix/mavlink.ino | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/flix/control.ino b/flix/control.ino index 4de742c..9e047d8 100644 --- a/flix/control.ino +++ b/flix/control.ino @@ -75,6 +75,8 @@ void interpretControls() { if (controlThrottle < 0.05 && controlYaw > 0.95) armed = true; // arm gesture if (controlThrottle < 0.05 && controlYaw < -0.95) armed = false; // disarm gesture + if (abs(controlYaw) < 0.1) controlYaw = 0; // yaw dead zone + thrustTarget = controlThrottle; if (mode == STAB) { diff --git a/flix/mavlink.ino b/flix/mavlink.ino index cf69de3..4436c92 100644 --- a/flix/mavlink.ino +++ b/flix/mavlink.ino @@ -11,7 +11,6 @@ #define SYSTEM_ID 1 #define MAVLINK_RATE_SLOW 1 #define MAVLINK_RATE_FAST 10 -#define MAVLINK_CONTROL_YAW_DEAD_ZONE 0.1f bool mavlinkConnected = false; String mavlinkPrintBuffer; @@ -105,8 +104,6 @@ void handleMavlink(const void *_msg) { controlYaw = m.r / 1000.0f; controlMode = NAN; controlTime = t; - - if (abs(controlYaw) < MAVLINK_CONTROL_YAW_DEAD_ZONE) controlYaw = 0; } if (msg.msgid == MAVLINK_MSG_ID_PARAM_REQUEST_LIST) {