Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward...
Transcript of Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward...
![Page 1: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/1.jpg)
Inverse Kinematics
Jehee LeeSeoul National University
![Page 2: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/2.jpg)
Forward and Inverse Kinematics
1q
2q
)F(),( iq=qp ),(F 1 qp-=iqForward Kinematics Inverse Kinematics
1q
2q
![Page 3: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/3.jpg)
Why Inverse Kinematics ?
• Environmental interactions– Pick up an object or place feet on the ground– Hard to do with forward kinematics
• The pose of the character is described in the joint angle space• The environmental interaction is described in the work (Cartesian)
space
![Page 4: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/4.jpg)
Inverse Kinematics: A Simple Example
• A simple robot arm in 2-dimensional space– Two revolute joints– The position of the end-effector is known– Compute joint angles
2q
1q1l
2l
X
Y
),( ee yx
![Page 5: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/5.jpg)
Analytic Solution for A Simple Example
2q
1q1l
2l
X
Y
tq
÷÷ø
öççè
æ --+-=
--+=-
÷÷
ø
ö
çç
è
æ
+
-++-=
+
-++=-
÷÷
ø
ö
çç
è
æ
+=
+=
-
-
-
21
2222
211
2
21
2222
21
2
221
22
22211
1
221
22
2221
1
22
1
22
2cos
2)cos(
2cos
2)cos(
cos
)cos(
llyxll
llyxll
yxl
lyxl
yxl
lyxl
yx
x
yx
x
ee
ee
ee
ee
ee
ee
ee
e
ee
e
pq
qp
q
q
t
t
t
t
),( ee yx
![Page 6: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/6.jpg)
Redundancy in Human Arms
![Page 7: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/7.jpg)
Why so difficult to get a closed-form solution ?
• Redundancies– Multiple solutions (# of unknowns > # of equations)
• Joint limit– The range of each unknown is bounded
• Reachable workspace– No solution, or– A unique solution, or– Multiple solutions
• Multiple goals– Four limbs may have constraints simultaneously– Intermediate links can also be constrained
![Page 8: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/8.jpg)
Iterative Methods
• Iteratively refine joint angles to the goal– Consider infinitesimal changes
),(from),,(compute 321 yxqqq
),(from),,(compute 321 yx ¶¶¶¶¶ qqq
),( yx ¶¶
3q¶
1q¶ 2q¶
![Page 9: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/9.jpg)
Jacobians of Forward Kinematics Map
• Forward Kinematics Map
• Jacobian
÷÷÷
ø
ö
ççç
è
æ
÷÷÷÷
ø
ö
çççç
è
æ
¶
¶
¶
¶
¶
¶¶¶
¶¶
¶¶
=
÷÷÷
ø
ö
ççç
è
æ
=÷÷ø
öççè
æ
3
2
1
321
321
3
2
1
qqq
qqq
qqq
qqq
!!!
!!!
!!
yyy
xxx
FFF
FFF
yx
J
),,(),(),( 321 qqqFFFyx yx ==),( yx ¶¶
3q¶
1q¶ 2q¶
Goal
![Page 10: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/10.jpg)
Jacobian of Forward Kinematics Map
• If the inverse of the Jacobian can be computed, …
),( yx ¶¶
3q¶
1q¶ 2q¶
Goal
tt
ttt
yx
t
t
÷÷ø
öççè
æD+
÷÷÷
ø
ö
ççç
è
æ=
÷÷÷
ø
ö
ççç
è
æ
D+÷÷÷
ø
ö
ççç
è
æ=
÷÷÷
ø
ö
ççç
è
æ
-
+
!!
!!!
1
3
2
1
3
2
1
3
2
1
13
2
1
Jqqq
qqq
qqq
qqq
![Page 11: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/11.jpg)
A System of Linear Equations
• # of unkowns = the dimension of q = n• # of equations = the dimension of x = m• J is a (m x n) matrix
• The solution maybe unique if m=n• The linear system is under-specified if m<n• The linear system is over-specified if m>n
xθJ !! =
the pseudoinverse of Jacobianis required
![Page 12: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/12.jpg)
A Geometric Interpretation of Jacobian
• You don’t have to differentiate the forward kinematics map to compute Jacobian
• The colume vectors (j1, j2, j3) of Jare perpendicular to the corresponding vectors (p1, p2, p3) from the joint to the end-effector
![Page 13: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/13.jpg)
Linear and Angular Velocities in 3D
• Velocity of a point due to rotating joints
wpv
p
ww
w
=
´=
p
p pv
![Page 14: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/14.jpg)
Jacobian in 3D
• A serial chain with n revolute joints
÷÷ø
öççè
æ ´´´=
n
nn pppJ
wwwwww
!!
21
2211
÷÷÷÷÷
ø
ö
ççççç
è
æ
¶
¶¶
=÷÷ø
öççè
æ
-
-
n
effectorend
effectorend Jv
q
w !2
1
1w
1p
![Page 15: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/15.jpg)
Jacobian in 3D
• A serial chain with n revolute joints
÷÷ø
öççè
æ ´´´=
n
nn pppJ
wwwwww
!!
21
2211
÷÷÷÷÷
ø
ö
ççççç
è
æ
¶
¶¶
=÷÷ø
öççè
æ
-
-
n
effectorend
effectorend Jv
q
w !2
1
2w 2p
![Page 16: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/16.jpg)
Redundancy
• A single solution must be chosen from multiple solutions– “Closest” to the current configuration
• Pseudo inverse minimizes joint angle rates (locally) – Move outermost links the most
• The outermost link sweeps a smallest region (visual change)– Minimum time and effort
• Dynamics involves– Secondary goal
• Additional constraints– Natural looking
• Biomechanical experiments
![Page 17: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/17.jpg)
IK can be ill-conditioned
• A small change in the position of the end-effector could require substantial changes of joint angles
![Page 18: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/18.jpg)
Singularity
• Singularities cause the rank of the Jacobian to change• Often ill-conditioned near singularities
![Page 19: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/19.jpg)
Iterative Method Using Jacobian
• Jacobian should be computed at every time step
• Simple Euler integration can be used
• Singularity could result in numerical instability
![Page 20: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/20.jpg)
Non-Linear Optimization
• Non-linear programming– Numerical method for finding the (local) minimum of a
non-linear function
• An efficient way of solving IK• The path may not look natural• Multiple goals can easily be handled
• We need to define– Objective function : ex) Place hands at specific positions
– Constraints : ex) Joint limits
![Page 21: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/21.jpg)
Objective Function
• Position
• Orientation
• Direction
2)()( goalG pp -= qq
( ) 21 )(log)( qq qq-= goalG
2)()( goalG vv -= qq
![Page 22: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/22.jpg)
Constrained Optimization
• Formulation
• Use a standard numerical technique– Gradient decent– Conjugate gradient– Sequential quadratic programming
iii ulG
subject to)( Minimize
![Page 23: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/23.jpg)
Basic Idea of Numerical Techniques
• Pseudoinverse + Euler integration– Constant time step
![Page 24: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/24.jpg)
Basic Idea of Numerical Techniques
• Direction selection + Line minimization– Least squares– Gradient– Conjugate gradient
![Page 25: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/25.jpg)
Quick and Dirty
• Cyclic coordinate decent– Try to solve the problem with subset of joints– If it fails, add a joint
• Jacobian transpose method– Use the transpose of Jacobian, instead of
pseudoinverse– Do not guarantee the least-squares property
![Page 26: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/26.jpg)
Hybrid Approach
• Arms and legs allow analytic solutions– Redundancy can be parameterized by
elbow circles
• Reduced-coordinate formulation– We can replace 7 dof for each limb by a
single elbow circle parameter– Hybrid formulation (numerical + analytic)– The numerical optimization can be done
with fewer number of parameters
![Page 27: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/27.jpg)
Data-Driven Approach
• IK is underdetermined– Many possible poses satisfy constraints– Some poses more likely than others– The likelihood of poses depends on the body shape
and style of the individual person
• Data-driven IK– Drive the likelihood function from human motion data– data-driven-ik.avi
![Page 28: Inverse Kinematicsmrl.snu.ac.kr/.../ComputerAnimationLectureNote/6_InverseKinematic… · forward kinematics map to compute Jacobian • The colume vectors (j1, j2, j3) of J are perpendicular](https://reader035.fdocuments.us/reader035/viewer/2022062402/5fc4d8e693dc9267812adaf2/html5/thumbnails/28.jpg)
Summary
• Very simple structure allows an analytic solution
• Most of complex articulated figures requires a numerical solution
• May not always get the “right” answer– Need to tweak the solution later