From 56ede3a888a7ac3fd50560a2ea17d8a126964c37 Mon Sep 17 00:00:00 2001 From: Kirill Date: Tue, 23 Jun 2026 14:22:31 +0700 Subject: [PATCH] fix(fw_att_control): use adapted tailsitter attitude for FW error - In tailsitter case, construct current quaternion from _R, which is aready rotated correctly a bit above - Downside: bloaty solution of converting to rotation matrix, adjusting that, and converting back to quaternion --- src/modules/fw_att_control/FixedwingAttitudeControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index c09178aca0c..778c3213e64 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -303,7 +303,7 @@ void FixedwingAttitudeControl::Run() const Quatf q_sp(_att_sp.q_d); if (q_sp.isAllFinite()) { - const Quatf q_current(att.q); + const Quatf q_current = _vehicle_status.is_vtol_tailsitter ? Quatf(_R) : Quatf(att.q); const Vector3f att_err = computeAttitudeError(q_current, q_sp); Vector3f body_rates_setpoint;