<<

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 Transformation •

Rotation and SO(3) •

Euler and Euler-Like Parameterizations •

Exponential Coordinate of SO(3) •

Quaternion Representation of

Outline Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 2 / 30 Rigid Body Transformation

Object (Body) in R3: a collection of points, represented by a subset O R3 • ⊂

Transformation of a body: A single mapping g : O 3 which maps the • R 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 R3, define → gˆ(v) g(q) g(p), where v = q p , − −

- Note: gˆ 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 : R3 R3 is called a rigid body • transformation if it satisfies the following two properties→ 3 1. Length preserved: g(q) g(p) = q p , for all p, q R k − k k − k ∈

3 2. is preserved: gˆ(v w) =g ˆ(v) gˆ(w), for all v, w R . × × ∈

Implications: • - Inner product is preserved:

T T 3 gˆ(v) gˆ(w) = v w, for all v, w R ∈ - Angles between vectors are preserved

- 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 68 3.2. and Angular Velocities

ˆxb ˆzb

ˆy ˆzs b p

ˆys

ˆxs

Basic Reference Frames:Figure 3.6: Mathematical description of position and orientation. • - Fixed (or )representation Frame of rotations: s is provided= ˆxs by, ˆy thes, exponentialˆzs coordinates, which define an axis of rotation{ and} the{ rotated} about that axis. We leave other popular representations of orientations (the three-parameter Euler an- - Body Framegles: andb the=roll–pitch–yawˆxb, ˆyb, ˆzb angles, the Cayley–Rodrigues parameters, and{ the}unit{ , which} use four variables subject to one constraint) to Appendix B. Let xsb, ysb andWez thensb examinebe the the six-parametercoordinate exponential of ˆxb coordinates, ˆyb, ˆzb forin the frame config- s • uration of a rigid body that arise from integrating a six-dimensional twist con- { } sisting of the body’s angular and linear velocities. This representation follows from the Chasles–Mozzi theorem which states that every rigid-body displace- ment can be obtained by a finite rotation and about a fixed . We conclude with a discussion of and moments. Rather than treat these as separate three-dimensional quantities, we merge the moment and vectors into a six-dimensional wrench. The twist and wrench, and rules for manipulating them, form the for the kinematic and dynamic analyses in subsequent chapters.

Rotation Matrix and SO3.2(3) Rotations andLecture Angular 3 (ECE5463 Velocities Sp18) Wei Zhang(OSU) 6 / 30 3.2.1 Rotation Matrices We argued earlier that, of the nine entries in the rotation matrix R, only three can be chosen independently. We begin by expressing a of six explicit con- straints on the entries of R. Recall that the three columns of R correspond to

May 2017 preprint of Modern Robotics, Lynch and Park, Cambridge U. Press, 2017. http://modernrobotics.org Rotation Matrix

Let R = x y z • sb sb sb sb  

Rsb constructed above is called a rotation matrix. We know: • T - RsbRsb = I

- det(Rsb) = 1

Rotation Matrix and SO(3) Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 7 / 30 Special Orthogonal

Special : Space of Rotation Matrices in n is defined as • R n×n T SO(n) = R R : RR = I, det(R) = 1 { ∈ } SO(n) is a group. We are primarily interested in SO(3) and SO(2), rotation • groups of R3 and R2, 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, for all a G. ∃ ∈ • ∈ - Inverse element: For each a G, there is a b 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 = x y z • ab ab ab ab   Changing the reference frame: • - pa = Rabpb

- Rac = RabRbc

Rotating a vector or a frame: • - Theorem (Euler):Any orientation R SO(3) is equivalent to a rotation about a 3 ∈ fixed axis ωˆ R 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 • Chapter 3. Rigid-Body Motions 75

ˆz ˆz ˆy 90◦

ˆx ˆy ˆx R =Rot(ˆz, 90◦)

ˆzs ˆxb 90◦

ˆzs ˆxb Rsb = RRsb ˆy b fixed frame ˆyb b { } rotation ˆzb b s { } { } ˆxs ˆy s ˆzb 90◦ ˆxb ˆzb Rsb = RsbR b body frame { } rotation ˆzb ˆyb

Figure 3.9: (Top) The rotation R = Rot(ˆz, 90◦) gives the orientation of the right-hand frame in the left-hand frame. (Bottom) On the left are shown a fixed frame s and a body frame b , which can be expressed as Rsb. The quantity RRsb { } { } rotates b by 90◦ about the fixed-frame axis ˆzs to b0 . The quantity RsbR rotates { } { } b by 90◦ about the body-frame axis ˆzb to b00 . Rotation{ } Matrix and SO(3) { } Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 10 / 30

