Presentation is loading. Please wait.

Presentation is loading. Please wait.

My Adventure with Inverse Kinematics Chris Hecker definition six, inc.

Similar presentations


Presentation on theme: "My Adventure with Inverse Kinematics Chris Hecker definition six, inc."— Presentation transcript:

1 My Adventure with Inverse Kinematics Chris Hecker definition six, inc.

2 What is this lecture about? the path I took while solving a problem with inverse kinematics how I use math to model and [sometimes] solve problems decisions I made, both good and bad learn from my successes and failures work in progress!

3 What isnt this lecture about? not an IK tutorial or introduction not going to give you the One True Way to do IK has nothing to do with graphics not about my rock climbing game Experimental Gameplay Workshop Friday, 4pm - 7pm

4 Takeaway You will get insight into how IK on a whole human body is different from IK on a single arm. You will see how IK is a building block, but not a complete solution to character animation.

5 Prerequisites must be very comfortable with math –doesnt mean you know tons of math –does mean you follow quickly and arent afraid of it probably best if youve implemented a simple IK system –foot placement, arm grabbing door, etc.

6 Talk Structure (linear with occasional branches)... attempted solution problem statement and discussion related theory attempted solution problem statement and discussion related theory...

7 Problem: How to move a guy with the mouse? move like a [rock climbing] human interactive direct body/limb control did not want to use physics

8 Theory: How to move a guy with the mouse? inverse kinematics vs. forward kinematics –FK: p=f(q) –IK: q = f -1 (p) –p is Euclidean, angles –q is configuration space p p = (x, y) q = ( ) g

9 Theory: How to move a guy with the mouse? (cont.) degrees of freedom (DOF) incredibly important concept ways in which system can change configuration space find DOF of system to understand it control & constrain DOF to control it examples physical system, polynomial, etc. fundamental task of IK is to control degrees of freedom to attain goal p p = (x, y) q = ( )

10 Solution: How to move a guy with the mouse? analytical IK invert p = f(q) to get q from p relatively easy for the 2D arm –inverse trig, some vector algebra gets complicated as n increases

11 Problem: Analytical IK cant handle human. human has lots of DOF –even 2D arm with shoulder has more DOF than needed to reach goal solving p = f(q) requires certain characteristics p p = (x, y) q = ( ) g

12 Theory: Analytical IK cant handle human. p = f(q) is a set of nonlinear equations –generally no closed forms –must iterate numerically must be square, n DOF = n goal over-, under-constrained system –redundant manipulator –ex. human reaching for point and/or orientation vast literature on solving f(q) = p p p = (x, y) q = ( )

13 Solution: Analytical IK cant handle human. use Cyclic Coordinate Descent (CCD) to solve arms –iterative, recursive position-space algorithm –fast, easy, robust –start from last position not path independent, but faster –I draw every outside iteration looks like animation, but its not p p = (x, y) q = ( ) g

14 Problem: CCD only handles serial chains. multiple goals are necessary for human –stack up vectors in p=f(q) –coupled at branches p1p1 p = (x 1, y 1, x 2, y 2 ) q = ( ) p2p2 g1g1 g2g2

15 Theory: CCD only handles serial chains. coupling between goals either solvable alone, neither solvable together how to distribute desired-angle error? p1p1 p = (x 1, y 1, x 2, y 2 ) q = ( ) p2p2 g1g1 g2g2

16 Solution: CCD only handles serial chains. simply average desired angles at branch parents to attain multiple goals and distribute error – in example, imagine p 1, p 2 pulled in opposite directions p1p1 p = (x 1, y 1, x 2, y 2 ) q = ( ) p2p2

17 Problem: Drift on multiple goals. average cant satisfy all goals or even prioritize them I specifically want to drag climber hand with mouse and have other end effectors stay on holds

18 Theory: Drift on multiple goals. want a rigid constraint at end effectors closed loops are hard, CCD doesnt handle them, nor do common IK algorithms –must solve simultaneously –not hierarchical anymore –closed loops dont have local behavior

