human kinematics - gatech.edu
TRANSCRIPT
Human Kinematics
• Kinematic representation
• Iterative methods
• Optimization methods
Kinematics
• Forward kinematics
• given a joint configuration, what is the position of 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?
Kinematics
p
θφ
σ
θ, φ, σ = f(p)
p
θφ
σ
p = f(θ, φ, σ)
Which function is inverse kinematics?
Why inverse?
• More intuitive control
• Maintain environment constraints
• Calculate desired joint angles for control
Motion representationRotational DOFs are widely used in character animation
3 translational DOFs
48 rotational DOFs
Each joint can have up to 3 DOFs
1 DOF: knee 2 DOF: wrist 3 DOF: arm
Joint configurations
θthigh,φthigh,σthigh
θknee
θankle,φankle
x, y, z, �,⇤, ⇥
q = x, y, z, �,⇤, ⇥, �th, ⇤th, ⇥th, �kn, · · ·
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
Solutions
• Closed form solutions can only be found for fairly simple mechanisms
• Numerical solutions
• No solution
• Single solution
• Multiple solution
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)
• Kinematic representation
• Iterative methods
• Optimization methods
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
Jacobian matrix
DOF (n)
Con
stra
int (m
)
∂Ci
∂qj
i
j
Jacobian is a m by n matrix that relates differential changes of to changes ofq C
Jacobian maps the velocity in joint space to velocities in Cartesian space
Jacobian depends on current state
IK and the Jacobian
J =
∂C
∂q
∂C = J∂q
∂q = J−1∂C
qnew = q + ∆tJ−1∂C Linearize about current q
Invert JacobianBut Jacobian is most likely non-squareCompute the pseudo inverse Jacobian J+
∂C = J∂q
JT∂C = JT J∂q
(JT J)−1JT∂C = (JT J)−1JT J∂q
J+∂C = ∂q
J+ = (JT J)�1JT
Under-constrainedWhere #DOFs is greater than #constraints, the problem is under-constrained and JTJ is not invertible
@C@qJ =
@q = JT (JJT )�1@C
Problems
• Pseudo inverse returns the least square minimum norm solution
• Singularities cause deficient Jacobian
• Linearization about current state causes error
• Kinematic representation
• Iterative methods
• Optimization methods
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”
Optimization method
minq
G(q)
C(q) = 0subject to
Solve for joint configuration q
Objective functions
• Joint velocity
• Power consumption
• Similarity to the rest pose
• Similarity to the natural pose
Constraint derivatives
• What do we need?
• A direction to move joints in such way that the handles move towards the goal
• What do derivatives tell us?
• A direction where constraint handles move if joints move
h(q)
p
C(q) = h(q) − p = 0
∂C(q)
∂q=
∂h(q)
∂q
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
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 on the outermost link first
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
Unconstrained optimization
Minimize F (q) = G(q) +∑
i
wiCi(q)2
Move in the direction of
−
∂F
∂q= −
∂G
∂q− 2
∑
i
wi
∂Ci
∂qCi
Update the state qnew = q − α∂F
∂q
compute
update
while F (q) > ✏
q = q� ↵@F
@q
Optimization loop
@F
@q=
@G(q)@q
+ 2X
i
wi(@Ci
@q)T Ci
Search and stepFind direction and the step size that move joints closer to constraints
Step size: where minα
F (q + α∆q)α
Direction: ∆q = −
∂F
∂q
qnew = q + α∆q
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 objective function
Constrained optimization• Treat constraints as “hard constraints”
• Use Lagrangian formulation to solve a nonlinear optimization
L(q, λ) = G(q) − λ · C
minq,λ
L(q, λ)
Constrained method
• Pros
• Enforce constraints exactly
• Quadratic convergence
• Cons
• Large system of equations
• Near-singular configurations cause instability
• Read: Computational Modeling for Computer Generation of Legged Figures by Girard and Maciejewski, Siggraph 85
• Read: Style-based Inverse Kinematics by Grochow et. al., Siggraph 04