Search code examples
inverse-kinematicsskeletal-animation

Difference between the two pseudo inverses of Jacobian matrices for IK?


Hi I'm trying to implement IK to my skeleton system and was reading some articles online, and one of the ways to do so was using the pseudo inverse of the Jacobian matrix. However, I've seen 2 forms of the pseudo inverse, and I would like to know what the differences of these two representations are.

First form is J+ = ((Jt*J).inverse()) * Jt

Second form is J+ = Jt * ((J*Jt).inverse())

To be honest, I'm not even sure how they got the second form, I can only derive the first form at the moment.

Any help would be appreciated!


Solution

  • Usually, the inverse of a matrix has the property that multiplying it with the original matrix on either side produces the identity matrix.

    A * A^-1 = A^-1 * A = I
    

    However, this is not true for the pseudo inverse anymore. For the pseudo inverse, order matters (alone from the fact that the matrix might not be square). Your first form is for left-multiplication, your second form is for right multiplication:

    J+ * J = I  <=  J+ = (J^T * J)^-1 * J^T
    J * J+ = I  <=  J+ = J^T * (J * A^T)^-1
    

    If you use the pseudo inverse to solve a linear system, the first form is used when you have column vectors (i.e. J x = b as J+ J x = I x = x = J+ b), and the second form is used when you have row vectors (i.e. x J = b).