# 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.

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
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
> 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:

--
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