Forward kinematics is simple, because a set of joint angles specifies exactly one position. Inverse kinematics, however, is difficult: most real systems are underconstrained, so for a given goal position, there could be infinite solutions (i.e. many different joint configurations could lead to the same endpoint). The field of robotics has developed many inverse kinematics systems which, due to their constraints, have closed-form solutions. The inverse kinematics problem for computer animation is much harder because it must work for arbitrary figures, like human arms or legs.
dX= J(Theta)dTheta | (1) |
where the Jacobian matrix J is the defined as follows:
J= [dX/dTheta1 dX/dTheta2 ... dX/dThetaN] | (2) |
The column vectors dX/dthetai are the partial derivatives of the end point with respect to the ith joint angle Thetai.
Thus, we can rewrite (1) as
dTheta= J-1dX | (3) |
This is only valid when J is nonsingular. With articulated figures, however, J is quite often irregularly shaped, and has no inverse. A Moore-Penrose pseudoinverse is a good approximation, and will work for matrices of any shape. The pseudoinverse of a matrix M is the unique matrix denoted M+ that has the following properties [1,2]:
dTheta= J+dX | (4) |
Choose dX to be a small vector in the direction from the end point to the goal, calculate the pseudoinverse of the Jacobian, and then calculate the change in Theta. Increase Theta by dTheta and repeat the process. This technique will eventually converge on the goal point.
The Jacobian method, with the nice property of convergance, is not necessarily optimal. Other methods exist which minimize energy spent (mainly used in robotics), as well as methods which minimize the length of the path travelled. For purposes of this project, the Jacobian works nicely because of the interactive nature. The user drags the mouse in the direction of the desired path, and the Jacobian method will follow it.
Korein and Badler [3] present an optimized approach to inverse kinematics. The technique is hierarchical. Instead of calculating the change in all the angles at once, the base segment is moved so that the goal point is in the "reach space" of the rest of the segments. Then, the base segment is fixed, and the next segment is moved so that the goal point is in the reach space of the rest of the segments. The process is repeated until the final segment moves to the goal point. Korein and Badler also present a technique for turning and under-constrained system into a system of N equations in N unknowns by introducing new constraints using a Lagrangian operator.