forward and inverse kinematics cse 3541 matt boggus
TRANSCRIPT
![Page 1: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/1.jpg)
Forward and Inverse Kinematics
CSE 3541Matt Boggus
![Page 2: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/2.jpg)
Hierarchical Modeling
Relative motion
Constrains motion Reduces dimensionality
Parent-child relationshipSimplifies motion specification
![Page 3: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/3.jpg)
Modeling & animating hierarchies
3 aspects1. Linkages & Joints – the relationships2. Data structure – how to represent such a hierarchy3. Converting local coordinate frames into global space
![Page 4: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/4.jpg)
Terms
Joint – allowed relative motion & parameters
Joint Limits – limit on valid joint angle values
Link – object involved in relative motion
Linkage – entire joint-link hierarchy
End effector – most distant link in linkage
Pose – configuration of linkage using given set of joint angles
![Page 5: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/5.jpg)
Forward vs. Inverse Kinematics
Forward KinematicsInput: joint anglesOutput: link positions and orientations end effector position
Inverse KinematicsInput: end effectorOutput: joint angles
![Page 6: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/6.jpg)
Joints – relative movement
Every joint allowing motion in one dimension is said to have one degree of freedom (DOF)
Example: flying (Six DOF)• x, y, and z positions (prismatic or translation)• roll, pitch, and yaw (revolute or rotation)
![Page 7: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/7.jpg)
Complex Joints
![Page 8: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/8.jpg)
Hierarchical structure
![Page 9: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/9.jpg)
Forward Kinematics: A Simple Example• Forward kinematics map as a coordinate transformation
– The body local coordinate system of the end-effector was initially coincide with the global coordinate system
– Forward kinematics map transforms the position and orientation of the end-effector according to joint angles
2
11l
X Y
1
0
0
1
Ty
x
e
e2l
X
Y
Example from Jehee Lee
![Page 10: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/10.jpg)
A Chain of Transformations
1
0
0
1
Ty
x
e
e
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
2
11l
X Y
2l
X
Y
![Page 11: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/11.jpg)
Thinking of Transformations• In a view of body-attached coordinate system
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
X
Y
X Y
![Page 12: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/12.jpg)
X
Y
Thinking of Transformations• In a view of body-attached coordinate system
1X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 13: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/13.jpg)
Thinking of Transformations• In a view of body-attached coordinate system
11L
X Y
X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 14: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/14.jpg)
2
11L
X Y
Thinking of Transformations• In a view of body-attached coordinate system
X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 15: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/15.jpg)
2
11L
X Y
2L
Thinking of Transformations• In a view of body-attached coordinate system
X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 16: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/16.jpg)
Thinking of Transformations• In a view of global coordinate system
X
Y
X Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 17: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/17.jpg)
Thinking of Transformations• In a view of global coordinate system
X
Y
2L
X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 18: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/18.jpg)
2
X Y
2L
Thinking of Transformations• In a view of global coordinate system
X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 19: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/19.jpg)
Thinking of Transformations• In a view of global coordinate system
21L
X Y
2L
X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 20: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/20.jpg)
Thinking of Transformations• In a view of global coordinate system
2
11L
X Y
2L
X
Y
100
010
01
100
0cossin
0sincos
100
010
01
100
0cossin
0sincos 2
22
221
11
11
2211
ll
translrottranslrotT
![Page 21: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/21.jpg)
Controlling forward kinematics
• QWOP http://www.foddy.net/Athletics.html
![Page 22: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/22.jpg)
IK solution uniqueness
Images from http://freespace.virgin.net/hugo.elias/models/m_ik.htm
Zero One
Two Many
![Page 23: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/23.jpg)
Inverse kinematics
Given goal position for end effectorCompute internal joint angles
Simple linkages analytic solutionOtherwise numeric iterative solution
![Page 24: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/24.jpg)
Inverse kinematics – spaces
Configuration spaceReachable workspace
![Page 25: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/25.jpg)
Analytic Inverse Kinematics
• Given target position (X,Y)– Compute angle with
respect to origin of linkage– Solve for angle of rotation
for each joint
• See reference text for solution and derivation
![Page 26: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/26.jpg)
IK - numeric
Remember: a pose is the position and orientation of all links for given a set of joint angles
- Compute the desired change from this poseVector to the goal, orMinimal distance between end effector and goal
- Compute set of changes to joint angles to make that change
Solve iteratively – numerically solve for step toward goal
![Page 27: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/27.jpg)
IK math notation
),,,,,(
),,,,,(
),,,,,(
),,,,,(
),,,,,(
),,,,,(
65432166
65432155
65432144
65432133
65432122
65432111
xxxxxxfy
xxxxxxfy
xxxxxxfy
xxxxxxfy
xxxxxxfy
xxxxxxfy
XFY
Given the values for each xi, we can compute each yi
![Page 28: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/28.jpg)
IK – chain rule
dt
x
x
f
dt
x
x
f
dt
x
x
f
dt
x
x
f
dt
x
x
f
dt
dx
x
f
dt
dy iiiiiii 6
6
5
5
4
4
3
3
2
2
1
1
XX
FY
The change in output variables (y) relative to the change in input variables (x)
![Page 29: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/29.jpg)
Inverse Kinematics - Jacobian
JV Desired motion of end effector
Unknown change in articulation variables
The Jacobian is the matrix relating the two: describing how each coordinate changes with respect to each joint angle in our system
XX
FY
![Page 30: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/30.jpg)
Inverse Kinematics - Jacobian
JV zyxzyx vvvV ,,,,, 654321 ,,,,,
61
1
621
zz
y
xxx
p
ppp
J
Change in position
Change in orientation
Jacobian
Change in articulation variables
![Page 31: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/31.jpg)
Solving
VJ
JJJJVJJJ
JJVJ
JV
TTTT
TT
11
If J is not square, use of pseudo-inverse of JacobianIf J square, compute inverse, J-1
VJ
JV1
![Page 32: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/32.jpg)
IK – compute positional change vectors induced by changes in joint angles
Instantaneous positional change vectors
Desired change vector
One approach to IK computes linear combination of change vectors that equal desired vector
![Page 33: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/33.jpg)
IK - singularity
Some singular configurations are not so easily recognizable
![Page 34: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/34.jpg)
Inverse Kinematics - Numeric
Given • Current configuration• Goal position
Determine • Goal vector• Positions & local coordinate systems of interior joints (in global coordinates)
Solve for change in joint angles & take small step – or clamp acceleration or clamp velocity
Repeat until:• Within epsilon of goal• Stuck in some configuration• Taking too long
![Page 35: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/35.jpg)
IK – cyclic coordinate descent
Consider one joint at a time, from outside inAt each joint, choose update that best gets end effector to goal position
In 2D – pretty simple
Heuristic solution
EndEffector
Goal
Ji
axisi
![Page 36: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/36.jpg)
Cyclic-Coordinate Descent- Starting with the root of our effector, R, to our current endpoint, E.- Next, we draw a vector from R to our desired endpoint, D- The inverse cosine of the dot product gives us the angle between the vectors: cos(a) = RD ● RE
![Page 37: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/37.jpg)
Cyclic-Coordinate DescentRotate our link so that RE falls on RD
![Page 38: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/38.jpg)
Cyclic-Coordinate DescentMove one link up the chain, and repeat the process
![Page 39: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/39.jpg)
Cyclic-Coordinate DescentThe process is basically repeated until the root joint is reached. Then the process begins all over again starting with the end effector, and will continue until we are close enough to D for an acceptable solution.
![Page 40: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/40.jpg)
Cyclic-Coordinate Descent
![Page 41: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/41.jpg)
Cyclic-Coordinate DescentWe’ve reached the root. Repeat the process
![Page 42: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/42.jpg)
Cyclic-Coordinate Descent
![Page 43: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/43.jpg)
Cyclic-Coordinate Descent
![Page 44: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/44.jpg)
Cyclic-Coordinate Descent
![Page 45: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/45.jpg)
Cyclic-Coordinate Descent
![Page 46: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/46.jpg)
Cyclic-Coordinate Descent
![Page 47: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/47.jpg)
Cyclic-Coordinate DescentWe’ve reached the root again. Repeat the process until solution reached.
![Page 48: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/48.jpg)
IK – cyclic coordinate descent
Other orderings of processing joints are possible
Because of its procedural nature• Lends itself to enforcing joint limits• Easy to clamp angular velocity
![Page 49: Forward and Inverse Kinematics CSE 3541 Matt Boggus](https://reader034.vdocuments.site/reader034/viewer/2022051415/56649cf85503460f949c90ab/html5/thumbnails/49.jpg)
IK – 3D cyclic coordinate descent
First – goal has to be projected onto plane defined by axis (normal to plane) and EF
EndEffector
Goal
Ji
axisi
Projected goal
Second– determine angle at joint