Mathematics for Mathematics for Inverse Kinematics

30
Mathematics for Mathematics for Inverse Kinematics 15464: Technical Animation 15 464: Technical Animation Ming Yao

Transcript of Mathematics for Mathematics for Inverse Kinematics

Page 1: Mathematics for Mathematics for Inverse Kinematics

Mathematics forMathematics for Inverse Kinematics

15‐464: Technical Animation15 464: Technical Animation

Ming Yao

Page 2: Mathematics for Mathematics for Inverse Kinematics

OverviewOverview

• Kinematics

• Forward Kinematics and Inverse KinematicsForward Kinematics and Inverse Kinematics

• Jabobian

• Pseudoinverse of the Jacobian

• Assignment 2Assignment 2

Page 3: Mathematics for Mathematics for Inverse Kinematics

Vocabulary of KinematicsVocabulary of Kinematics

• Kinematics is the study of how things move, it describes the motion of a hierarchical skeleton structure.

• Base and End Effector• Base and End Effector.

Base

End Effector

Kinematic Chain

Page 4: Mathematics for Mathematics for Inverse Kinematics

FK vs IKFK vs. IK

Forward Kinematics

I Ki tiInverse Kinematics

Page 5: Mathematics for Mathematics for Inverse Kinematics

Forward KinematicsForward Kinematics

• The process of computing world space geometric description based on joint DOF g p jvalues.

θ2θ

L1

L3P1 e

θ1

θ3

L2(0,0)

P2

Page 6: Mathematics for Mathematics for Inverse Kinematics

Forward KinematicsForward Kinematics

• We have joint DOF values:

• We want the end effector description in world space (N=3 in our case):p ( )

• FK gives us:

Page 7: Mathematics for Mathematics for Inverse Kinematics

But Sometimes We Want the OppositeBut Sometimes We Want the Opposite

k h h f h• We want to know how the upper joints of the hierarchy would rotate if we want the end effector to reach some goaleffector to reach some goal.

• Animations • RoboticsAnimations Robotics

Images are from google and youtube

Page 8: Mathematics for Mathematics for Inverse Kinematics

Inverse KinematicsInverse Kinematics

• The goal of inverse kinematics is to compute the vector of joint DOFs that will cause the jend effector to reach some desired goal state

θ2θ

θ1

θ3

Page 9: Mathematics for Mathematics for Inverse Kinematics

Inverse KinematicsInverse Kinematics

• We have:

• And we want:

• We need:

Page 10: Mathematics for Mathematics for Inverse Kinematics

Inverse Kinematics IssuesInverse Kinematics Issues

• While FK is relatively easy to evaluate.

• IK is more challenging: several possibleIK is more challenging: several possible solutions, or sometimes maybe no solutions.

R i C l d E i i• Require Complex and Expensive computations to find a solution.

Page 11: Mathematics for Mathematics for Inverse Kinematics

IK SolutionsIK Solutions

• Jacobian

• Cyclic Coordinate Descent (CCD)Cyclic Coordinate Descent (CCD)

• Required to implement in Assignment 2

Page 12: Mathematics for Mathematics for Inverse Kinematics

The JacobianThe Jacobian

• What is Jacobian? A linear approximation to f()

Actual

Linear Approximation

Page 13: Mathematics for Mathematics for Inverse Kinematics

The JacobianThe Jacobian

• Matrix of partial derivatives of entire system.

• Defines how the end effector e changesDefines how the end effector e changes relative to instantaneous changes in the systemsystem.

Page 14: Mathematics for Mathematics for Inverse Kinematics

The JacobianThe Jacobian

Page 15: Mathematics for Mathematics for Inverse Kinematics

The JacobianThe Jacobian

• Recall that

Page 16: Mathematics for Mathematics for Inverse Kinematics

ProblemsProblems

• How to compute J?

Numerically (Required)Numerically (Required)

Analytically (Extra Credit)

H t i t J?• How to invert J?

