Skip to content

Commit

Permalink
mavlink_main: stream attitude as quaternion if HIL
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mbjd committed Dec 19, 2024
1 parent bdc6957 commit e591f29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/mavlink/mavlink_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e591f29

Please sign in to comment.