Professional Documents
Culture Documents
C2-Inverse Kinematics-2 Amp - Compatibility Mode 1.8m
C2-Inverse Kinematics-2 Amp - Compatibility Mode 1.8m
C2-Inverse Kinematics-2 Amp - Compatibility Mode 1.8m
Inverse kinematics
(cont.)
Different Configuration
1
10/18/2022
2
10/18/2022
• where
3
10/18/2022
We have
• So
10
• We obtain
11
Or
12
4
10/18/2022
Solve:
13
• Same:
14
We obtain
15
5
10/18/2022
• We get
16
θ2
l2
l1
θ1 X=(x,y)
End Effector
Base
17
θ2
l2
l1
θ1 X=(x,y)
End Effector
Base (0,0)
x=f(θ1, θ2)
18
6
10/18/2022
θ2
l2
l1
θ1 X=(x,y)
End Effector
Base (0,0)
x = (l1cosθ1+l2cos(θ2+ θ2)
y = l1sinθ1+l2sin(θ2+ θ2))
19
Inverse Kinematics
• What if an animator specifies position of end-
effector?
θ2
l2
l1
End Effector
θ1 X=(x,y)
Base (0,0)
20
Inverse Kinematics
• Animator specifies the position of end-effector: x
• Computer finds joint angles: θ1θ2
θ2
l2
l1
End Effector
θ1 X=(x,y)
Base (0,0)
(θ1, θ2)=f-1(x)
21
7
10/18/2022
Inverse Kinematics
• Animator specifies the position of end-effector: x
• Computer finds joint angles: θ1θ2
θ2
l2
l1
End Effector
θ1 X=(x,y)
Base (0,0)
22
23
Inverse Kinematics
• Given end effector’s positions, compute
required joint angles
24
8
10/18/2022
Inverse Kinematics
• Analytical solution only works for a fairly
simple structure
25
Numerical Approaches
• Inverse kinematics can be formulated as
an optimization problem
26
Function Optimization
• Finding the minimum for nonlinear
functions
F(x)
27
9
10/18/2022
Optimization As a Tool
• How to use optimization to solve the
following linear system?
3x + 2y = 5;
4x – 5y = 6
28
Optimization As a Tool
• How to use optimization to solve the
following linear system?
3x + 2y = 5;
4x – 5y = 6
Define a function:
F(x,y) = (3x+2y-5)2+(4x-5y-6)2
29
Optimization As a Tool
• How to use optimization to solve the
following linear system?
3x + 2y = 5;
Could be nonlinear equations!
4x – 5y = 6
Define a function:
F(x,y) = (3x+2y-5)2+(4x-5y-6)2
30
10
10/18/2022
Optimization As a Tool
• How to use optimization to solve the
following linear system?
f(x, y) = 0;
Could be nonlinear equations!
g(x,y) = 0
Define a function:
F(x,y) = f(x,y)2+g(x,y)2
31
Formulation
• So how to convert the IK process into an
optimization function?
θ2
l2
l1
θ1 C=(Cx,Cy)
Base (0,0)
32
Iterative Approaches
Find the joint angles θ that minimizes the distance between
the hypothesized character position and user specified
position
hypothesized specified
position position
θ2
l2
l1
θ1 C=(Cx,Cy)
Base (0,0)
33
11
10/18/2022
Iterative Approaches
Find the joint angles θ that minimizes the distance between
the hypothesized character position and user specified
position
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
34
Iterative Approaches
Mathematically, we can formulate this as an
optimization problem:
35
Gradient-based Optimization
36
12
10/18/2022
Gauss-Newton Approach
Step 1: initialize the joint angles with
37
Gauss-Newton Approach
Step 1: initialize the joint angles with
38
Gauss-Newton Approach
Step 1: initialize the joint angles with
39
13
10/18/2022
Gauss-Newton Approach
Step 1: initialize the joint angles with
Known!
40
Gauss-Newton Approach
Step 1: initialize the joint angles with
41
Gauss-Newton Approach
Step 1: initialize the joint angles with
rearrange
42
14
10/18/2022
Gauss-Newton Approach
Step 1: initialize the joint angles with
43
Gauss-Newton Approach
Step 1: initialize the joint angles with
rearrange
44
Gauss-Newton Approach
• Optimizing an quadratic function is easy
45
15
10/18/2022
Gauss-Newton Approach
• Optimizing an quadratic function is easy
J Δθ b
Linear equation!
46
Gauss-Newton Approach
• Optimizing an quadratic function is easy
J Δθ b
47
Gauss-Newton Approach
• Optimizing an quadratic function is easy
J Δθ b
48
16
10/18/2022
Jacobian Matrix
Dofs (N)
• Jacobian is a M by N matrix
that relates differential
49
Jacobian Matrix
• Jacobian maps the velocity in joint angle space to
velocities in Cartesian space
(x,y)
θ2
θ1
50
Jacobian Matrix
• Jacobian maps the velocity in joint angle space to
velocities in Cartesian space
(x,y)
A small change of θ1 and θ2 results in how
much change of end-effector position (x,y)
θ2
θ1
51
17
10/18/2022
Jacobian Matrix
• Jacobian maps the velocity in joint angle space to
velocities in Cartesian space
(x,y)
A small change of θ1 and θ2 results in how
much change of end-effector’s position (x,y)
θ2
θ1
52
Jacobian Matrix
• Jacobian maps the velocity in joint angle space to
velocities in Cartesian space
(x,y)
A small change of θ1 and θ2 results in how
much change of end-effector position (x,y)
θ2
θ1
53
Jacobian Matrix
• Jacobian maps the velocity in joint angle space to
velocities in Cartesian space
(x,y)
A small change of θ2 results in how much
change of end-effector position f=(x,y)
θ2
θ1
54
18
10/18/2022
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
55
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
56
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
57
19
10/18/2022
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
58
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
59
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
60
20
10/18/2022
θ2
l2
l1
θ1 C=(c1,c2)
Base (0,0)
61
Gauss-Newton Approach
Step 1: initialize the joint angles with
62
When to stop
Option #1: When the change of solution from previous
iteration to the current one is below a user-specified
threshold.
63
21
10/18/2022
64
• http://www.ics.forth.gr/~lourakis/levmar/
65
Example 2
• A 2D lamp character
66
66
22
10/18/2022
Example 2
• A 2D lamp character
67
67
Forward Kinematics
• A 2D lamp character
68
Forward Kinematics
• A 2D lamp with 6 degrees of freedom
lower arm
middle arm
?
Upper arm
base
69
23
10/18/2022
Inverse Kinematics
• A 2D lamp with 6 degrees of freedom
lower arm
middle arm
70
Inverse Kinematics
• A 2D lamp with 6 degrees of freedom
lower arm
middle arm
71
Human Characters
72
72
24
10/18/2022
Inverse Kinematics
• Analytical solution only works for a fairly
simple structure
73
Inverse Kinematics
• Is the solution unique?
• Is there always a good solution?
74
Ambiguity of IK
• Multiple solutions
75
25
10/18/2022
Ambiguity of IK
• Infinite solutions
76
Failures of IK
• Solution may not exist
77
Inverse Kinematics
• Generally ill-posed problem when the number of
Dofs is higher than the number of constraints
78
26
10/18/2022
Inverse Kinematics
• Generally ill-posed problem when the number of
Dofs is higher than the number of constraints
• Additional objective
– Minimal Change from a reference pose θ0
79
Inverse Kinematics
• Generally ill-posed problem when the number of
Dofs is higher than the number of constraints
• Additional objective
– Minimal Change from a reference pose θ0
80
Inverse Kinematics
• Generally ill-posed problem when the number of
Dofs is higher than the number of constraints
• Additional objective
– Minimal Change from a reference pose θ0
81
27
10/18/2022
Inverse Kinematics
• Generally ill-posed problem when the number of
Dofs is higher than the number of constraints
• Additional objective
– Minimal Change from a reference pose θ0
– Naturalness g(θ) (particularly for human characters)
82
Inverse Kinematics
• Generally ill-posed problem when the number of
Dofs is higher than the number of constraints
• Additional objective
– Minimal Change from a reference pose θ0
– Naturalness g(θ) (particularly for human characters)
83
Inverse Kinematics
• Generally ill-posed problem when the number of
Dofs is higher than the number of constraints
• Additional objective
– Minimal Change from a reference pose θ0
– Naturalness g(θ) (particularly for human characters)
84
28
10/18/2022
Summary of IK
• Very simple structure allows an analytic
solution
85
Support Materials
86
3-link 2D arm
L2
q2 y
L1
q1
x
87
87
29
10/18/2022
88
88
Projection (cont)
P: projection matrix
89
89
Extra material
Jacobian transpose
Constraint dynamics
90
30
10/18/2022
Ref: all-about-taylor.ppt
Statement of the IK Problem
g x(q)
Want *
91
c: current, d: destination
92
92
L2
q2 y
L1 pd
q1
x
93
93
31
10/18/2022
Jacobian Transpose
L2
q2 y
L1
q1
x
94
94
Principle
. .
95
95
96
96
32
10/18/2022
97
97
98
98
Differences
99
99
33
10/18/2022
P2
[Constraint Dynamics]
L2
q2
P1
L1
q1
100
100
101
101
34