Human Kinematics Kinematic representation Iterative methods - - PowerPoint PPT Presentation

human kinematics
SMART_READER_LITE
LIVE PREVIEW

Human Kinematics Kinematic representation Iterative methods - - PowerPoint PPT Presentation

Human Kinematics Kinematic representation Iterative methods Optimization methods Motion representation Maximal coordinates Generalized coordinates x, y, z, 0 , 0 , 0 ( x 0 , R 0 ) 1 , 1 ( x 1 , R 1 ) 2 ( x 2 , R 2


slide-1
SLIDE 1

Human Kinematics

slide-2
SLIDE 2
  • Kinematic representation
  • Iterative methods
  • Optimization methods
slide-3
SLIDE 3

Maximal coordinates

Motion representation

(x0, R0) (x1, R1) (x2, R2)

Assuming there are m links and n DOFs in the articulated body, how many constraints do we need to keep links connected correctly in maximal coordinates?

Generalized coordinates

θ1, φ1 θ2

state variables: 18 state variables: 9

x, y, z, θ0, φ0, ψ0

constraints: 9

slide-4
SLIDE 4

Maximal coordinates

  • Direct extension of well understood rigid body

dynamics; easy to understand and implement

  • Operate in Cartesian space; hard to
  • evaluate joint angles and velocities
  • enforce joint limits
  • apply internal joint torques
  • Inaccuracy in numeric integration can cause body

parts to drift apart

slide-5
SLIDE 5

Generalized coordinates

  • Joint space is more intuitive when dealing with

complex multi-body structures

  • Fewer DOFs and fewer constraints
  • Hard to derive the equation of motion
slide-6
SLIDE 6

Kinematics

  • Forward kinematics
  • given a joint configuration, what is the position
  • f an end point on the structure?
  • Inverse kinematics
  • given the position for an end point on the

structure, what angles do the joints need be to achieve that end point?

slide-7
SLIDE 7

Quiz

p θ φ

σ θ, φ, σ = f(p)

p θ φ

σ p = f(θ, φ, σ)

Which function is inverse kinematics?

slide-8
SLIDE 8

Why inverse?

  • More intuitive control
  • Maintain environment constraints
  • Calculate desired joint angles for control
slide-9
SLIDE 9

Motion representation

Global position and orientation are determined by 3 translational and 3 rotational DOFs Each joint can have up to 3 DOFs

1 DOF: knee 2 DOF: wrist 3 DOF: arm

slide-10
SLIDE 10

Configurations

θthigh, φthigh, σthigh θknee θankle, φankle

x, y, z, θ, φ, σ

q = x, y, z, θ, φ, σ, θth, φth, σth, θkn, · · ·

slide-11
SLIDE 11

Transformation chain

h(q) p θthigh, φthigh, σthigh θknee θankle, φankle

h(q) = T(x, y, z)R(θ, φ, σ)T(d0)R(θth, φth, σth)T(d1)R(θkn)T(d2)R(θan, φan)x a point on foot in local coordinates a point on foot in world coordinates d1 d2 x, y, z, θ, φ, σ d0

slide-12
SLIDE 12

Constraints

Position constraint

C(q) = h(q) − p = 0

h(q) p θthigh, φthigh, σthigh θknee θankle, φankle

h(q) = T(x, y, z)R(θ, φ, σ)T(d0)R(θth, φth, σth)T(d1)R(θkn)T(d2)R(θan, φan)x a point on foot in local coordinates a point on foot in world coordinates d1 d2 x, y, z, θ, φ, σ d0

slide-13
SLIDE 13

Solutions

  • Closed form solutions can only be found for fairly

simple mechanisms

  • Numerical solutions
  • No solution
  • Single solution
  • Multiple solution
slide-14
SLIDE 14

Under-specified problem

  • Multiple solutions
  • Mostly bad
  • How do we find the optimal solution?
  • Heuristics (move the outermost links first)
  • Closest to the current configuration
  • Energy minimization
  • Natural looking motion (whatever it means)
slide-15
SLIDE 15
slide-16
SLIDE 16
  • Kinematic representation
  • Iterative methods
  • Optimization methods
slide-17
SLIDE 17

Iterative method

  • Use inverse of Jacobian to iteratively step all

the joint angles towards the goal

  • Girard and Maciejewski, Computational

modeling for the computer animation of legged figures, SIGGRAPH 85

slide-18
SLIDE 18

Problems

  • Pseudo inverse returns the least square minimum

norm solution

  • Singularities cause deficient Jacobian
  • Linearization about current state causes error
slide-19
SLIDE 19
  • Kinematic representation
  • Iterative methods
  • Optimization methods
slide-20
SLIDE 20

Optimization method

  • Find a solution that optimizes some numeric

metric and satisfies constraints

  • Numeric metric
  • A function of q that measures the quantity

to be minimized

  • Also called “objective function”
slide-21
SLIDE 21

Optimization method

min

q G(q)

C(q) = 0

subject to Solve for joint configuration q

slide-22
SLIDE 22

Objective functions

  • Joint velocity
  • Power consumption
  • Similarity to the rest pose
  • Similarity to the natural pose
slide-23
SLIDE 23

Unconstrained optimization

  • Treat each constraint as a separate metric and

minimize weighted sum of all metrics

  • Also called penalty methods
  • each spring pulls on constraint with force

proportional to violation of the constraint

slide-24
SLIDE 24

Unconstrained optimization

F(q) = G(q) +

  • i

wiCi(q)2

“Softening” constraints by adding them to the

  • bjective function

Now we have a new optimization problem: min

q

slide-25
SLIDE 25

Gradient descent

For each iteration, move in the direction of negative gradient And update the state

qnew = q − α∂F ∂q

−∂F ∂q = −∂G ∂q − 2 X

i

wi ∂Ci ∂q

T

Ci One of the simplest way to solve this optimization is gradient descent method

slide-26
SLIDE 26

compute update while

F(q) > ✏ q = q − α∂F ∂q

Optimization loop

∂F ∂q = ∂G(q) ∂q + 2 X

i

wi(∂Ci ∂q )T Ci

slide-27
SLIDE 27

Search step size

The step size in each search iteration can be determined arbitrarily, through a binary search, or solved by another optimization process Step size: where min

α F(q + α∆q)

α

qnew = q + α∆q

slide-28
SLIDE 28

Optimize IK problem

We can simplify the problem by ignoring G(q), but we still need to know how to compute constraint derivatives. compute update while

F(q) > ✏ q = q − α∂F ∂q ∂F ∂q = ∂G(q) ∂q + 2 X

i

wi(∂Ci ∂q )T Ci

slide-29
SLIDE 29

Constraint derivatives

  • We need a direction to move

joints in such way that the handle moves towards the goal

  • The derivative of the constraint,

i.e. Jacobian, gives directions where handles move if joints move

h(q) p

C(q) = h(q) − p = 0 ∂C(q) ∂q = ∂h(q) ∂q

slide-30
SLIDE 30

Quiz

  • What’s the dimension of the Jacobian for a

system with n dofs and m position constraints?

slide-31
SLIDE 31

Constraint derivatives

∂C(q) ∂q = ∂h(q) ∂q

h(q) p

x, y, z, θ0, φ0, σ0 θ1

θ2, φ2 q = [x, y, z, θ0, φ0, σ0, θ1, θ2, φ2]

C(q) = h(q) − p = 0

Need to know how to compute derivatives for each transformation

∂h(q) ∂θ1 = T(x, y, z)R(θ0, φ0, σ0)T∂R(θ1) ∂θ1 TR(θ2, φ2)hk h(q) = T(x, y, z)R(θ0, φ0, σ0)TR(θ1)TR(θ2, φ2)hk hk: local coordinate of h

slide-32
SLIDE 32

Quiz

  • What is the derivative for the translation matrix?
  • What is the derivative for a rotation matrix about

z axis?

    1 3 1 5 1 −2 1         cos θ sin θ − sin θ cos θ 1 1    

slide-33
SLIDE 33

Constraint derivatives

h(q) p

x, y, z,

θ0, φ0, σ0

θ1

θ2, φ2

hk: local coordinate of h

What is the most efficient way to compute the ?

∂h(q) ∂q

h = T0(x, y, z)R0(θ0, φ0, σ0)T1R1(θ1)T2R2(θ2, φ2)hk

Compute the gradient for the DOF

  • n the outermost link first
slide-34
SLIDE 34

Unconstrained optimization

  • Pros:
  • simple and fast, no linear system to solve
  • near-singular configurations is less of a problem
  • Cons:
  • can’t maintain constraints exactly
  • constraints fight against each other and the
  • bjective function
slide-35
SLIDE 35

Constrained optimization

  • Treat constraints as “hard constraints”
  • Use Lagrangian formulation to solve a

nonlinear optimization

L(q, λ) = G(q) − λ · C min

q,λ L(q, λ)

slide-36
SLIDE 36

Constrained method

  • Pros
  • Enforce constraints exactly
  • Quadratic convergence
  • Cons
  • Large system of equations
  • Near-singular configurations cause instability
slide-37
SLIDE 37

Leg example

hip knee ankle R(q0)R(q1)R(q2) R(q3) R(q4)R(q5) L0 L1 L2 L3 T0h Th1 T1k Tk2 T2a Ta3 h0

slide-38
SLIDE 38

Leg example

C(q) = T0hR0R1R2Th1T1kR3Tk2T2aR4R4Ta3h0 - p q0, q1, q2 q3 q4, q5 q = {q0, q1, q2, q3, q4, q5} p h0 To evaluate gradients of the obj function at each iteration, we need to evaluate constraint and compute Jacobian. How to compute J(q)?

node0 node1 node2 node3 hip knee ankle

slide-39
SLIDE 39

Compute Jacobian

Consider the derivative of C with respect to q5

R(q0)R(q1)R(q2) R(q3) R(q4)R(q5) T0h Th1 T1k Tk2 T2a Ta3 h0 joint node

node->getParentBodyNode()->getTransform() joint->getTransformFromParentBodyNode() joint->getTransform(0) joint->getTransformDerivative(1)

∂C ∂q5 = T0hR(q0)R(q1)R(q2)Th1T1kR(q3)Tk2T2aR(q4) ∂R ∂q5 Ta3h0

joint->getTransformFromChildBodyNode().inverse()