2
\$\begingroup\$

I have a semi-regularly (15fps to 60fps) sampled source of position and orientation to which I am using dead reckoning to fill in gaps.

However, I would like to smooth it further to eliminate any steps due to dead reckoning error.

The x,y,z can easily be smoothed with a small (3pts?, 5pts?) moving average filter. However, I am unsure of how to approach smoothing the orientation.

I have access to Axis angle representations and a decent Quaternion class that I could possibly build a moving average filter with. It has multiply (operator *) and power (operator ^) which in theory would allow me to effectively average a set of rotations.

Would filtering an axis angle representation work if I simply filtered the 'x','y','z' and 'a' channels and then normalized it?

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

Yes, in fact that's what quaternions are often used for - interpolating between two different orientations. Other methods of representing orientation suffer from issues like gimbal lock and wrap-around.

quaternion lerp vs euler

Left is quaternions, right is Euler angles

https://answers.unity.com/questions/717637/how-do-you-smoothly-transitionlerp-into-a-new-rota.html

For accuracy, you can use slerp. However, lerp is faster and in most cases is accurate enough.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .