Having a reference rotation, which has non-smooth transitions I want to obtain a smooth quaternion trajectory, which eventually converges to the reference. The problem is, that the reference is switching directions sometimes and the actual orientation should only follow in a smooth manner. I also need to be able to calculate the angular velocity $\omega$ and it would be great to even have the angular accelaration available.
If the orientation wouldn't be given as quaternion, I would simply set up a second order state space filter and filter the reference orientation $q_r$. Thus "generating" the derivatives.
For quaternions we have these formulae to calculate the angular velocity and acceleration. Is it feasible to take the difference quaternion $\Delta q = q_r \cdot q^{-1}$ and use $\dot{\omega} = \frac{\Delta q}{T^2}$ as angular acceleration and integrate the resulting equation?
I found a lot of papers on quaternion interpolation and approximation, but nothing recursive.
Edit: It is a continuous measurement of rotations, which I can measure in regular intervals.However, sometimes the measurement is not unique and the orientation can flip by 90 degrees. Therefore, I want to "follow" these measurements, but slowly enough, that even on these jumps I get a smooth trajectory. Sample data could be any noisy sequence of orientations with 90 degree jumps (nonsmooth sections of 2nd order). Like a lowpass filter the solution I am looking for should reduce the noise and smooth out the sudden changes in orientation.