19 Solution: Drift on multiple goals. attempt to Gram-Schmidt off any movement that would result in error a bc

20 Problem: Gram-Schmidt removes the wrong direction sometimes. could have tried real Jacobian force mapping Gram-Schmidt

21 Problem: Human is not rooted tree. Which end effector (hand, foot) is the root? There is no persistent fixed root in a rock climber –or walking person CCD must start at a fixed root

22 Theory: Human is not rooted tree. switching root is basically a datastructure problem relative angles must change –joint limits (see below) behavior will change slightly as well, since CCD isnt symmetric with respect to the root

23 Solution: Human is not rooted tree. just type it in invert tree to new root Caml is pretty good at this sort of thing –see last years GDC talk dragging torso is done by inverting to a torso node, then changing the root position –the hands and feet are all end-effectors –hack!

24 Problem: Joint limits elbow cant bend backwards should lend believability and intuition

25 Theory: Joint limits inequality constraints: min –abandon all (most) hope of analytical solution –these inequalities are axis aligned planes in configuration space max min

26 Solution: Joint limits CCD makes parent-child limits easy do min/max clamp in CCD inner iteration easy, and rest of system compensates issue: CCD doesnt know about the joint limits –often compensates, but doesnt know to avoid them

27 Problem: Child-child limits parent-child not enough with moving root pelvis example: –left foot root –right foot root –chest root

28 Problem: Child-child limits parent-child not enough with moving root pelvis example: –left foot root –right foot root –chest root

29 Problem: Child-child limits parent-child not enough with moving root pelvis example: –left foot root –right foot root –chest root ?

30 Theory: Child-child limits both angles are dependent on each other, coupled –parent is fixed in CCD –constraints are now non-axis aligned planes in C-space simultaneous solution necessary at branches with child-child limits

31 Solution: Child-child limits Good solution should: –satisfy constraints always –have zero error in goals if possible –have least squares error if not possible Nonlinear Least Squares with Linear Inequalities: minimize ( 1 - d 1 ) 2 + ( 2 - d 2 ) 2 w.r.t. min max12 –lots of literature on NLSLI –I convert to LCP and use Lemkes algorithm –works great!

32 Accomplishments We extended CCD to handle: –multiple end effector goals –dynamically changing root node –arbitrary joint limits

33 Problems drift on multi-goals is still a problem CCD doesnt know about joint limits sometimes non-physical movement –CCD isnt doing physics, not conserving energy, or anything else for that matter rooted hierarchies are inconvenient how to control redundant DOF?

34 Body Knowledge System system to manage movement and keep it natural –situation & reaction –ex. joint limits handled in body knowledge huge rules system allocates redundant DOF –this is the key to natural movement!

35 Body Knowledge System (cont.) IK just a rough initial guess for body knowledge system; should be: –physically plausible no added energy, etc. –easy to layer conflicting goals –able to cope with over-constrained goals dont know enough about this yet, but I think it will be more important than IK for good dynamic animation

36 What I Didnt Talk About development process stuff –developing on lower dimensional subproblems –using visualizations to help debug math –Mathematica and Matlab for development and debugging –running multiple techniques on top of each other physics-based techniques I tried

37 What I Didnt Try I should have done a weighted average based on error for multi-goals, duh. –even weighted average wouldnt be rigid although could make weight very big... similar to a stiff system Wrong: CCD must have fixed root –now that I understand better, this isnt actualy true the roots position is just more DOF CCD probably wouldnt deal with this very well?

38 What I Didnt Try (cont.) pseudo-inverse methods give explicit control over redundant DOF data-based methods (model-based) functions as lookup tables totally ad-hoc methods

39 References two great theses: –Paolo Baerlocher –Chris Welman google & citeseer GDC talks –David Wu –Ken Perlin Jeff Landers articles & code Experimental Gameplay Workshop


Download ppt "My Adventure with Inverse Kinematics Chris Hecker definition six, inc."

Similar presentations


Ads by Google