My adventure with inverse kinematics
Download
1 / 39

My Adventure with Inverse Kinematics - PowerPoint PPT Presentation


  • 133 Views
  • Uploaded on

My Adventure with Inverse Kinematics. Chris Hecker definition six, inc. [email protected] 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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'My Adventure with Inverse Kinematics' - yamal


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
My adventure with inverse kinematics l.jpg

My Adventure with Inverse Kinematics

Chris Hecker

definition six, inc.

[email protected]


What is this lecture about l.jpg
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!


What isn t this lecture about l.jpg
What isn’t 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 WorkshopFriday, 4pm - 7pm


Takeaway l.jpg
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.


Prerequisites l.jpg
Prerequisites

  • must be very comfortable with math

    • doesn’t mean you know tons of math

    • does mean you follow quickly and aren’t afraid of it

  • probably best if you’ve implemented a simple IK system

    • foot placement, arm grabbing door, etc.


Talk structure linear with occasional branches l.jpg
Talk Structure(linear with occasional branches)

  • ...

  • attempted solution

  • problem statement and discussion

  • related theory

  • attempted solution

  • problem statement and discussion

  • related theory

  • ...


Problem how to move a guy with the mouse l.jpg
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


Theory how to move a guy with the mouse l.jpg

g

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 = (q1, q2)

q2

q1


Theory how to move a guy with the mouse cont l.jpg

p

q2

