Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mavlink_main: stream attitude as quaternion if HIL #24099

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mbjd
Copy link

@mbjd mbjd commented Dec 12, 2024

Solved Problem

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.

Solution

The rotation of the body frame is already accounted for (see this PR) when sending the attitude as quaternion [1] over mavlink, but not when sending it as euler angles [2]. Therefore, if in SIH/HIL we always send it as a quaternion as well.

1: src/modules/mavlink/streams/ATTITUDE_QUATERNION.hpp
2: src/modules/mavlink/streams/ALTITUDE.hpp

Alternatives

  • add similar logic as in [1] to [2] so display attitude is correct regardless of numerical representation
  • enable sending quaternions only for the relevant VTOL airframes

Test coverage

  • SIH test with SIH Tailsitter Duo (1102)

@KonradRudin KonradRudin requested a review from sfuhrer December 17, 2024 08:31
Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need to add it in the disable HIL section below.

And I wonder if it's then not still broken for real tailsitters and we thus need to find a more generic solution.

@KonradRudin
Copy link
Contributor

I think you also need to add it in the disable HIL section below.

The problem is that it might be already enabled, so you don't want to disable in every case. Also a change of the parameter requires a reboot, so the else case does not make much sense, no?

And I wonder if it's then not still broken for real tailsitters and we thus need to find a more generic solution.

Would need to test this then and report if it is still a problem.

@mbjd mbjd assigned mbjd and mcsauder and unassigned mbjd and mcsauder Dec 18, 2024
@mbjd mbjd force-pushed the hil_attitude_display branch 2 times, most recently from 9bf37dd to 6766463 Compare December 19, 2024 08:39
mbjd added 2 commits December 19, 2024 09:48
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
@mbjd mbjd force-pushed the hil_attitude_display branch from 6766463 to 5a5523e Compare December 19, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants