ECE5463: Introduction to Robotics Lecture Note 3: Rotational Motion Prof. Wei Zhang Department of Electrical and Computer Engineering Ohio State University Columbus, Ohio, USA Spring 2018 Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 1 / 30
Outline Mathematics of Rigid Body Transformation Rotation Matrix and SO(3) Euler Angles and Euler-Like Parameterizations Exponential Coordinate of SO(3) Quaternion Representation of Rotation Outline Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 2 / 30
Rigid Body Transformation Object (Body) in R 3 : a collection of points, represented by a subset O R 3 Transformation of a body: A single mapping g : O R 3 which maps the coordinates of points in the body from their initial to final configurations. Transformation on points induce an action on vectors in a natural way. Given a transformation g : O R 3,define ĝ(v) g(q) g(p), where v = q p - Note: ĝ has a different domain than g Rigid Body Transformation Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 3 / 30
Rigid Body Transformation Rigid Body Transformation: A mapping g : R 3 R 3 is called a rigid body transformation if it satisfies the following two properties 1. Length preserved: g(q) g(p) = q p, forallp, q R 3 2. Cross product is preserved: ĝ(v w) =ĝ(v) ĝ(w), forallv, w R 3. Implications: - Inner product is preserved: - Angles between vectors are preserved ĝ(v) T ĝ(w) =v T w, for all v, w R 3 - Orthogonal vectors are transformed to orthogonal vectors - Right-handed coordinate frames are transformed to right-handed coordinate frames Rigid Body Transformation Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 4 / 30
Outline Mathematics of Rigid Body Transformation Rotation Matrix and SO(3) Euler Angles and Euler-Like Parameterizations Exponential Coordinate of SO(3) Quaternion Representation of Rotation Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 5 / 30
Representation of Orientation ˆx b ẑ b ẑ s p ŷ b ŷ s ˆx s Basic Reference Frames: - Fixed (or Space) Frame: {s} = {ˆx s, ŷ s, ẑ s } - Body Frame:{b} ={ˆx b, ŷ b, ẑ b } Let x sb, y sb and z sb bethecoordinateofˆx b, ŷ b, ẑ b in frame {s} Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 6 / 30
Rotation Matrix Let R sb = [ x sb y sb z sb ] R sb constructed above is called a rotation matrix. Weknow: - R T sbr sb = I - det(r sb )=1 Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 7 / 30
Special Orthogonal Group Special Orthogonal Group: Space of Rotation Matrices in R n is defined as SO(n) ={R R n n : RR T = I,det(R) =1} SO(n) is a group. We are primarily interested in SO(3) and SO(2), rotation groups of R 3 and R 2, respectively. Group is a set G, together with an operation, satisfying the following group axioms: - Closure: a G, b G a b G - Associativity: (a b) c = a (b c), a, b, c G - Identity element: e G such that e a = a, foralla G. - Inverse element: For each a G, thereisab G such that a b = b a = e, where e is the identity element. Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 8 / 30
Use of Rotation Matrix Representing an orientation: R ab = [ x ab y ab z ab ] Changingg the reference frame: - p a = R ab p b - R ac = R ab R bc Rotating a vector or a frame: - Theorem (Euler):Any orientation R SO(3) is equivalent to a rotation about a fixed axis ˆω R 3 through an angle θ [0, 2π) R =Rot(ˆω, θ) Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 9 / 30
Pre-multiplication vs. Post-multiplication Given R SO(3), we can always find ˆω and θ such that R =Rot(ˆω, θ). Premultiplying by R yields a rotation about an axis ˆω considered in the fixed frame; Postmultiplying by R yields a rotation about ˆω considered in the body frame ẑ 90 ẑ ŷ ˆx ŷ ˆx R =Rot(ẑ, 90 ) ẑ s 90 ˆx b ˆx s ẑ s {s} ŷ s ŷ b ẑ b ˆx b {b} R sb = RR sb fixed frame rotation ẑ b 90 R sb = R sb R body frame rotation ŷ b ˆx b ẑ b {b } {b } ŷ b ẑ b Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 10 / 30
Coordinate System for SO(3) How to parameterize the elements in SO(3)? The definition of SO(3) corresponds to implicit representation: R R 3 3,RR T = I,det(R) =1. - 6 independent equations with 9 unknowns - Dimension of SO(3) is 3. Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 11 / 30
Outline Mathematics of Rigid Body Transformation Rotation Matrix and SO(3) Euler Angles and Euler-Like Parameterizations Exponential Coordinate of SO(3) Quaternion Representation of Rotation Euler Angles Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 12 / 30
Euler Angle Representation of Rotation z 0, z a z a φ z b z b, z 1 ψ y 1 y a y a, y b y b x 0 y 0 x x θ a a x b x b x 1 Euler angle representation: - Start with {b} coincident with {s} - Rotate {b} about ẑ b by an angle α, then rotate about the (new) ŷ b axis by β, and then rotate about the (new) ẑ b axis by γ. This yields a net orientation R sb (α, β, γ) parameterized by the ZYZ angles (α, β, γ) - R sb (α, β, γ) =R z (α)r y (β)r z (γ) Euler Angles Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 13 / 30
Other Euler-Like Parameterizations Other types of Euler angle parameterization can be devised using different ordered sets of rotation axes Common choices include: - ZYX Euler angles: also called Fick angles or yaw, pitch and roll angles - YZX Euler angles (Helmholtz angles) z 0 Roll Yaw y 0 Pitch x 0 Euler Angles Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 14 / 30
Examples of Euler-Like Representations Euler Angles Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 15 / 30
Outline Mathematics of Rigid Body Transformation Rotation Matrix and SO(3) Euler Angles and Euler-Like Parameterizations Exponential Coordinate of SO(3) Quaternion Representation of Rotation Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 16 / 30
Towards Exponential Coordinate of SO(3) Recall the polar coordinate system of the complex plane: - Every complex number z = x + jy = ρe jφ - Cartesian coordinate (x, y) polar coorindate (ρ, φ) - For some applications, the polar coordinate is preferred due to its geometric meaning. For any rotation matrix R SO(3), it turned out R = e [ˆω]θ - ˆω: unit vector representing the axis of rotation - θ: the degree of rotation - ˆωθ is called the exponential coordinate for SO(3). Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 17 / 30
Skew Symmetric Matrices Recall that cross product is a special linear transformation. n For any ω R n, there is a matrix [ω] R n n such that ω p =[ω]p ω 1 0 ω 3 ω 2 ω = ω 2 [ω] = ω 3 0 ω 1 ω 3 ω 2 ω 1 0 Note that [ω] = [ω] T skew symmetric [ω] is called a skew-symmetric matrix representation of the vector ω The set of skew-symmetric matrices in: so(n) {S R n n : S T = S} We are interested in case n =2, 3 Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 18 / 30
Find Rotation Rot(ω, θ) via Differential Equation Consider a point p with coordinate p 0 at time t =0 Rotate the point with constant unit velocity around fixed axis ω. Themotion is described by ṗ(t) =ω p(t) =[ω]p(t), with p(0) = p 0 This is a linear ODE with solution: p(t) =e [ˆω]t p 0 Note p(θ) =Rot(ω, θ)p 0, therefore Rot(ω, θ) =e [ω]θ Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 19 / 30
Find Rotation Rot(ω, θ) via Differential Equation Exponential Map: By definition e [ω]θ = I + θ[ω]+ θ2 2! [ω]2 + θ3 3! [ω]3 + Rodrigues Formula: Givenany[ω] so(3), wehave e [ω]θ = I +[ω]sin(θ)+[ω] 2 (1 cos(θ)) Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 20 / 30
Find Rotation Rot(ω, θ) via Differential Equation Proposition: For any unit vector [ˆω] so(3) and any θ R, e [ˆω]θ SO(3) Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 21 / 30
Examples of Forward Exponential Map Rotation matrix R x (θ) (corresponding to ˆxθ) Rotation matrix corresponding to (1, 0, 1) T Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 22 / 30
Logarithm of Rotations Proposition: For any R SO(3), there exists ˆω R 3 with ˆω =1and θ R such that R = e [ˆω]θ - If R = I, thenθ =0and ˆω is undefined. - If tr(r) = 1, thenθ = π and set ˆω equal to one of the following 1 2(1 + r33 ) r 13 r 23 1+r 33, 1 2(1 + r22 ) r 12 1+r 22 r 32, 1 2(1 + r11 ) 1+r 11 r 21 r 31 - Otherwise, θ =cos 1 ( 1 2 (tr(r) 1)) [0,π) and [ˆω] = 1 2sin(θ) (R RT ) Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 23 / 30
Exponential Coordinate of SO(3) exp: [ˆω]θ so(3) R SO(3) log: R SO(3) [ˆω]θ so(3) The vector ˆωθ is called the exponential coordinate for R The exponential coordinates are also called the canonical coordinates of the rotation group SO(3) Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 24 / 30
Outline Mathematics of Rigid Body Transformation Rotation Matrix and SO(3) Euler Angles and Euler-Like Parameterizations Exponential Coordinate of SO(3) Quaternion Representation of Rotation Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 25 / 30
Quaternions Quaternions generalize complex numbers and can be used to effectively represent rotations in R 3. A quaternion is a vector quantity of the following form: q = q 0 + q 1 i + q 2 j + q 3 k where q 0 is the scalar ( real ) component and q =(q 1,q 2,q 3 ) is the vector ( imaginary ) component. Addition and multiplication operations: - p + q =(p 0 + q 0 )+(p 1 + q 1 )i +(p 2 + q 2 )j +(p 3 + q 3 )k - i 2 = j 2 = k 2 = ijk = 1 - ij = k = ji, jk = i = kj, ki = j = ik In scalar-vector form, product of p =(p 0, p) and q =(q 0, q) is given by pq = ( p 0 q 0 p T q, p 0 q + q 0 p + p q ) Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 26 / 30
Conjugate, Norm, and Inverse Given a quaternion q =(q 0, q): - Conjugate: q =(q 0, q) - Norm: q 2 = qq = q q = q 2 0 + q 2 1 + q 2 2 + q 2 3 - Inverse: q 1 q q 2 Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 27 / 30
Quaternion Representation of Rotation For v R 3, we can associate it with a 0 scalar component to construct a purely imaginary quaternion: v =(0, v) Each quaternion q =(q 0, q) defines an operation on a vector v R 3 : L q ( v) =Im(q vqm )=(q 0 2 q 2 ) v +2( q T v) q +2q 0 ( q v) Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 28 / 30
Quaternion Representation of Rotation Unit quaternion: If q =1, we can always find θ [0, 2π) and unit vector ˆω R 3 such that: q = ( cos ( ( θ 2), ˆω sin θ )) 2 In this case, L q ( v) is the vector obtained by rotating v R 3 about the axis ˆω for θ degree. Given a unit quaternion q =(q 0, q), we can extract the rotation axis/angle by: θ =2cos 1 (q 0 ), ˆω = { q sin(θ/2) if θ 0 0 otherwise L q ( v) rotates v about ˆω for θ degree. Quaternion provides global parameterization of SO(3), which does not suffer from singularities Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 29 / 30
Examples of Quaternions Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 30 / 30