Maths - RE: Conversion Quaternion to Euler

From: Jack Morrison <jack at helios.jpl.nasa.gov>
Subject: Typo and optimization for Quaternion-to-Euler conversion
Date: Tue, 7 Dec 2004 10:16:59 -0800 (PST)

Hi, Martin.

First a big "thank you" for your very helpful math pages.

Looking at
https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/

I believe there's a typo in the Java routines. The "south pole"
case should set attitude to -pi/2, not +pi/2.

While I'm at it...

Is "0.449" a good cutoff point for singularity? I would think
something closer to a pitch of maybe 85 degrees
(e.g. 0.499, which corresponds to 86.3 degrees).

Finally, in the interest of efficiency, the "sqw" term is
never used, and the "q1.x*q1.y + q1.z*q1.w" term can
be computed one time, then used for both singularity tests
and for the normal-case attitude calculation. The sqx,
sqy, and sqz terms could also be moved after the singularity
tests since they're only needed in the normal case.

Hope you don't mind direct email instead of using the
sourceforge forum.
--
Jack Morrison - jack at robotics.jpl.nasa.gov
Jet Propulsion Lab M/S 107-102, 4800 Oak Grove Dr, Pasadena CA 91109


To: jack at helios.jpl.nasa.gov
Subject: Re: Typo and optimization for Quaternion-to-Euler conversion
Date: Wed, 8 Dec 2004 09:06:35 +0000

Jack,

I agree with all your corrections and I have updated the web page as you
suggested.

> Hope you don't mind direct email instead of using the
> sourceforge forum.
I am very grateful to get corrections and feedback by any route. I usually
like to acknowledge peoples contribution by linking to their message, would
you mind if I put your message on the site? (I can remove your email address
if you prefer).

Also you you mind if I ask a question? I am trying to find if there are any
existing standards for euler angles, have you come across standards called
'NASA standard aeroplane' or 'NASA standard aerospace' ? I have seen these
mentioned in a book but I cant find any references online.

Thanks very much for the corrections.

Martin


From: Jack Morrison <jack at helios.jpl.nasa.gov>
Subject: Re: Typo and optimization for Quaternion-to-Euler conversion
Date: Wed, 8 Dec 2004 08:43:54 -0800 (PST)

Hi, Martin.

> > Hope you don't mind direct email instead of using the
> > sourceforge forum.
> I am very grateful to get corrections and feedback by any route. I usually
> like to acknowledge peoples contribution by linking to their message, would
> you mind if I put your message on the site? (I can remove your email address
> if you prefer).

Sure, that would be fine. Obscuring the email address a bit
(e.g. spelling out the "at") would be best.

> I am trying to find if there are any
> existing standards for euler angles, have you come across standards called
> 'NASA standard aeroplane' or 'NASA standard aerospace' ?

No. The closest thing I can find are these:

http://www.npsnet.org/~zyda/pubs/Presence.1.4.pdf
http://www.simlabs.arc.nasa.gov/library_docs/rt_sim_docs/Basis.pdf
http://www.simlabs.arc.nasa.gov/library_docs/rt_sim_docs/rt_sim_docs.html

--
Jack Morrison - jack at robotics.jpl.nasa.gov
Jet Propulsion Lab M/S 107-102, 4800 Oak Grove Dr, Pasadena CA 91109


Date: Thu, 09 Dec 2004 07:17:44 -0800
From: Jack Morrison <jack at helios.jpl.nasa.gov>
Subject: Re: Typo and optimization for Quaternion-to-Euler conversion

Hi, Martin.

> I agree with all your corrections and I have updated the web page as you
> suggested.

Looks good, although you can use another optimization
for the nominal case:

attitude = asin(2*test);

--
Jack Morrison jack at robotics.jpl.nasa.gov
Jet Propulsion Lab M/S 107-102, 4800 Oak Grove Dr, Pasadena CA 91109



To: Jack Morrison <jack at helios.jpl.nasa.gov>
Subject: Re: Typo and optimization for Quaternion-to-Euler conversion
Date: Thu, 9 Dec 2004 15:31:46 +0000

Jack,

Thanks again I've re-updated the page.

Also thanks for the document references you sent, they look interesting I will
have a closer look at them.

Martin


metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover If you are interested in 3D games, this looks like a good book to have on the shelf. If, like me, you want to have know the theory and how it is derived then there is a lot for you here. Including - Graphics pipeline, scenegraph, picking, collision detection, bezier curves, surfaces, key frame animation, level of detail, terrain, quadtrees & octtrees, special effects, numerical methods. Includes CDROM with code.

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.