CS 184: Foundations of Computer Graphics Kinematics of Articulated - - PowerPoint PPT Presentation

cs 184 foundations of computer graphics
SMART_READER_LITE
LIVE PREVIEW

CS 184: Foundations of Computer Graphics Kinematics of Articulated - - PowerPoint PPT Presentation

CS 184: Foundations of Computer Graphics Kinematics of Articulated Bodies Rahul Narain Kinematics vs. dynamics Kinematics = motion but no forces Keyframing, motion capture, etc. Dynamics = motion from forces Simulation


slide-1
SLIDE 1

CS 184: Foundations of Computer Graphics

Kinematics of Articulated Bodies Rahul Narain

slide-2
SLIDE 2

Kinematics vs. dynamics

  • Kinematics = motion but no forces
  • Keyframing, motion capture, etc.
  • Dynamics = motion from forces
  • Simulation
slide-3
SLIDE 3

If you want to know more about dynamics and simulation...

  • Particles and rigid bodies:
  • Baraff and Witkin, “Physically Based Modeling”, 2001
  • Deformable bodies:
  • James O’Brien’s CS 283 slides and readings on elastic

simulation

  • Fluids:
  • Bridson and Müller-Fischer, “Fluid Simulation for Computer

Animation”, 2007

slide-4
SLIDE 4

Articulated bodies

  • Rigid bodies connected with joints
  • Topology (what’s connected to what)
  • Geometric relations from joints
  • Not necessarily what’s displayed in the end
slide-5
SLIDE 5

Articulated bodies

  • Root body
  • Position and orientation set by

“global” transformation

  • Other bodies move relative to root
slide-6
SLIDE 6

Articulated bodies

  • A joint
  • Inboard body (towards root)
  • Outboard body (away from root)
slide-7
SLIDE 7

Articulated bodies

  • A body
  • Inboard joint
  • Outboard joint(s)
  • Parent
  • Child(ren)
slide-8
SLIDE 8

Articulated bodies

  • A body
  • Inboard joint
  • Outboard joint(s)
  • Parent
  • Child(ren)
slide-9
SLIDE 9

Articulated bodies

  • Interior joints are typically not 6 DOF

Pin joint: rotation about one axis Prism joint: translation along one axis Ball: arbitrary rotation Wikimedia Commons

slide-10
SLIDE 10

Forward and inverse kinematics

  • Forward kinematics:
  • Given all the joint parameters, where are the bodies?
  • Inverse kinematics:
  • Given where I want some body to be, what joint parameters do I

need to set?

slide-11
SLIDE 11

Forward kinematics

  • Each body gets its own local

coordinate system

  • Position of a vertex is fixed

relative to local coordinate system

  • What is its position relative to

world coordinates?

slide-12
SLIDE 12

Forward kinematics

  • Pin joints
  • Translate inboard joint to origin
  • Apply rotation about axis
  • Translate origin to location of
  • utboard joint on parent body
slide-13
SLIDE 13

Forward kinematics

  • Ball joints
  • Translate inboard joint to origin
  • Apply rotation about arbitrary

axis

  • Translate origin to location of
  • utboard joint on parent body
slide-14
SLIDE 14

Forward kinematics

  • Prism joints
  • Translate inboard joint to origin
  • Translate along axis
  • Translate origin to location of
  • utboard joint on parent body
slide-15
SLIDE 15

Forward kinematics

  • Composite transformations up the hierarchy

?

1. 2. 3.

  • Mworld←forearm = Mworld←hip ∙ Mhip←torso ∙ Mtorso←upperarm ∙ Mupperarm←forearm
slide-16
SLIDE 16

Forward kinematics

  • Composite transformations up the hierarchy

?

1. 2. 3.

slide-17
SLIDE 17

Inverse kinematics

  • Given
  • Root transformation
  • Initial configuration
  • Desired location of end point
  • Find
  • Internal parameter settings

* *

slide-18
SLIDE 18

Inverse kinematics

  • A simple two segment arm in 2D
  • Segment Arm

