From e591f29594fa2700e7629f13ad6089dd70bce1a5 Mon Sep 17 00:00:00 2001 From: Balduin Date: Thu, 12 Dec 2024 15:41:41 +0100 Subject: [PATCH] mavlink_main: stream attitude as quaternion if HIL Previously with SIH, for some VTOL airframes (e.g. SIH Tailsitter Duo, 1102) the attitude display on the ground station was wrong due to the body frame in forward flight differing from the usual convention. This is accounted for when sending the attitude as quaternion [1] over mavlink, but not when sending it as euler angles [2]. Therefore, in SIH/HIL we always send it as a quaternion. 1: src/modules/mavlink/streams/ATTITUDE_QUATERNION.hpp 2: src/modules/mavlink/streams/ALTITUDE.hpp --- src/modules/mavlink/mavlink_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 1c63f8adeeee..843a378486a0 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -670,7 +670,8 @@ Mavlink::set_hil_enabled(bool hil_enabled) if (_param_sys_hitl.get() == 2) { // Simulation in Hardware enabled ? configure_stream("HIL_STATE_QUATERNION", 25.0f); // ground truth to display the SIH - + // stream attitude also as quaternion for correct display + configure_stream("ATTITUDE_QUATERNION", 20.0f); } else { configure_stream("HIL_STATE_QUATERNION", 0.0f); }