advanced computer graphics (fall 2010) cs 283, lecture 20: inverse kinematics ravi ramamoorthi...

30
Advanced Computer Graphics Advanced Computer Graphics (Fall 2010) (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi http://inst.eecs.berkeley.edu/~cs283/fa10 Most slides courtesy James O’Brien from CS294-13 Fall

Post on 15-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Advanced Computer Graphics Advanced Computer Graphics (Fall 2010)(Fall 2010)

CS 283, Lecture 20:

Inverse Kinematics

Ravi Ramamoorthi

http://inst.eecs.berkeley.edu/~cs283/fa10

Most slides courtesy James O’Brien from CS294-13 Fall 2009

Page 2: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Forward KinematicsForward Kinematics

Root body

Position set by global transform

Root joint: position, rotation

Other bodies relative to root

Inboard toward the root

Outboard away from the root

Tree structure: loop joints break

“tree-ness”

Page 3: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Inboard and OutboardInboard and Outboard

Joints

Inboard body

Outboard body

Body

Inboard joint

Outboard joint (may be several)

Page 4: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Inboard and OutboardInboard and Outboard

Joints

Inboard body

Outboard body

Body

Inboard joint

Outboard joint (may be several)

Page 5: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

BodiesBodies

Bodies arranged in a tree

For now, assume no loops

Body’s parent (except root)

Body’s child (may have many children)

Page 6: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

JointsJoints

Interior Joints (typically not 6 DOF)

Pin – rotate about one axis

Ball – arbitrary rotation

Prism – translate along one axis

Page 7: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Pin JointsPin Joints

Translate inboard joint to local origin

Apply rotation about axis

Translate origin to location of joint on outboard body

Page 8: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Ball JointsBall Joints

Translate inboard point to local origin

Apply rotation about arbitrary axis

Translate origin to location of joint on outboard body

Page 9: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Prism JointPrism Joint

Translate inboard joint to local origin

Translate along axis

Translate origin to location of joint on outboard

Page 10: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Forward KinematicsForward Kinematics

Composite transformations up the hierarchy

Page 11: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Inverse KinematicsInverse Kinematics

Page 12: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Inverse KinematicsInverse Kinematics

Egon Pasztor

Page 13: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

2 Segment Arm in 2D2 Segment Arm in 2D

Page 14: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Direct IKDirect IK Analytically solve for parameters (not general)

Page 15: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Difficult IssuesDifficult Issues

Multiple configurations distinct in config space

Or connected in config space

Page 16: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Infeasible RegionsInfeasible Regions

Page 17: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Numerical SolutionNumerical Solution

Start in some initial config. (previous frame)

Define error metric (goal pos – current pos)

Compute Jacobian with respect to inputs

Use Newton’s or other method to iterate

General principle of goal optimization

Page 18: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Back to 2 Segment ArmBack to 2 Segment Arm

Page 19: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Jacobians and Configuration SpaceJacobians and Configuration Space

Page 20: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Solving for Joint AnglesSolving for Joint Angles

Page 21: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

IssuesIssues

Jacobian not always invertible Use an SVD and pseudo-inverse

Iterative approach, not direct The Jacobian is a linearization, changes

Practical implementation Analytic forms for prism, ball joints Composing transformations Or quick and dirty: finite differencing Cyclic coordinate descent (each DOF one at a time)

Page 22: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Prism and Ball JointsPrism and Ball Joints

Page 23: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

More on Ball JointsMore on Ball Joints

Page 24: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Multiple LinksMultiple Links

IK requires Jacobian Need generic method for

building one

Can’t just concatenate matrices

Page 25: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Composing TransformationsComposing Transformations

Page 26: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Inverse Kinematics: Final FormInverse Kinematics: Final Form

Page 27: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

A Cheap AlternativeA Cheap Alternative

Estimate Jacobian (or parts of it) w. finite diffs.

Cyclic coordinate descent Solve for each DOF one at a time Iterate till good enough / run out of time

Page 28: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

More complex systemsMore complex systems

More complex joints (prism and ball)

More links

Other criteria (center of mass or height)

Hard constraints (e.g., foot plants)

Unilateral constraints (e.g., joint limits)

Multiple criteria and multiple chains

Loops

Smoothness over time DOF determined by control points of curve (chain rule)

Page 29: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Practical IssuesPractical Issues

How to pick from multiple solutions?

Robustness when no solutions

Contradictory solutions

Smooth interpolation Interpolation aware of constraints

Page 30: Advanced Computer Graphics (Fall 2010) CS 283, Lecture 20: Inverse Kinematics Ravi Ramamoorthi cs283/fa10 Most slides courtesy

Prior on “good” configurationsPrior on “good” configurations