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

Add euler_angles_ordered function on Rotation #1235

Merged
merged 2 commits into from
Jul 8, 2023

Conversation

Masterzach32
Copy link
Contributor

At the moment, Rotation only has a way to get Euler angles in the order roll, pitch, yaw. This PR adds a euler_angles_ordered function to Rotation which allows the user to specify any order of Euler axes. It also allows the user to specify if the returned angles should be for an intrinsic or extrinsic rotation.

The implementation is based upon this paper:
Malcolm D. Shuster, F. Landis Markley, “General formula for extraction the Euler angles”, Journal of guidance, control, and dynamics, vol. 29.1, pp. 215-221. 2006

This is a function I wrote in one of my own projects, and thought it would be a good addition to the library.

Copy link
Member

@sebcrozet sebcrozet left a comment

Choose a reason for hiding this comment

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

That’s very interesting! Thank you for this contribution.

src/geometry/rotation_specialization.rs Outdated Show resolved Hide resolved
Comment on lines 985 to 991
/// Returns the angles produced in the order provided by seq parameter, along with the
/// observability flag. If the rotation is gimbal locked, then the observability flag is false.
///
/// Algorithm based on:
/// Malcolm D. Shuster, F. Landis Markley, “General formula for extraction the Euler
/// angles”, Journal of guidance, control, and dynamics, vol. 29.1, pp. 215-221. 2006,
/// and modified to be able to produce extrinsic rotations.
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a couple of examples (as doc-tests) here? Perhaps the ones presented in the papier.
In addition, does seq have to match some properties (being an orthonormal basis)? If so, that should be mentioned in the documentation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the axes must be orthonormal (satisfying n1 dot n2 = 0 and n3 dot n1 = 0). I added asserts for that as well

@sebcrozet sebcrozet merged commit bea7f9d into dimforge:dev Jul 8, 2023
@sebcrozet
Copy link
Member

Thanks!

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

2 participants