frame after a rotation by θ aboutω ˆb =ω ˆ (the rotation axisω ˆ is considered to be in the body frame b ), representations of these new frames can be calculated as { }

R = rotate by R in s frame (R ) = RR (3.23) sb0 { } sb sb R = rotate by R in b frame (R ) = R R. (3.24) sb00 { } sb sb In other words, premultiplying by R = Rot(ˆω, θ) yields a rotation about an axisω ˆ considered to be in the fixed frame, and postmultiplying by R yields a rotation aboutω ˆ considered as being in the body frame. Rotation by R in the s frame and in the b frame is illustrated in Fig- ure 3.9. { } { } To rotate a vector v, note that there is only one frame involved, the frame

May 2017 preprint of Modern Robotics, Lynch and Park, Cambridge U. Press, 2017. http://modernrobotics.org for SO(3)

How to parameterize the elements in SO(3)? •

The definition of SO(3) corresponds to implicit representation: • 3×3 T R R ,RR = I, det(R) = 1 ∈ . - 6 independent equations with 9 unknowns

- 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 RotationPARAMETERIZATIONS OF ROTATIONS 47

z0, za za

zb zb, z1 φ ψ y1

ya ya, yb yb y0 θ x0 xa xa xb xb x1 (1)(2) (3) Euler angle representation: • Fig. 2.11 Euler angle representation. - Start with b coincident with s degrees-of-freedom{ } and thus at{ most} three quantities are required to specify its orientation. This can be easily seen by examining the constraints that govern - Rotate b about ˆzb by an angle α, then rotate about the (new) ˆyb axis by β, the{ matrices} in SO(3): and then rotate about the (new) ˆzb axis by γ. This yields a net orientation R (α, β, γ) parameterized by the ZYZr2 angles= 1,(α, j β,1 γ,)2, 3 (2.25) sb ij ∈ { } i X r1ir1j + r2ir2j + r3ir3j = 0, i = j (2.26) - Rsb(α, β, γ) = Rz(α)Ry(β)Rz(γ) 6 Equation (2.25) follows from the fact the the columns of a rotation matrix are unit vectors, and Equation (2.26) follows from the fact that columns of a rotation matrix are mutually orthogonal. Together, these constraints define six independent equations with nine unknowns, which implies that there are three Euler Angles Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 13 / 30 free variables. In this section we derive three ways in which an arbitrary rotation can be represented using only three independent quantities: the Euler Angle repre- sentation, the roll-pitch-yaw representation, and the axis/angle representa- tion.

2.5.1 Euler Angles A common method of specifying a rotation matrix in terms of three independent quantities is to use the so-called Euler Angles. Consider the fixed coordinate frame o0x0y0z0 and the rotated frame o1x1y1z1 shown in Figure 2.11. We can specify the orientation of the frame o1x1y1z1 relative to the frame o0x0y0z0 by three angles (φ, θ, ψ), known as Euler Angles, and obtained by three successive rotations as follows: First rotate about the z-axis by the angle φ. Next rotate about the current y-axis by the angle θ. Finally rotate about the current z-axis by the angle ψ. In Figure 2.11, frame oaxayaza represents the new coordinate frame after the rotation by φ, frame obxbybzb represents the new coordinate frame after the rotation by θ, and frame o1x1y1z1 represents the final frame, after the rotation by ψ. Frames oaxayaza and obxbybzb are shown in the figure only to help you visualize the rotations. 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

50 RIGID MOTIONS- ANDYZX HOMOGENEOUS Euler angles TRANSFORMATIONS (Helmholtz angles)

z0

Roll

Yaw y0 Pitch

x0

Fig. 2.12 Roll, pitch, and yaw angles. Euler Angles Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 14 / 30 the fixed frame, the resulting is given by

RXYZ = Rz,φRy,θRx,ψ c s 0 c 0 s 1 0 0 φ − φ θ θ = sφ cφ 0 0 1 0 0 cψ sψ  0 0 1   s 0 c   0 s −c  − θ θ ψ ψ  c c s c +c s s s s +c s c  φ θ − φ ψ φ θ ψ φ ψ φ θ ψ = sφcθ cφcψ + sφsθsψ cφsψ + sφsθcψ (2.39)  s c s − c c  − θ θ ψ θ ψ   Of course, instead of yaw-pitch-roll relative to the fixed frames we could also interpret the above transformation as roll-pitch-yaw, in that order, each taken with respect to the current frame. The end result is the same matrix as in Equation (2.39). The three angles, φ, θ, ψ, can be obtained for a given rotation matrix using a method that is similar to that used to derive the Euler angles above. We leave this as an exercise for the reader.

