Code covered by the BSD License
30 Jan 2013
This function computes the average (mean) quaternion.
Watch this File
Since quaternions are not regular vectors, but rather representations of orientation, an average quaternion cannot just be obtained by taking a weighted mean. This function implements the work done by F. Landis Merkley to calculate the average quaternion. The algorithm is explained by F. Landis Markley at:
For this particular implementation, I would also like to reference Mandar Harshe:
While being basic and straightforward, this algorithm is compared with rotqrmean from VoiceBox and found to produce quite similar results, yet it is more elegant, much simpler to implement and follow. (Though, there might be difference in signs)
Note that on 2001 Claus Gramkow showed that the naive mean is in fact a fair approximation of rotations:
I think re-orthagonalization using SVD after a standard averaging would suffice most applications.