q1

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 = (x, y)

    q = (q1, q2)


    Solution how to move a guy with the mouse l.jpg
    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


    Problem analytical ik can t handle human l.jpg

    g

    Problem: Analytical IK can’t handle human.

    p

    • human has lots of DOF

      • even 2D arm with shoulderhas more DOF than neededto reach goal

    • solving p = f(q) requirescertain characteristics

    q3

    q2

    q1

    p = (x, y)

    q = (q1 , q2 , q3)


    Theory analytical ik can t handle human l.jpg
    Theory: Analytical IK can’t handle human.

    p

    • p = f(q) is a set of nonlinear equations

      • generally no closed forms

      • must iterate numerically

    • must be square, nDOF = ngoal

    • over-, under-constrained system

      • “redundant manipulator”

      • ex. human reaching for point and/or orientation

    • vast literature on solving f(q) = p

    q3

    q2

    q1

    p = (x, y)

    q = (q1 , q2 , q3)


    Solution analytical ik can t handle human l.jpg

    g

    Solution: Analytical IK can’t handle human.

    p

    • use Cyclic Coordinate Descent(CCD) to solve arms

      • iterative, recursive position-spacealgorithm

      • fast, easy, robust

      • start from last position

        • not path independent, but faster

      • I draw every outside iteration

        • looks like animation, but it’s not

    q3

    q2

    q1

    p = (x, y)

    q = (q1 , q2 , q3)


    Problem ccd only handles serial chains l.jpg

    g1

    g2

    Problem: CCD only handles serial chains.

    p2

    p1

    • multiple goals are necessaryfor human

      • stack up vectors inp=f(q)

      • coupled at branches

    q3

    q5

    q4

    q2

    q1

    p = (x1, y1, x2, y2)

    q = (q1 , q2 , q3 , q4 , q5)


    Theory ccd only handles serial chains l.jpg

    g1

    g2

    Theory: CCD only handles serial chains.

    p2

    p1

    • coupling between goals

    • either solvable alone,neither solvable together

    • how to distribute desired-angleerror?

    q3

    q5

    q4

    q2

    q1

    p = (x1, y1, x2, y2)

    q = (q1 , q2 , q3 , q4 , q5)


    Solution ccd only handles serial chains l.jpg
    Solution: CCD only handles serial chains.

    p2

    p1

    • simply average desired angles atbranch parents to attainmultiple goals and distributeerror

      • q1 in example, imagine p1, p2pulled in opposite directions

    q3

    q5

    q4

    q2

    q1

    p = (x1, y1, x2, y2)

    q = (q1 , q2 , q3 , q4 , q5)


    Problem drift on multiple goals l.jpg
    Problem: Drift on multiple goals.

    • average can’t satisfy all goals

    • or even prioritize them

    • I specifically want to drag climber hand with mouse and have other end effectors stay on holds

    q


    Theory drift on multiple goals l.jpg
    Theory: Drift on multiple goals.

    • want a rigid constraint at end effectors

    • closed loops are hard, CCD doesn’t handle them, nor do common IK algorithms

      • must solve simultaneously

      • not hierarchical anymore

      • closed loops don’t have local behavior

    q


    Solution drift on multiple goals l.jpg
    Solution: Drift on multiple goals.

    • attempt to “Gram-Schmidt” off any movement that would result in error

    b

    c

    a


    Problem gram schmidt removes the wrong direction sometimes l.jpg
    Problem: Gram-Schmidt removes the wrong direction sometimes.

    • could have tried real Jacobian force mapping Gram-Schmidt


    Problem human is not rooted tree l.jpg
    Problem: Human is not rooted tree.

    • Which end effector (hand, foot) is the root?

    • There is no persistent fixed rootin a rock climber

      • or walking person

    • CCD must start at a fixed root


    Theory human is not rooted tree l.jpg
    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 isn’t symmetric withrespect to the root


    Solution human is not rooted tree l.jpg
    Solution: Human is not rooted tree.

    • just type it in

    • invert tree to new root

    • Caml is pretty good at thissort of thing

      • see last year’s 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!


    Problem joint limits l.jpg
    Problem: Joint limits

    • elbow can’t bend backwards

    • should lend believability and intuition


    Theory joint limits l.jpg
    Theory: Joint limits

    • inequality constraints: q³qmin

      • abandon all (most) hope of analytical solution

      • these inequalities are axis aligned planes in configuration space

    qmax

    q

    qmin


    Solution joint limits l.jpg
    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 doesn’t “know” about the joint limits

      • often compensates, but doesn’t know to avoid them


    Problem child child limits l.jpg
    Problem: Child-child limits

    • parent-child not enough with moving root

    • pelvis example:

      • left foot root

      • right foot root

      • chest root


    Problem child child limits28 l.jpg
    Problem: Child-child limits

    • parent-child not enough with moving root

    • pelvis example:

      • left foot root

      • right foot root

      • chest root


    Problem child child limits29 l.jpg
    Problem: Child-child limits

    • parent-child not enough with moving root

    • pelvis example:

      • left foot root

      • right foot root

      • chest root

    ?


    Theory child child limits l.jpg
    Theory: Child-child limits

    • both angles are dependent on each other, coupled

      • parent is fixed in CCD

      • constraints are now non-axisaligned planes in C-space

    • simultaneous solution necessaryat branches with child-childlimits


    Solution child child limits l.jpg
    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 (q1 - d1)2 + (q2 - d2)2 w.r.t. qmin12£ q1 - q2 £qmax12

      • lots of literature on NLSLI

      • I convert to LCP and use Lemke’s algorithm

      • works great!


    Accomplishments l.jpg
    Accomplishments

    • We extended CCD to handle:

      • multiple end effector goals

      • dynamically changing root node

      • arbitrary joint limits


    Problems l.jpg
    Problems

    • drift on multi-goals is still a problem

    • CCD doesn’t know about joint limits

    • sometimes non-physical movement

      • CCD isn’t doing physics, not conserving energy, or anything else for that matter

    • rooted hierarchies are inconvenient

    • how to control redundant DOF?


    Body knowledge system l.jpg
    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!


    Body knowledge system cont l.jpg
    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

    • don’t know enough about this yet, but I think it will be more important than IK for good dynamic animation


    What i didn t talk about l.jpg
    What I Didn’t 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


    What i didn t try l.jpg
    What I Didn’t Try

    • I should have done a weighted average based on error for multi-goals, duh.

      • even weighted average wouldn’t 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 isn’t actualy true

        • the root’s position is just more DOF

        • CCD probably wouldn’t deal with this very well?


    What i didn t try cont l.jpg
    What I Didn’t Try (cont.)

    • pseudo-inverse methods

      • give explicit control over redundant DOF

  • data-based methods (model-based)

    • functions as lookup tables

  • totally ad-hoc methods


  • References l.jpg
    References

    • two great theses:

      • Paolo Baerlocher

      • Chris Welman

    • google & citeseer

    • GDC talks

      • David Wu

      • Ken Perlin

    • Jeff Lander’s articles & code

    • Experimental Gameplay Workshop


    ad