comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Averaging quaternions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Averaging quaternions [message #38777 is a reply to message #38643] Tue, 30 March 2004 02:53 Go to previous message
Arnold Neumaier is currently offline  Arnold Neumaier
Messages: 5
Registered: March 2004
Junior Member
Graham wrote:
> I have now made a few attempts at averaging my quaternions. For what
> it is worth, the quaternion data I have is from a star-tracker on
> board a satellite and each quaternion represents the inferred
> spacecraft attitude from an algebraic computation using the positions
> of 3-6 stars on a CCD.
>
>> 1. apply to all quaternions a rotation that moves one of them to 1
>> (for example one that is closest to the trivial average),
>> 2. orient all results to positive real part,
>> 3. average the results
>> 4. rotate back the result,
>> 5. normalize.
>
> It isn't clear why steps 1 and 4 are required as they can be combined
> with 2 using a dot product? I'm not entirely sure of that but the
> following seems to work ok:

Yes, that works indeed: it suffices to reorient the quaternions
that have negative inner product with one of them.
This is a nice observation that simplifies the above and makes
it faster.


> Does anyone have a suggestions on how do I can weight the different
> quaternions to get a weighted average rotation?

In the above, simply weight your quaternions before adding them.
Thus the final algorithm is:

1. orient all quaternions to positive inner product with the first one
2. sum the results, weighted by their importance
3. normalize to unit norm
4. If some of the inner products in step 1 were in [-0.5,0.5], it is
possible that some orientation went wrong. In this case, one should
repeat the cycle with the result of step 3 in place of 'the first one',
and skip in this second round in step 2 all quaternions with an
inner product in [-0.5,0.5] as too scattered.

If you also want to get an assessment of the accuracy of the final
result, more care is needed. (Projection to the tangent plane etc.)


> A previous post on averaging rotation matrices suggested:
>
>> I'd suggest transformation of the rotation matrices into
>> quaternions. The quaternion coefficients can be regarded as forming a
>> unit vector in 4-space. Your observations should give a cluster of
>> such vectors. The centroid of this cluster should give the mean
>> rotation.

> I quite like this description, but I have no idea how to find the
> centroid of a cluster of vectors in 4-space.

This is essentially the same as above, except that the reorientation
is missing (which is essential, however).


Arnold Neumaier
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: catching netcdf error codes
Next Topic: changing button text for dialog_message

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:59:11 PDT 2025

Total time taken to generate the page: 0.00469 seconds