From c2ea4e612137451e8bb38284c073efc9a9b6a2aa Mon Sep 17 00:00:00 2001 From: Baardrw <98158027+Baardrw@users.noreply.github.com> Date: Mon, 2 Mar 2026 20:27:29 +0100 Subject: [PATCH] fix(StickYaw): Fixes potential bug if unaided yaw becomes nan during execution in StickYaw.cpp (#25710) * Fixes potential bug if unaided yaw becomes nan during execution: if unaided yaw becomes nan during execution the yaw correction would jumpt to 0 causing a large jump in yaw the change removes this jump by holding the current yaw correction instead * Remove Python extra paths from settings.json Removed Python extra paths from VS Code settings. --- src/lib/stick_yaw/StickYaw.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/stick_yaw/StickYaw.cpp b/src/lib/stick_yaw/StickYaw.cpp index 2978d8e37b..c45cdee823 100644 --- a/src/lib/stick_yaw/StickYaw.cpp +++ b/src/lib/stick_yaw/StickYaw.cpp @@ -73,7 +73,8 @@ void StickYaw::generateYawSetpoint(float &yawspeed_setpoint, float &yaw_setpoint bool StickYaw::updateYawCorrection(const float yaw, const float unaided_yaw, const float deltatime) { if (!PX4_ISFINITE(unaided_yaw)) { - _yaw_correction = 0.f; + // If unaided yaw is not available we leave yaw_correction_ unchanged + // Meaning yaw_setpoint - yaw_correction_prev + _yaw_correction = yaw_setpoint return false; }