2.5.3 Axis/Angle Representation Rotations are not always performed about the principal coordinate axes. We are often interested in a rotation about an arbitrary axis in space. This pro- vides both a convenient way to describe rotations, and an alternative parame- T terization for rotation matrices. Let k = (kx, ky, kz) , expressed in the frame o0x0y0z0, be a defining an axis. We wish to derive the rotation matrix R representing a rotation of θ about this axis. k,θ There are several ways in which the matrix R can be derived. Perhaps the k,θ simplest way is to note that the axis define by the vector k is along the z-axis 0 following the rotational transformation R1 = Rz,αRy,β. Therefore, a rotation 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 : • - Every z = x + jy = ρejφ

- 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. •

For any ω Rn, there is a matrix [ω] Rn×n such that ω p = [ω]p • ∈ ∈ × ω 0 ω ω 1 − 3 2 ω = ω2 [ω] = ω3 0 ω1  ω  ↔  ω ω −0  3 − 2 1    

Note that [ω] = [ω]T skew symmetric • − ← [ω] is called a skew- representation of the vector ω •

The set of skew-symmetric matrices in: so(n) S Rn×n : ST = 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 at time t = 0 • 0

Rotate the point with constant unit velocity around fixed axis ω. The motion • is described by

p˙(t) = ω p(t) = [ω]p(t), with p(0) = p × 0

This is a linear ODE with solution: p(t) = e[ˆω]tp • 0

Note p(θ) = Rot(ω, θ)p , therefore • 0 Rot(ω, θ) = e[ω]θ

Exponential Coordinate Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 19 / 30 Find Rotation Rot(ω, θ) via Differential Equation

Exponential Map: By definition • θ2 θ3 e[ω]θ = I + θ[ω] + [ω]2 + [ω]3 + 2! 3! ··· Rodrigues’ Formula: Given any [ω] so(3), we have • ∈ 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 (θ) (corresponding to xθˆ ) • 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 ωˆ R3 with ωˆ = 1 and • ∈ ∈ k k θ R such that R = e[ˆω]θ ∈

- If R = I, then θ = 0 and ωˆ is undefined.

- If tr(R) = 1, then θ = π and set ωˆ equal to one of the following −  r   r   1 + r  1 13 1 12 1 11  r23  ,  1 + r22  ,  r21  p2(1 + r ) p2(1 + r ) p2(1 + r ) 33 1 + r33 22 r32 11 r31

1 1  1 T - Otherwise, θ = cos− (tr(R) 1) [0, π) and [ˆω] = (R R ) 2 − ∈ 2 sin(θ) −

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 R3. A quaternion is a vector quantity of the following form: •

q = q0 + q1i + q2j + q3k

where q0 is the scalar (“real”) component and ~q = (q1, q2, q3) is the vector (“imaginary”) component. Addition and multiplication operations: • - p + q = (p0 + q0) + (p1 + q1)i + (p2 + q2)j + (p3 + q3)k - i2 = j2 = k2 = ijk = 1 − - ij = k = ji, jk = i = kj, ki = j = ik − − − In scalar-vector form, product of p = (p , ~p) and q = (q , ~q) is given by • 0 0 pq = p q ~pT ~q, p ~q + q ~p + ~p ~q 0 0 − 0 0 × 

Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 26 / 30 Conjugate, Norm, and Inverse

Given a quaternion q = (q , ~q): • 0 - Conjugate: q∗ = (q0, ~q) −

2 2 2 2 2 - Norm: q = qq∗ = q∗q = q + q + q + q k k 0 1 2 3

- 1 q∗ Inverse: q− , q 2 k k

Quaternions Lecture 3 (ECE5463 Sp18) Wei Zhang(OSU) 27 / 30 Quaternion Representation of Rotation

For ~v 3, we can associate it with a 0 scalar component to construct a • R purely∈ imaginary quaternion: ˚v = (0,~v) 3 Each quaternion q = (q0, ~q) defines an operation on a vector ~v R : • ∈ L (~v) = Im(q˚vq∗) = (q2 ~q 2)~v + 2(~qT ~v)~q + 2q (~q ~v) q 0 − k k 0 ×

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 • k k ∈ ωˆ R3 such that: ∈ θ θ q = cos 2 , ωˆ sin 2 3 In this case, Lq(~v) is the vector obtained  by rotating  ~v R about the axis ωˆ for θ degree. ∈

Given a unit quaternion q = (q , ~q), we can extract the rotation axis/angle by: • 0 ~q −1 sin(θ/2) if θ = 0 θ = 2 cos (q0), ωˆ = 6 (0 otherwise

L (~v) rotates ~v about ωˆ for θ degree. • q∗ −

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