CSCE 689: Forward Kinematics and Inverse Kinematics Jinxiang Chai
Outline Kinematics Forward kinematics Inverse kinematics
Kinematics The study of movement without the consideration of the masses or forces that bring about the motion
Degrees of freedom (Dofs) The set of independent displacements that specify an object’s pose
Degrees of freedom (Dofs) The set of independent displacements that specify an object’s pose How many degrees of freedom when flying?
Degrees of freedom (Dofs) The set of independent displacements that specify an object’s pose How many degrees of freedom when flying? So the kinematics of this airplane permit movement anywhere in three dimensions Six x, y, and z positions roll, pitch, and yaw
Degrees of Freedom How about this robot arm? Six again 2-base, 1-shoulder, 1-elbow, 2-wrist
Work Space vs. Configuration Space The space in which the object exists Dimensionality R3 for most things, R2 for planar arms Configuration space The space that defines the possible object configurations Degrees of Freedom The number of parameters that are necessary and sufficient to define position in configuration
Forward vs. Inverse Kinematics Forward Kinematics Compute configuration (pose) given individual DOF values Inverse Kinematics Compute individual DOF values that result in specified end effector position
Example: Two-link Structure Two links connected by rotational joints θ2 l2 l1 θ1 X=(x,y) End Effector Base
Example: Two-link Structure Animator specifies the joint angles: θ1θ2 Computer finds the position of end-effector: x θ2 l2 l1 θ1 X=(x,y) End Effector Base (0,0) x=f(θ1, θ2)
Example: Two-link Structure Animator specifies the joint angles: θ1θ2 Computer finds the position of end-effector: x θ2 θ2 l2 l1 θ1 X=(x,y) End Effector Base (0,0) x = (l1cosθ1+l2cos(θ2+ θ2) y = l1sinθ1+l2sin(θ2+ θ2))
Forward kinematics Create an animation by specifying the joint angle trajectories θ2 θ2 l2 l1 θ1 X=(x,y) End Effector Base (0,0) θ1 θ2
Inverse kinematics What if an animator specifies position of end-effector? θ2 θ2 l2 l1 End Effector θ1 X=(x,y) Base (0,0)
Inverse kinematics Animator specifies the position of end-effector: x Computer finds joint angles: θ1θ2 θ2 θ2 l2 l1 End Effector θ1 X=(x,y) Base (0,0) (θ1, θ2)=f-1(x)
Inverse kinematics Animator specifies the position of end-effector: x Computer finds joint angles: θ1θ2 θ2 θ2 l2 l1 End Effector θ1 X=(x,y) Base (0,0)
Why Inverse Kinematics? Basic tools in character animation - key frame generation - animation control - interactive manipulation Computer vision (vision based mocap) Robotics Bioninfomatics (Protein Inverse Kinematics)
Inverse kinematics Given end effector position, compute required joint angles In simple case, analytic solution exists Use trig, geometry, and algebra to solve
Inverse kinematics Analytical solution only works for a fairly simple structure Iterative approach needed for a complex structure
Iterative approach Inverse kinematics can be formulated as an optimization problem
Iterative approaches Find the joint angles θ that minimizes the distance between the character position and user specified position θ2 θ2 l2 l1 θ1 C=(Cx,Cy) Base (0,0)
Iterative approaches Find the joint angles θ that minimizes the distance between the character position and user specified position θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0)
Iterative approach Mathematically, we can formulate this as an optimization problem: The above problem can be solved by many nonlinear optimization algorithms: - Steepest descent - Gauss-newton - Levenberg-marquardt, etc
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles:
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles: How can we decide the amount of update?
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles:
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles: Known!
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles: Taylor series expansion
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles: Taylor series expansion rearrange
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles: Taylor series expansion rearrange Can you solve this optimization problem?
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles: Taylor series expansion rearrange This is a quadratic function of
Gauss-newton approach Optimizing an quadratic function is easy It has an optimal value when the gradient is zero
Gauss-newton approach Optimizing an quadratic function is easy It has an optimal value when the gradient is zero J b Δθ Linear equation!
Gauss-newton approach Optimizing an quadratic function is easy It has an optimal value when the gradient is zero J b Δθ
Gauss-newton approach Optimizing an quadratic function is easy It has an optimal value when the gradient is zero J b Δθ
Jacobian matrix Dofs (N) Jacobian is a M by N matrix that relates differential changes of θ to changes of C Jacobian maps the velocity in joint space to velocities in Cartesian space Jacobian depends on current state The number of constraints (M)
Jacobian matrix Jacobian maps the velocity in joint angle space to velocities in Cartesian space (x,y) θ2 θ1
Jacobian matrix Jacobian maps the velocity in joint angle space to velocities in Cartesian space (x,y) A small change of θ1 and θ2 results in how much change of end-effector position (x,y) θ2 θ1
Jacobian matrix Jacobian maps the velocity in joint angle space to velocities in Cartesian space (x,y) A small change of θ1 and θ2 results in how much change of end-effector position (x,y) θ2 θ1
Jacobian matrix: 2D-link structure θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0)
Jacobian matrix: 2D-link structure θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0) f2 f1
Jacobian matrix: 2D-link structure θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0)
Jacobian matrix: 2D-link structure θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0)
Jacobian matrix: 2D-link structure θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0)
Jacobian matrix: 2D-link structure θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0)
Jacobian matrix: 2D-link structure θ2 θ2 l2 l1 θ1 C=(c1,c2) Base (0,0)
Gauss-newton approach Step 1: initialize the joint angles with Step 2: update the joint angles: Step size: specified by the user
Another Example A 2D lamp with 6 degrees of freedom lower arm middle arm Upper arm base How to compute forward kinematics?
Another Example A 2D lamp with 6 degrees of freedom lower arm middle arm Upper arm base
Another Example A 2D lamp with 6 degrees of freedom base
Another Example A 2D lamp with 6 degrees of freedom Upper arm base
Another Example A 2D lamp with 6 degrees of freedom middle arm Upper arm base
Another Example A 2D lamp with 6 degrees of freedom lower arm middle arm Upper arm base
More Complex Characters? A 2D lamp with 6 degrees of freedom lower arm middle arm Upper arm base
More Complex Characters? A 2D lamp with 6 degrees of freedom lower arm middle arm Upper arm If you do inverse kinematics with position of this point What’s the size of Jacobian matrix? base
More Complex Characters? A 2D lamp with 6 degrees of freedom lower arm middle arm Upper arm If you do inverse kinematics with position of this point What’s the size of Jacobian matrix? 2-by-6 matrix base
Human Characters 57
Inverse kinematics Analytical solution only works for a fairly simple structure Iterative approach needed for a complex structure
Inverse kinematics Is the solution unique? Is there always a good solution?
Ambiguity of IK Multiple solutions
Ambiguity of IK Infinite solutions
Failures of IK Solution may not exist
Inverse kinematics Generally ill-posed problem when the Dofs is higher than the number of constraints
Inverse kinematics Generally ill-posed problem when the Dofs is higher than the number of constraints Additional objective Minimal Change from a reference pose θ0
Inverse kinematics Generally ill-posed problem when the Dofs is higher than the number of constraints Additional objective Minimal Change from a reference pose θ0
Minimize the difference between the solution and a reference pose Inverse kinematics Generally ill-posed problem when the Dofs is higher than the number of constraints Additional objective Minimal Change from a reference pose θ0 Minimize the difference between the solution and a reference pose Satisfy the constraints
Inverse kinematics Generally ill-posed problem when the Dofs is higher than the number of constraints Additional objective Minimal Change from a reference pose θ0 Naturalness g(θ) (particularly for human characters)
Inverse kinematics Generally ill-posed problem when the Dofs is higher than the number of constraints Additional objective Minimal Change from a reference pose θ0 Naturalness g(θ) (particularly for human characters)
How natural is the solution pose? Inverse kinematics Generally ill-posed problem when the Dofs is higher than the number of constraints Additional objective Minimal Change from a reference pose θ0 Naturalness g(θ) (particularly for human characters) Satisfy the constraints How natural is the solution pose?
Interactive Human Character Posing video