A new package for Julia to handle rotations of coordinate frames

610 views
Skip to first unread message

Ronan Chagas

unread,
Jul 16, 2014, 4:00:03 PM7/16/14
to juli...@googlegroups.com
Hi guys,

I want to let you know that I have just started to code a new package for Julia.
It is called Rotations.jl (https://github.com/ronisbr/Rotations.jl).

My idea is to add all functions related to rotations of coordinate frames, which is very useful for aerospace applications, robotics, etc.
By now, I have only implemented two functions:

angle2dcm: Convert Euler Angles to Direct Cosine Matrix;
dcm2angle: Convert Direct Cosine Matrix to Euler Angles.

I expect to expand this project to contain a lot of functions related to DCM, Quaternions, Rodriguez parameters, etc.
I have been using MATLAB for a long time and now I'm planning to start a project here at my Institution to test Julia.
This project will need a lot of rotations of coordinate frames and, since I have not found any available package for Julia yet, then I started to code one :)
I would appreciate any comments or suggestions to improve this package.

By the way, how can I make this a registered package of Julia?

Best regards,
Ronan

Tim Holy

unread,
Jul 16, 2014, 4:52:56 PM7/16/14
to juli...@googlegroups.com
Nice! For rotations in 3d, there's already a Quaternions package
(https://github.com/forio/Quaternions.jl) that implements some related
transformations. Since "Rotations" and "Quaternions" have overlapping-yet-
distinct functionality, I confess to being a bit unsure how this functionality
should be parceled out.

Just to add to the confusion, I also have some code (currently just one file,
AffineTransforms.jl) that I've not yet gotten around to putting up. It includes
an implementation of Itzhack Y. Bar-Itzhack, "New Method for Extracting the
Quaternion from a Rotation Matrix", Journal of Guidance, Control, and
Dynamics, Vol. 23, No. 6 (2000), pp. 1085-1087. This algorithm lets you take
any 3D sorta-close-to-an-orthogonal-rotation-matrix as an input and robustly
calculate the corresponding angle/axis or unit-quaternion representation.

--Tim

Patrick O'Leary

unread,
Jul 16, 2014, 6:03:36 PM7/16/14
to juli...@googlegroups.com
On Wednesday, July 16, 2014 3:52:56 PM UTC-5, Tim wrote:
Just to add to the confusion, I also have some code (currently just one file,
AffineTransforms.jl) that I've not yet gotten around to putting up. It includes
an implementation of Itzhack Y. Bar-Itzhack, "New Method for Extracting the
Quaternion from a Rotation Matrix", Journal of Guidance, Control, and
Dynamics, Vol. 23, No. 6 (2000), pp. 1085-1087. This algorithm lets you take
any 3D sorta-close-to-an-orthogonal-rotation-matrix as an input and robustly
calculate the corresponding angle/axis or unit-quaternion representation.

I'm interested in that algorithm--we've been using the SVD to fix sorta-close-to-an-orthogonal-rotation-matrices following Markley, "Attitude Determination using Vector Observations and the Singular Value Decomposition", Journal of the Astronautical Sciences, Vol. 36, No. 3, 1988, pp. 245-258. If nothing else, your way sounds newer. But it might be faster and/or more accurate for situations where a quaternion is the final destination rather than a DCM.

Ronan Chagas

unread,
Jul 17, 2014, 8:28:25 AM7/17/14
to juli...@googlegroups.com
Hi Tim,

Good! I know this algorithm developed by Prof. Bar-Itzhack. In fact, everything on my Ph.D. related to aerospace systems was based on theories proposed by him :)

My next step in Rotations.jl is to add the following conversions:

    _ DCM => Euler axis / Euler angle
    _ Euler axis / Euler angle => DCM

This is exactly what you have done in AffineTransforms.jl. Would you like to contribute to Rotations.jl package? :)

About Quaternions, I took a look at the implementation and it seems to be very good!
I think I will use this class and add the code to convert DCM => Quaternions (since Quaternions => DCM is already coded).
The problem with that approach is that the user will need to install both Rotations.jl and Quaternions.jl.

Best regards,
Ronan

Tim Holy

unread,
Jul 17, 2014, 11:50:21 AM7/17/14
to juli...@googlegroups.com
Hi Ronan,

On Thursday, July 17, 2014 05:28:25 AM Ronan Chagas wrote:
> This is exactly what you have done in AffineTransforms.jl. Would you like
> to contribute to Rotations.jl package? :)

That would be fine, but FYI there are a lot of other goodies in
AffineTransforms.jl. I just put it up here:

https://github.com/timholy/AffineTransforms.jl

Perhaps give it a glance and we can decide on a way forward with regards to
making one of these an official package.

--Tim

Ronan Chagas

unread,
Jul 17, 2014, 4:04:19 PM7/17/14
to juli...@googlegroups.com
Great!

Thanks Tim, I will look and then we can discuss!

Best regards,
Ronan
Reply all
Reply to author
Forward
0 new messages