Quaternion exponential map, rotations and interpolation

4.5k Views Asked by At

A code snippet I need to optimize is performing something peculiar. It seems that it's somehow related to transforming from a frame of reference to another. This is what it does, in mathematical terms:

$ \mathfrak{q}_{prevToCurrExpMap} = \exp ( \mathfrak{q}_{PrevToCurr} ) $

then

$ \mathfrak{q}_{prevToCurrExpMap} = \mathfrak{q}_{prevToCurrExpMap} + \mathfrak{q}_{rotationInduction}$

and finally

$ \mathfrak{q}_{prevToCurr} = \ln (\mathfrak{q}_{prevToCurrExpMap} ) $

Essentially, the orientation quaternion's exponential map is altered by a quaternion addition, and then the result is extracted by taking the logarithm. I am trying to understand the logic behind this piece of "code", but nothing comes to mind.

Is there any obvious reason for replacing a quat $\mathfrak{q}$ with $\ln(\exp(\mathfrak{q}) + \mathfrak{p})$? (at a first glance, it does not seem to encode any kind of interpolation, but it might be trickier than it appears.)