Average of 3D rotations

3.3k Views Asked by At

I am trying to compute the average of a rotational error (the error I have in estimating a 3D rotation with respect to the real value). I have my estimated quaternion $\mathbf{\hat{q}}_i$ and its true value $\mathbf{q^\star}_i$. Consider now that I have a sequence of this quantities $\mathbf{\hat{q}} = \left\{ \mathbf{\hat{q}}_1 \dots \mathbf{\hat{q}}_N\right\}$ and ${\mathbf{q^\star}} =\left\{ \mathbf{q^\star}_1 \dots \mathbf{q^\star}_N\right\} $. Now for each of the quaternion couples I define the error quaternion as $\mathbf{q}_{\epsilon,i} = \mathbf{\hat{q}}_i^{-1} \otimes \mathbf{q^\star}$. Now I want to compute the average quaternion error. At the moment I am converting the error quaternion to the corresponding rotation vector $\mathbf{v}_\epsilon$ and extract the rotation angle $\mathbf{\alpha}_\epsilon$, then I average the absolute values. However, I have the feeling that this is not the way to go. I had a look on wikipedia and I have found this https://en.wikipedia.org/wiki/Mean_of_circular_quantities, but I am not sure on how to apply it to my case.

Can you point me to some sound method to average 3D rotations?

Cheers

1

There are 1 best solutions below

1
On

The first thing that you need to realize is that the concept of an average does not directly apply here. This is for two reasons (1) rotations are not vectors and therefore they do not sum like you would expect for an average and (2) rotation composition is not commutative which means that when we do aggregate them, order matters. If the errors are small and are not biased (i.e. the sum would be small), then we can get an approximation by averaging the individual error terms ($\mathbf{q}_{\epsilon,i}$). If the errors are biased we need to do compose the errors into an aggregate rotation and then take the N'th root. Composition would look like this:

$$\mathbf{q}_{\epsilon}=\prod_{i\in\{1,..,N\}}\mathbf{q}_{\epsilon,i}$$

Where the order of the product is chosen in some rational way (i.e. order matters). We would then take the root as $$\bar{\mathbf{q}}_{\epsilon} ={\mathbf{q}_{\epsilon}}^{\frac{1}{N}}$$

To compute the root, just convert to axis-angle, divide the angle by N and then convert back.