-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Revert "Use QQuaternion instead of mavlink_quaternion_to_euler" #13692
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
Revert "Use QQuaternion instead of mavlink_quaternion_to_euler" #13692
Conversation
This reverts commit 21bb9df.
|
This shouldn't be reverted. The mavlink version has too many problems with NaNs. It should be fixed to be able to use QQuaternion correctly, whatever that is. I'll try to figure it out. I think I only tested pitch changes, so probably caught out by that. |
|
It's Euler-order convention problem:
Which also explains why my pitch only testing worked fine. Sigh... |
|
@gillamkid Can you try changing this and testing with your setup: Note the reversed order to x,y,z |
@DonLakeFlyer closer! But there are still issues If I ran the same test I did before after applying your suggested fix, the test case passes however, if I test a case where yaw is greater than 90, the test fails |
|
Argh! |
|
I tracked the NaNs for pitch coming from here: mavlink/mavlink#2389. We'll see... |
|
So for now, we can revert till I figure out what is going on. |
Issue
The recent change to use
QQuaternioninstead ofmavlink_quaternion_to_eulerintroduced an error; gimbal yaw is no longer correctly decoded.Proof of Issue
I don't understand the difference between
mavlink_quaternion_to_eulerandQQuaternion::toEulerAngles(), but I ran some tests which show that they cannot be interchanged the way they were. Here is the test that I ran.The output is the following
@DonLakeFlyer , you were the one who made the recent change to use
QQuaternion. I suspect it looked fine in your testing because you likely were testing cases where yaw was 0. If I run the same test as above, only chageorigYawDegto be 0, I get the following output: