Upload
emerald-daniel
View
227
Download
0
Tags:
Embed Size (px)
Citation preview
3D Kinematics
Consists of two parts 3D rotation 3D translation
The same as 2D
3D rotation is more complicated than 2D rotation (restricted to z-axis)Next, we will focus on the spatial (3D) rotation
2D (rigid body) kinematicsC.M. translation and rotation
Fall 2012 1
3D Rotation Representations
Euler anglesAxis-angle3X3 rotation matrixUnit quaternion
Learning Objectives Representation
(uniqueness) Perform rotation Composition Interpolation Conversion among
representations …
Fall 2012 2
Euler Angles
Specify orientation in rotation along 3 axesVariation: which axes? global or local?
Fall 2012 3
Write a program …
From Mason’s book
Fall 2012 4
Euler AnglesRoll, pitch, yaw
Ref: http://www.fho-emden.de/~hoffmann/gimbal09082002.pdf
Gimbal lock: reduced DOF due to overlapping axes
Why gimbal lock a problem?
Fall 2012 5
Axis-Angle Representation
Rot(n,) n: rotation axis (global) : rotation angle (rad. or deg.) follow right-handed rule
Rot(n,)=Rot (-n,-)Problem with null rotation: rot(n,0), any nPerform rotation Rodrigues formula
Interpolation/Composition: poor Rot(n2,2)Rot(n1,1) =?= Rot(n3,3)
Fall 2012 6
Rodrigues Formula
v’=R v
r
v
v’
References:
http://mesh.caltech.edu/ee148/notes/rotations.pdf
http://www.cs.berkeley.edu/~ug/slide/pipeline/assignments/as5/rotation.htmlFall 2012 7
Rotation Matrix
Meaning of three columnsPerform rotation: linear algebraComposition: trivial orthogonalization
might be required due to FP errors
Interpolation: ?
Ax
uAxuAxuAx
uxuxuxx
uuuaA ij
ˆˆˆ
ˆˆˆ
ˆˆˆ
332211
332211
321
xRRxRRxRx
xRx
12122
1
Fall 2012 8
Gram-Schmidt Orthogonalization
If 3x3 rotation matrix no longer orthonormal, metric properties might change!
321321 ˆˆˆˆˆˆ vvvuuu
222
231
11
1333
111
1222
11
ˆˆˆ
ˆˆˆ
ˆˆ
ˆˆˆˆ
ˆˆˆ
ˆˆˆˆ
ˆˆ
vvv
vuv
vv
vuuv
vvv
vuuv
uv
Verify!
Fall 2012 9
Quaternion
A mathematical entity invented by HamiltonDefinition
jikki
ikjjk
kjiij
kji
qqkqjqiqqq
1222
03210
i
j k
Fall 2012 10
Quaternion (cont)
Operators Addition
Multiplication
Conjugate
Length
kqpjqpiqpqpqp
kqjqiqqq
kpjpippp
33221100
3210
3210
qpqppqqpqppq 0000
qqq 0
* *** pqpq
23
22
21
20
* qqqqqqq Fall 2012 11
Unit Quaternion
Define unit quaternion as follows to represent rotation
Example Rot(z,90°)
q and –q represent the same rotation
nqn ˆsincos),ˆ(Rot 22 1q
22
22 00q
Why “unit”?
DOF point of view!
Fall 2012 12
quaternion→axis-angle
Fall 2012 13
22
22 00 q
),ˆ(Rot,,,
ˆsincos),ˆ(Rot
3210
22
nqqqq
nqn
2
42
22
2
22
2
cos
sin
1,0,0
n
2
42
22
2
22
2
cos
sin
1,0,0
n
22
22 00 q
225
42
22
2
22
2
2
cos
sin
1,0,0
n
223
42
22
2
22
2
2
cos
sin
1,0,0
n
Use both values of sine and cosine to determine the
angle!!
Ex: q and –q are the same!
Fall 2012 14
60,30,cos,sin,1,0,0ˆ
00
223
221
2
21
23
n
q
60301802,30180,cos,sin,1,0,0ˆ
00
223
221
2
21
23
n
q
Example
x
y
z
x
y
z
22
22 00q
100
001
010
Rot (90, 0,0,1) OR Rot (-90,0,0,-1)
Fall 2012 15
Unit Quaternion (cont)
Perform Rotation
Composition
Interpolation Linear Spherical linear
)(22)(
...
020
*
xqqxqqxqqq
qxqx
****
*
)()( qpxqpqpxpqqxqx
pxpx
)(
)(,)1()( 21
tp
tpptppttp
Fall 2012 16
Example
x
y,x’
z,z’
y’
1
2
1
1
1
2
100
001
010
100
001
010
Rpp
R
Rot(z,90°)Rot(z,90°)
p(2,1,1)
Fall 2012 17
Example (cont)
1
2
1
1
0
0
0
2
1
)(0
0
2
112
002
1
1
2
)(
)(22)(
22
22
22
22
21
21
020
kji
pqqpqqpqqqp
2
222 00
1120
q
p
Fall 2012 18
Example
x
y,x’
z,z’
y’
)00()001(sincos
)00()100(sincos
22
22
290
290
2
22
22
290
290
1
q
q
x,x’
y
z,y’z’
)(
)00()00(
00
00
)00()00(
)00)(00(
:nCompositio
21
21
21
21
22
22
22
22
22
22
22
22
22
22
22
22
22
22
12
kji
Fall 2012 19
Matrix Conversion
23
22
21
2010322031
103223
22
21
203021
2031302123
22
21
20
)(2)(2
)(2)(2
)(2)(2
qqqqqqqqqqqq
qqqqqqqqqqqq
qqqqqqqqqqqq
R
100
001
010
00 22
22
3210
R
qqqqq
Fall 2012 20
Matrix Conversion (cont)
33221123
33221122
33221121
33221120
14
1
14
1
14
1
14
1
rrrq
rrrq
rrrq
rrrq
32234
132
311341
31
211241
21
122141
30
311341
20
233241
10
rrqq
rrqq
rrqq
rrqq
rrqq
rrqq
Find largest qi2; solve the rest
Fall 2012 21
Slerp (Spherical Linear Interpolation)
33221100cos
sin
sin
sin
)1(sin)(
rqrqrqrq
rt
qt
ts
The computed rotation quaternion rotates about a fixed axis at constant speed
References:http://www.gamedev.net/reference/articles/article1095.asphttp://www.diku.dk/research-groups/image/teaching/Studentprojects/Quaternion/http://www.sjbrown.co.uk/quaternions.htmlhttp://www.theory.org/software/qfa/writeup/node12.html
q
r
unit sphere in R4
Fall 2012 22
Spatial Displacement
Any displacement can be decomposed into a rotation followed by a translationMatrix
Quaternion
TxxdR
Tz
y
x
x
dRxx
10
,
1
dqxqx *
Fall 2012 23
Write a program …
From Mason’s book
Fall 2012 24
y
z
x
x’’’
y’’’
z’’’
Fall 2012 25
Fall 2012 26
From previous page
Fall 2012 27
3323131 ,sincostan rrr
From Lee and Koh (1995)
Euler angles in ASF
In v’=Mv convention
Fall 2012 28
,,,,,, xRotyRotzRotzRotyRotxRot
,,
,,,,,,
xRotzRot
zRotzRotxRotzRotzRotxRot