Pseudoinverse of Jacobian (Required)

Cheat by using transpose (Too easy, we don’t do that)

Page 17: Mathematics for Mathematics for Inverse Kinematics

Computing the Jacobian NumericallyComputing the Jacobian Numerically

• Let’s examine one column of the JacobianMatirx

W dd ll ∆θ θ• We can add a small ∆θ to θi

• Then we can calculate how the end effectormoves: ∆e = e’ – e

N h• Now we have:

Page 18: Mathematics for Mathematics for Inverse Kinematics

Computing the Jacobian NumericallyComputing the Jacobian Numerically

• We can use this method to fill the JacobianWe can use this method to fill the JacobianMatirx!

Page 19: Mathematics for Mathematics for Inverse Kinematics

Computing the Jacobian AnalyticallyComputing the Jacobian Analytically

i l j i h li h i h• For a rotational joint, the linear change in the end effector is the cross product of the axis of revolution and a vector from the joint to the end effector.

• Important to make sure all the coordinate l i th di t tvalues are in the same coordinate system. 

(Hard to get right.)

Page 20: Mathematics for Mathematics for Inverse Kinematics

Computing the Jacobian Analytically —A 2D example

gg

L

θ

θ2

θ3

P1 eL1

L3

θ1P2L2

Page 21: Mathematics for Mathematics for Inverse Kinematics

Inverting the JacobianInverting the Jacobian

• No guarantee it is invertible– Typically not a square matrix.yp y q

– Singularities.

Even it’s invertible as the pose vector changes– Even it s invertible, as the pose vector changes, the properties of the matrix will change.

Page 22: Mathematics for Mathematics for Inverse Kinematics

Inverting the Jacobian—Pseudo Inverse

• We can try using the pseudo inverse to find a matrix that effectively inverts a non‐square y qmatrix:

Page 23: Mathematics for Mathematics for Inverse Kinematics

Inverting the Jacobian—Pseudo Inverse

Page 24: Mathematics for Mathematics for Inverse Kinematics

Inverting the Jacobian—Jacobian Transpose

• Another technique is just to use the transpose of the Jacobian matrix.

• The Jacobian is already an approximation to f() Cheat moref()—Cheat more

• It is much faster.

• But if you prefers quality over performance, the pseudo inverse method would be betterthe pseudo inverse method would be better.

Page 25: Mathematics for Mathematics for Inverse Kinematics

Solving IK Incremental ChangesSolving IK—Incremental Changes

• FK is nonlinear

• Implies that the Jacobian can only be used asImplies that the Jacobian can only be used as an approximation that is valid near the current configurationconfiguration

• So we must Repeat the process of computing a Jacobian and then taking a small step towards the goal until we get close enoughtowards the goal until we get close enough 

Page 26: Mathematics for Mathematics for Inverse Kinematics

Solving IK—Algorithm of the Jacobian Method

Page 27: Mathematics for Mathematics for Inverse Kinematics

Cyclic Coordinate Descent (CCD)Cyclic Coordinate Descent (CCD)

• Much easier than the Jacobian Method

• Read two articles “Oh My God, I inverted Kine!”Read two articles  Oh My God, I inverted Kine!  and “Making Kine More Flexible”

Will b lk d b i• Will be talked about next time

Page 28: Mathematics for Mathematics for Inverse Kinematics

Assignment 2Assignment 2

• Will be out later today.

• Require to implement the Jacobian MethodRequire to implement the Jacobian Method and CCD.

L d ASF fil i M d dd IK h• Load ASF file into Maya and add IK to the skeleton.

• Start early! More challenging than Assignment 11.

Page 29: Mathematics for Mathematics for Inverse Kinematics

Assignment 1 is Due TonightAssignment 1 is Due Tonight

• Handin videos and presentation materials

• Presentation on Thursday!Presentation on Thursday!

Page 30: Mathematics for Mathematics for Inverse Kinematics

Questions?Questions?

• Thank you and See you Thursday!