rotation and orientation - seoul national...
TRANSCRIPT
![Page 1: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/1.jpg)
Rotation and Orientation:Fundamentals
Jehee LeeSeoul National University
![Page 2: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/2.jpg)
What is Rotation ?
• Not intuitive– Formal definitions are also confusing
• Many different ways to describe– Rotation (direction cosine) matrix– Euler angles– Axis-angle– Rotation vector– Helical angles– Unit quaternions
![Page 3: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/3.jpg)
Orientation vs. Rotation
• Rotation– Circular movement
• Orientation– The state of being oriented– Given a coordinate system, the orientation of an
object can be represented as a rotation from a reference pose
• Analogy– (point : vector) is similar to (orientation : rotation)– Both represent a sort of (state : movement)
![Page 4: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/4.jpg)
2D Orientation
0
2p
2p
-
p
p
-or
q
Polar Coordinates
![Page 5: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/5.jpg)
2D Orientation
Although the motion is continuous, its representation could be discontinuous
0
2p
2p
-
p
p
-or
)(tq p
p-
q
Time
![Page 6: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/6.jpg)
2D Orientation
Many-to-one correspondences between 2D orientations and their representations
0
2p
2p
-
p
p
-or
)(tq p
p-
q
Time
![Page 7: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/7.jpg)
Extra Parameter
q
),( yx
X
Y 122 =+ yx
![Page 8: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/8.jpg)
Extra Parameter
q
),( yx
X
Y 122 =+ yx
÷÷ø
öççè
æ -qqqq
cossinsincos
2x2 Rotation matrix is yet another method of using extra parameters
![Page 9: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/9.jpg)
Complex Number
q
iyx +
Real
Imaginary
![Page 10: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/10.jpg)
Complex Exponentiation
q
iyx +
Real
Imaginary
q
qqie
iiyx=
+=+ sincos
![Page 11: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/11.jpg)
Rotation Composition
fqfq iii eee =+ )(
Real
Imaginary
fq +
![Page 12: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/12.jpg)
2D Rotation• Complex numbers are good for representing 2D
orientations, but inadequate for 2D rotations• A complex number cannot distinguish different rotational
movements that result in the same final orientation– Turn 120 degree counter-clockwise– Turn -240 degree clockwise– Turn 480 degree counter-clockwise
Real
Imaginary
q
pq 2-
![Page 13: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/13.jpg)
2D Rotation and Orientation• 2D Rotation
– The consequence of any 2D rotational movement can be uniquely represented by a turning angle
– A turning angle is independent of the choice of the reference orientation
• 2D Orientation– The non-singular parameterization of 2D orientations requires
extra parameters• Eg) Complex numbers, 2x2 rotation matrices
– The parameterization is dependent on the choice of the reference orientation
![Page 14: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/14.jpg)
X
Y
Z
X ¢
Y ¢
Z ¢
3D Rotation
• Given two arbitrary orientations of a rigid object,
How many rotations do we need to transform one
orientation to the other ?
![Page 15: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/15.jpg)
v̂
q
3D Rotation
• Given two arbitrary orientations of a rigid object,
we can always find a fixed axis of rotation and a rotation angle about the axis
![Page 16: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/16.jpg)
Euler’s Rotation Theorem
In other words,• Arbitrary 3D rotation equals to one rotation
around an axis• Any 3D rotation leaves one vector unchanged
The general displacement of a rigid body withone point fixed is a rotation about some axis
Leonhard Euler (1707-1783)
![Page 17: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/17.jpg)
Euler angles• Gimbal
– Hardware implementation of Euler angles
– Aircraft, Camera
![Page 18: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/18.jpg)
Euler Angles
• Rotation about three orthogonal axes– 12 combinations
• XYZ, XYX, XZY, XZX• YZX, YZY, YXZ, YXY• ZXY, ZXZ, ZYX, ZYZ
• Gimbal lock– Coincidence of inner most
and outmost gimbals’ rotation axes
– Loss of degree of freedom
![Page 19: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/19.jpg)
Rotation Vector
• Rotation vector (3 parameters)
• Axis-Angle (2+1 parameters)
v̂
q
),,(ˆ zyx== vv q)ˆ,( vq
anglescalar : runit vecto : ˆ
qv
![Page 20: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/20.jpg)
3D Orientation• Unhappy with three parameters
– Euler angles• Discontinuity (or many-to-one correspondences)• Gimbal lock
– Rotation vector (a.k.a Axis/Angle)• Discontinuity (or many-to-one correspondences)
pp-
![Page 21: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/21.jpg)
Using an Extra Parameter
• Euler parameters
÷øö
çèæ=
úúú
û
ù
êêê
ë
é
÷øö
çèæ=
2sinˆ
2cos
3
2
1
0
q
q
veee
e
axisrotation :ˆ
anglerotation :
v
q
![Page 22: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/22.jpg)
Quaternions
• William Rowan Hamilton (1805-1865)– Algebraic couples (complex number) 1833
iyx + 12 -=iwhere
![Page 23: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/23.jpg)
Quaternions
• William Rowan Hamilton (1805-1865)– Algebraic couples (complex number) 1833
– Quaternions 1843
iyx + 12 -=iwhere
kzjyixw +++
jikikjkjijkiijkkij
ijkkji
-=-=-====-====
,,,,
1222where
![Page 24: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/24.jpg)
Quaternions
William Thomson“… though beautifully ingenious, have been an
unmixed evil to those who have touched them in any way.”
Arthur Cayley“… which contained everything but had to be
unfolded into another form before it could be understood.”
![Page 25: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/25.jpg)
Unit Quaternions
• Unit quaternions represent 3D rotations
),(),,,(
v
q
wzyxw
kzjyixw
==
+++=
12222 =+++ zyxw
3S
![Page 26: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/26.jpg)
v̂
q
Rotation about an Arbitrary Axis
• Rotation about axis by angle
1-=¢ qpqp ),,,0( zyx=pwhere
),,( zyx),,( zyx ¢¢¢
Purely Imaginary Quaternion
v̂ q
÷øö
çèæ=
2sinˆ,
2cos qq vq
![Page 27: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/27.jpg)
Unit Quaternion Algebra
• Identity
• Multiplication
• Inverse
• Unit quaternion space is– closed under multiplication and inverse,– but not closed under addition and subtraction
),(),)(,(
2112212121
221121
vvvvvvvvqq
´++×-==
wwwwww
)/(),,,()/(),,,(
2222
22221
zyxwzyxwzyxwzyxw
+++-=
+++---=-q
)0,0,0,1(=q
![Page 28: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/28.jpg)
Unit Quaternion Algebra
• Antipodal equivalence– q and –q represent the same rotation
– 2-to-1 mapping between S and SO(3)– Twice as fast as in SO(3)
)()( pp qq -= RR
3
![Page 29: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/29.jpg)
Coordinate Free Concepts
• Orientation– Unit quaternions parameterize 3D orientations without
singularity• (Finite) Rotation
– Unit quaternions can represent 3D rotation, but– More convenient to use 3D vectors
• Infinitesimal Rotation– Can be represented by 3D vectors
![Page 30: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/30.jpg)
Tangent Vector(Infinitesimal Rotation)
3SqT
q
![Page 31: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/31.jpg)
Tangent Vector(Infinitesimal Rotation)
3SqT
q
1-q
![Page 32: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/32.jpg)
Tangent Vector(Infinitesimal Rotation)
3SIT),,,( 0001=I
),,,( zyx0
qq !12 -=wAngular Velocity
![Page 33: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/33.jpg)
Exp and Log
log exp
I
)sinˆ,(cos)ˆexp()exp( qqq vvv ==
![Page 34: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/34.jpg)
Exp and Log
log exp
I
)sinˆ,(cos)ˆexp()exp( qqq vvv == ÷øö
çèæ=
úúú
û
ù
êêê
ë
é
÷øö
çèæ=
2sinˆ
2cos
3
2
1
0
q
q
veee
e
Eulerparameters
![Page 35: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/35.jpg)
Rotation Vector
1p
12 ppu -=
2p2q
)( 121
12
pppupp
-+=+=
1q3S3R
![Page 36: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/36.jpg)
Rotation Vector
3S
211 qq-
111 qqI -=
1p
12 ppu -=
2p
)( 121
12
pppupp
-+=+=
3R
![Page 37: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/37.jpg)
Rotation Vector
211 qq-
111 qqI -=
( )( )2111
12
logexp
)exp(
qqqvqq
-=
=
( )211log qqv -=
1p
12 ppu -=
2p
)( 121
12
pppupp
-+=+=
3R
![Page 38: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/38.jpg)
Rotation Vector
• Finite rotation– Eg) Angular displacement– Be careful when you add two rotation vectors
• Infinitesimal rotation– Eg) Instantaneous angular velocity– Addition of angular velocity vectors are meaningful
vuvu eee +¹
![Page 39: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/39.jpg)
Spherical Linear Interpolation
• SLERP [Shoemake 1985]– Linear interpolation of two orientations
tt-1
))(logexp(t
)(),(slerp
2111
211121
qqqqqqqq
-
-
×=
= tt
![Page 40: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/40.jpg)
Spherical Linear Interpolation
))(logexp(t
)(),(slerp
2111
211121
qqqqqqqq
-
-
×=
= tt
![Page 41: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/41.jpg)
Coordinate-Invariant Operations
![Page 42: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/42.jpg)
Adding Rotation Vectors
![Page 43: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/43.jpg)
Analogy
• (point : vector) is similar to (orientation : rotation)
![Page 44: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/44.jpg)
Rotation Matrix vs. Unit Quaternion
• Equivalent in many aspects– Redundant– No singularity– Exp & Log– Special tangent space
• Why quaternions ?– Fewer parameters– Simpler algebra– Easy to fix numerical error
• Why rotation matrices ?– One-to-one correspondence– Handle rotation and translation in a uniform way
• Eg) 4x4 homogeneous matrices
![Page 45: Rotation and Orientation - Seoul National Universitymrl.snu.ac.kr/courses/CourseAnimation/ComputerAnimation... · 2016-11-29 · 2D Rotation and Orientation • 2D Rotation – The](https://reader036.vdocuments.mx/reader036/viewer/2022070706/5e9be72869eadf7a94389232/html5/thumbnails/45.jpg)
Rotation Conversions
• In theory, conversion between any representations is possible
• In practice, conversion is not simple because of different conventions
• Quaternion to Matrix
÷÷÷÷÷
ø
ö
ççççç
è
æ
+--+---+-++---+
=
1000022220222202222
2222000
02222
00
002222
0
zyxxzyyzx
xzyzyxzyx
yzxzyxzyx
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
R