Title: CPSC 441: Forward kinematics and inverse kinematics
1CPSC 441 Forward kinematics and inverse
kinematics
2Outline
- Kinematics
- Forward kinematics
- Inverse kinematics
3Kinematics
- The study of movement without the consideration
of the masses or forces that bring about the
motion
4Degrees of freedom (Dofs)
- The set of independent displacements that specify
an objects pose
5Degrees of freedom (Dofs)
- The set of independent displacements that specify
an objects pose - How many degrees of freedom when flying?
6Degrees of freedom (Dofs)
- The set of independent displacements that specify
an objects pose - How many degrees of freedom when flying?
- So the kinematics of this airplane permit
movement anywhere in three dimensions
- Six
- x, y, and z positions
- roll, pitch, and yaw
7Degrees of Freedom
- How about this robot arm?
- Six again
- 2-base, 1-shoulder, 1-elbow, 2-wrist
8Work Space vs. Configuration Space
- Work space
- The space in which the object exists
- Dimensionality
- R3 for most things, R2 for planar arms
- Configuration space
- The space that defines the possible object
configurations - Degrees of Freedom
- The number of parameters that are necessary and
sufficient to define position in configuration
9Forward vs. Inverse Kinematics
- Forward Kinematics
- Compute configuration (pose) given individual DOF
values - Inverse Kinematics
- Compute individual DOF values that result in
specified end effector position
10Example Two-link Structure
- Two links connected by rotational joints
?2
l2
l1
?1
X(x,y)
11Example two-link structure
- Animator specifies the joint angles ?1?2
- Computer finds the position of end-effector x
?2
l2
l1
?1
X(x,y)
(0,0)
xf(?1, ?2)
12Example two-link structure
- Animator specifies the joint angles ?1?2
- Computer finds the position of end-effector x
?2
?2
l2
l1
?1
X(x,y)
(0,0)
x (l1cos?1l2cos(?2 ?2) y l1sin?1l2sin(?2
?2))
13Forward kinematics
- Create an animation by specifying the joint angle
trajectories
?2
?2
l2
l1
?1
X(x,y)
(0,0)
?1
?2
14Inverse kinematics
- What if an animator specifies position of
end-effector?
?2
?2
l2
l1
End Effector
?1
X(x,y)
(0,0)
15Inverse kinematics
- Animator specifies the position of end-effector
x - Computer finds joint angles ?1?2
?2
?2
l2
l1
End Effector
?1
X(x,y)
(0,0)
(?1, ?2)f-1(x)
16Inverse kinematics
- Animator specifies the position of end-effector
x - Computer finds joint angles ?1?2
?2
?2
l2
l1
End Effector
?1
X(x,y)
(0,0)
17Why Inverse Kinematics?
- Basic tools in character animation
- - key frame generation
- - animation control
- - interactive manipulation
- Computer vision (vision based mocap)
- Robotics
- Bioninfomatics (Protein Inverse Kinematics)
-
18Inverse kinematics
- Given end effector position, compute required
joint angles - In simple case, analytic solution exists
- Use trig, geometry, and algebra to solve
19Inverse kinematics
- Analytical solution only works for a fairly
simple structure - Iterative approach needed for a complex structure
20Iterative approach
- Inverse kinematics can be formulated as an
optimization problem
21Iterative approaches
- Find the joint angles ? that minimizes the
distance between the character position and user
specified position
?2
?2
l2
l1
?1
C(Cx,Cy)
(0,0)
22Iterative approaches
- Find the joint angles ? that minimizes the
distance between the character position and user
specified position
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
23Iterative approach
- Mathematically, we can formulate this as an
optimization problem - The above problem can be solved by many
optimization algorithm - - Steepest descent
- - Gauss-newton
- - Levenberg-marquardt, etc
24Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
25Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
How can we decide the amount of update?
26Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
27Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
Known!
28Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
Taylor series expansion
29Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
Taylor series expansion
rearrange
30Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
Taylor series expansion
rearrange
This is a quadratic function of
31Gauss-newton approach
- Optimizing an quadratic function is easy
- It has an optimal value when the gradient is zero
32Gauss-newton approach
- Optimizing an quadratic function is easy
- It has an optimal value when the gradient is zero
b
J
??
Linear equation!
33Gauss-newton approach
- Optimizing an quadratic function is easy
- It has an optimal value when the gradient is zero
b
J
??
34Gauss-newton approach
- Optimizing an quadratic function is easy
- It has an optimal value when the gradient is zero
b
J
??
35Jacobian matrix
Dofs (N)
- Jacobian is a M by N matrix that relates
differential changes of ? to changes of C - Jacobian maps the velocity in joint space to
velocities in Cartesian space - Jacobian depends on current state
The number of constraints (M)
36Jacobian matrix
- Jacobian maps the velocity in joint space to
velocities in Cartesian space
(x,y)
?2
?1
37Jacobian matrix
- Jacobian maps the velocity in joint 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
38Jacobian matrix
- Jacobian maps the velocity in joint 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
39Jacobian matrix 2D-link structure
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
40Jacobian matrix 2D-link structure
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
f2
f1
41Jacobian matrix 2D-link structure
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
42Jacobian matrix 2D-link structure
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
43Jacobian matrix 2D-link structure
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
44Jacobian matrix 2D-link structure
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
45Jacobian matrix 2D-link structure
?2
?2
l2
l1
?1
C(c1,c2)
(0,0)
46Gauss-newton approach
- Step 1 initialize the joint angles with
- Step 2 update the joint angles
Step size specified by the user
47More Complex Characters?
- A 2D lamp with 6 degrees of freedom
lower arm
middle arm
Upper arm
base
48More Complex Characters?
- A 2D lamp with 6 degrees of freedom
lower arm
middle arm
If you do inverse kinematics with position of
this point Whats the size of Jacobian matrix?
Upper arm
base
49More Complex Characters?
- A 2D lamp with 6 degrees of freedom
lower arm
middle arm
If you do inverse kinematics with position of
this point Whats the size of Jacobian
matrix? 2-by-6 matrix
Upper arm
base
50Human Characters
50
51Inverse kinematics
- Analytical solution only works for a fairly
simple structure - Iterative approach needed for a complex structure
52Inverse kinematics
- Is the solution unique?
- Is there always a good solution?
53Ambiguity of IK
54Ambiguity of IK
55Failures of IK
56Inverse kinematics
- Generally ill-posed problem when the Dofs is
higher than the number of constraints
57Inverse kinematics
- Generally ill-posed problem when the Dofs is
higher than the number of constraints - Additional objective
- Minimal Change from a reference pose ?0
58Inverse kinematics
- Generally ill-posed problem when the Dofs is
higher than the number of constraints - Additional objective
- Minimal Change from a reference pose ?0
59Inverse kinematics
- Generally ill-posed problem when the Dofs is
higher than the number of constraints - Additional objective
- Minimal Change from a reference pose ?0
Minimize the difference between the solution and
a reference pose
Satisfy the constraints
60Inverse kinematics
- Generally ill-posed problem when the Dofs is
higher than the number of constraints - Additional objective
- Minimal Change from a reference pose ?0
- Naturalness g(?) (particularly for human
characters)
61Inverse kinematics
- Generally ill-posed problem when the Dofs is
higher than the number of constraints - Additional objective
- Minimal Change from a reference pose ?0
- Naturalness g(?) (particularly for human
characters)
62Inverse kinematics
- Generally ill-posed problem when the Dofs is
higher than the number of constraints - Additional objective
- Minimal Change from a reference pose ?0
- Naturalness g(?) (particularly for human
characters)
How natural is the solution pose?
Satisfy the constraints
63Interactive Human Character Posing