In a robot or spacecraft attitude representation, using quaternion is relevant. The kinematic equation is as below

$$ \begin{bmatrix} \dot{q}_0 \\ \dot{q} \end{bmatrix} = \frac{1}{2} \begin{bmatrix} -q^\top \\ q_0\,I_3 + q^\times \end{bmatrix} \omega. $$

In this equation quaternions derivative are calculated based on angular velocity $\omega$. I want to calculate $\omega$ based on quaternions derivatives. So I should inverse the matrix multiplied to $\omega$ in above equation. Is there any straight forward way to inverse it analytically?


1 Answer 1


In order to make the notation shorter for the remaining calculations in my answer I will denote the matrix with

$$ H = \frac{1}{2} \begin{bmatrix} -q^\top \\ q_0\,I_3 + q^\times \end{bmatrix}. $$

In this case you have four equations but only three unknowns. So there might not be a solution that exactly matches all equations, especially when the time derivative of the quaternion is perturbed, i.e. by numerical rounding errors. However, there is an elegant least squares solution that minimizes $\|\dot{\textbf{q}} - H\,\omega\|$. Here I use $\textbf{q}$ to denote the entire quaternion $\begin{bmatrix}q_0 & q^\top\end{bmatrix}^\top$. This least squares solution can shown to be

$$ \omega = \left(H^\top H\right)^{-1} H^\top \dot{\textbf{q}}. $$

It can be noted that if the quaternion is of unit length then the matrix, whose inverse is taken, simplifies to

$$ \left(H^\top H\right)^{-1} = 4\,I_3. $$

Thus the solution for the angular velocity in a reduced form can also be written as

$$ \omega = 4\,H^\top \dot{\textbf{q}} = 2 \begin{bmatrix} -q & q_0\,I_3 \!-\! q^\times \end{bmatrix} \begin{bmatrix} \dot{q}_0 \\ \dot{q} \end{bmatrix}. $$

  • $\begingroup$ thank you @fibonatic $\endgroup$
    – King
    May 2, 2021 at 8:53
  • $\begingroup$ can you give me a few textbook or manuscript references for more details? $\endgroup$
    – King
    May 9, 2021 at 3:10
  • $\begingroup$ @King After a quick search I think this one is one of the better ones. If you would like more information you could look yourself using a search similar to "least squares using linear algebra". $\endgroup$
    – fibonatic
    May 9, 2021 at 9:51
  • $\begingroup$ I meant the reference for (H⊤H)^(−1)=4I part. $\endgroup$
    – King
    May 14, 2021 at 8:18
  • $\begingroup$ @King that follows from $\|\textbf{q}\|=1$. I am not aware of a specific reference for this result. $\endgroup$
    – fibonatic
    May 14, 2021 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.