inate System

James O’Brien

slide-19
SLIDE 19

Direct IK

  • Just solve for the parameters! What’s the problem?

r and

slide-20
SLIDE 20

Why is this hard?

Multiple disconnected solutions Multiple connected solutions

slide-21
SLIDE 21

Why is this hard?

Solutions don’t always exist

slide-22
SLIDE 22

Numerical IK

  • Start in some initial configuration
  • Define an error metric (e.g. pgoal − pcurrent)
  • Compute Jacobian of error w.r.t joint angles θ
  • Apply Newton’s method (or other procedure)
  • Iterate...
slide-23
SLIDE 23

Inverse kinematics

  • Recall the simple two segment arm:
  • Segment Arm

inate System

slide-24
SLIDE 24

Numerical IK

  • We can write the derivatives
  • Segment Arm
slide-25
SLIDE 25

Numerical IK

  • If we change the angles by a small amount dθ1 and dθ2, this tells us

how px and pz change.

  • Segment Arm
slide-26
SLIDE 26
  • Matrix of partial derivatives
  • For a two segment arm in 2D,

The Jacobian

Jij = ∂pi ∂θj J = "

∂px ∂θ1 ∂px ∂θ2 ∂pz ∂θ1 ∂pz ∂θ2

#

slide-27
SLIDE 27
  • A small change in θ leads to a small change in p
  • So... if we want to change p, this tells us how to change θ?

The Jacobian

dp = "

∂px ∂θ1 ∂px ∂θ2 ∂pz ∂θ1 ∂pz ∂θ2

# · dθ1 dθ2

  • = J · dθ

dpx = ∂px ∂θ1 dθ1 + ∂px ∂θ2 dθ2 dpz = ∂pz ∂θ1 dθ1 + ∂pz ∂θ2 dθ2 dp = J · dθ dθ = J−1 · dp?

slide-28
SLIDE 28

The Jacobian

Bill Baxter

slide-29
SLIDE 29

Back to inverse kinematics

  • We want p to change by dp
  • Can we simply change θ by

dθ = J−1 dp?

  • ...Is J invertible?

d

ertible?

= J · dθ

slide-30
SLIDE 30

Inverse kinematics

  • Problems:
  • Jacobian may (will!) not be invertible → use pseudo-inverse,
  • r use more robust numerical method
  • Jacobian is not constant → take small steps
  • Nonlinear optimization, but (mostly) well-behaved
slide-31
SLIDE 31

More complex systems

  • More complex joints (prism and ball)
  • More links
  • Other goals (e.g. center of mass)
  • Hard constraints (joint limits, collisions)
  • Multiple criteria and multiple chains
slide-32
SLIDE 32

Multiple links

  • We need a generic way of building the Jacobian

1 2a 3 2b

slide-33
SLIDE 33

Multiple links

  • Can’t just stack the Jacobians together!

1 2a 3 2b

˜ J = [J1 J2a J2b J3] q =     θ1 d2a θ2b θ3     dp 6= ˜ J · dq

slide-34
SLIDE 34

Remember forward kinematics

  • World position of point is given by composition of transformations
  • If joint 2b moves, only M2a←2b changes

p = M0←1 · M1←2a · M2a←2b · M2b←3 · x

1 2a 2b 3

2b 3 a b

M2b←3 x J2b M2b←3 x ∂p ∂θ2b = M0←1 · M1←2a · ∂ ∂θ2b M2a←2b · M2b←3 · x = M0←1 · M1←2a · J2b(θ2b) · M2b←3 · x M0←2a J2b M2b←3 x

slide-35
SLIDE 35

Multiple links

  • Compute each joint’s Jacobian locally (between outboard and

inboard bodies) (each entry here is a column of the matrix) q =     θ1 d2a θ2b θ3     dp = J · dq J =     · J1(θ1) ·M1←3x, M0←1·J2a(d2a)·M2a←3x, M0←2a·J2b(θ2b)·M2b←3x, M0←2b· J3(θ3) ·x    