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

Clarifying Euler angle axis order #1917

Merged
merged 2 commits into from
Nov 23, 2022
Merged

Conversation

arikrupnik
Copy link
Contributor

Following discussion with Peter Barker and AndrewTridgell, a small change to the description of the ATTITUDE message to clarify Euler rotation order is ZYX.

@olliw42
Copy link
Contributor

olliw42 commented Nov 15, 2022

this is, unfortunately, nonsense. The axes of the frame have nothing to do with the order of the Euler angles, and you can list the axes in whatever order you want, doesn't matter, the axes are unambigiously defined by the additional attributes. If one would follow wikipedia they would be actually Tait-Brain angles. And whether they are intrinsic or extrinisic (in the language of wikipedia)(or passive or active in some other language)(or...).
If I were to make a suggestion when "aeronautical" isn't considered sufficient I guess it would be "Euler angles in Z(yaw)Y(pitch)X(roll) convention (intrinsic rotations)".

@@ -5091,7 +5091,7 @@
<field type="int16_t" name="temperature_press_diff" units="cdegC" invalid="0">Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC.</field>
</message>
<message id="30" name="ATTITUDE">
<description>The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right).</description>
<description>The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX order).</description>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we're talking this frame right?

image

I don't see the current text as particular confusing if you know what the "aeronautical frame" is. You don't need to know that it is right handled, or that there is an order.

Euler angles in Z(yaw)Y(pitch)X(roll) convention (intrinsic rotations)

I think @olliw42 suggestion is technically correct, but it isn't as easy to understand as a reader - you have to unpack what is meant by intrinsic etc.

How about we just get rid of the "right hand rule" so the order is irrelevent, and add extra axis info to make it more intuitive what we mean by the aeronautical frame?

Suggested change
<description>The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX order).</description>
<description>The attitude in the aeronautical frame: Z-down (yaw axis), Y-right (pitch axis), X-front (roll-axis).</description>

@dakejahl @peterbarker Do you have an opinion?

Copy link
Contributor

Choose a reason for hiding this comment

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

the problem is that this does not specify the order of the rotations/angles, it just associates them to some axes

so it could be Rz(yaw)Ry(pitch)Rx(roll) or Rz(yaw)Rx(roll)Ry(pitch) or Rx(roll)Ry(pitch)Rz(yaw) or ...

so, both the assignment of anlges to axes AND the order of the sequence matter, but the assignment to the axes does NOT imply the order of the sequence of rotations! (and it also matters in which "direction" the transformation shall be applied). That's just the mathematical situation.

so, as sad as it is, your suggestion does nothing as regards clarifying the order of angles

One can try to be "clearer" in a sense some may think is clearer, but when someone else will come by and stumple across another inclarity because the mathematical details are not fully speficied.

one really would have hoped that specifing "aeronautical" should have been fully sufficient. Probably it could be better to just strip of all except "aeronautical" and have a link to an authorative reference.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@peterbarker I don't want to have this discussion - I don't understand (or care to understand) the implications of the change, or why the order of rotations matters.

Can you work with @olliw42 and @arikrupnik to come up with something mutally satisfying and accurate? If not then I will reject this PR as incorrect and not worth my time to resolve.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hamishwillee like you're saying, it's not important why the order of rotations matters, only that it does. Right now, the description lists axes in a different order than the order in which the rotation applies them. Anything that fixes that order is an improvement. Anything that includes "ZYX" or "3-2-1" would help. "Intrinsic" would be a welcome addition.

@olliw42 If you find a stable, freely available reference that is accessible to people who need an explanation for "aeronautical frame" and say "the angles have the same meaning as in this text," that would definitively solve the problem. I'm sure it's been a long time since you had to struggle with this, but have mercy on us who have not taken aerospace as undergrads. Everyone I know makes the same assumption coming in, first that the angles are independent, then when they realize the order matters, they assume it's roll-pitch-yaw, or XYZ. Everyone. And their math produces nonsense results, and they question everything from <math.h> to MAVLink documentation. Have mercy and let them narrow their search to <math.h>.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dakejahl @peterbarker Do you have an opinion?

I think this change is a good one. If we're going to list a set of axes - even if they're not in the same "units" as OlliW points out - they should be in the order in which they're applied. It would have saved one person some pain, and I can't see it causing anyone else pain.

FWIW, I hadn't heard of the term "aeronautical frame". We tend to use "Tait-Bryan" or "3-2-1" in ArduPilot.

I think "intrinsic" I think should address @olliw42 's concern?

I think this should go in.

Copy link
Contributor

@olliw42 olliw42 Nov 20, 2022

Choose a reason for hiding this comment

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

I think you don't yet fully comprehended the difference between angles and axis relation ship and sequence of angles.
frankly, "(right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)" is as cryptic as it possibly can get ... it's a mystery to me how this possibly can help anyone who doesn't already know what these cryptic symbols exactly mean.
anyway, it's just my one cent, if you feel it's an improvement, I'm happy to hear that. :)
EDIT: if you want to go with cryptic symbols, I think 3-2-1 would be much better than ZYX

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olliw42 one way this can help is by telling users what arguments to pass into third-party libraries. There are many libraries that work with Euler/Tait/Bryan angles. They need to caller to pass in rotation order and whether the rotations are intrinsic or extrinsic. If MAVLink documentation tells the user which of the 24 possible combinations are correct for the data in this message, that user can pass in the correct arguments into a math library even if the user doesn't understand the intricacies of the nomenclature.

@arikrupnik
Copy link
Contributor Author

I added "intrinsic" as a further clarification.

@arikrupnik
Copy link
Contributor Author

Also, is it the expected result for "Node 12" and "Node 14" tests to fail?

@hamishwillee
Copy link
Collaborator

Also, is it the expected result for "Node 12" and "Node 14" tests to fail?

Yes. I don't know why, but it has been happening ever since the node tests were added. I'll look into it at some point.

@hamishwillee
Copy link
Collaborator

If you find a stable, freely available reference that is accessible to people who need an explanation for "aeronautical frame" and say "the angles have the same meaning as in this text,"

I take it you were unable to find such a text @olliw42? This would be the best approach.

Are "Tait-Bryan" and/or "3-2-1" synonymous with "aeronautical frame"?

If so, then can we change this to "Tait-Bryan"? My reasoning is that if you search on "aeronautical frame" on google you get nothing - but if it is a valid synonym, "Tait-Bryan" does find you more information.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Nov 23, 2022

This was discussed this in the MAV call last night. It isn't perfect, but we're accepting on the basis that this is no worse (no more confusing) than the previous text, and may well help some people.

The best thing to do would be to replace this with a link to an authoratitive reference. We'll happily update to that when someone either finds one or writes one.

This is a compromise (i.e. no one will be completely happy, but hopefully no one thinks we've made the world a worse place).

@hamishwillee hamishwillee merged commit 48f3749 into mavlink:master Nov 23, 2022
@hamishwillee
Copy link
Collaborator

PS, thanks @arikrupnik and @olliw42 for engaging on this.

TSC21 pushed a commit to Dronecode/air-iop-definitions that referenced this pull request Feb 28, 2023
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.

None yet

4 participants