Lecture 7. Matthew T. Mason. Mechanics of Manipulation. Lecture 7. Representing Rotation. Kinematic representation: goals, overview

Similar documents
3D Tranformations. CS 4620 Lecture 6. Cornell CS4620 Fall 2013 Lecture Steve Marschner (with previous instructors James/Bala)

Physics 235 Chapter 1. Chapter 1 Matrices, Vectors, and Vector Calculus

Rotation Matrices and Homogeneous Transformations

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Vector has a magnitude and a direction. Scalar has a magnitude

Linear Algebra Notes for Marsden and Tromba Vector Calculus

TWO-DIMENSIONAL TRANSFORMATION

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes

Kinematics of Robots. Alba Perez Gracia

Unified Lecture # 4 Vectors

Essential Mathematics for Computer Graphics fast

The Matrix Elements of a 3 3 Orthogonal Matrix Revisited

Vectors VECTOR PRODUCT. Graham S McDonald. A Tutorial Module for learning about the vector product of two vectors. Table of contents Begin Tutorial

Geometric Transformations

Let s first see how precession works in quantitative detail. The system is illustrated below: ...

Mechanics lecture 7 Moment of a force, torque, equilibrium of a body

Lecture 3: Coordinate Systems and Transformations

Geometry of Vectors. 1 Cartesian Coordinates. Carlo Tomasi

Chapter 17. Orthogonal Matrices and Symmetries of Space

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

Lecture 3 SU(2) January 26, Lecture 3

Computing Euler angles from a rotation matrix

Vector surface area Differentials in an OCS

Lecture L5 - Other Coordinate Systems

LS.6 Solution Matrices

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

ab = c a If the coefficients a,b and c are real then either α and β are real or α and β are complex conjugates

A Primer on Index Notation

Inner Product Spaces

F Matrix Calculus F 1

CIS 536/636 Introduction to Computer Graphics. Kansas State University. CIS 536/636 Introduction to Computer Graphics

Vector Math Computer Graphics Scott D. Anderson

State of Stress at Point

Torgerson s Classical MDS derivation: 1: Determining Coordinates from Euclidean Distances

A vector is a directed line segment used to represent a vector quantity.

Inner product. Definition of inner product

Metrics on SO(3) and Inverse Kinematics

Unit 3 (Review of) Language of Stress/Strain Analysis

ME 115(b): Solution to Homework #1

THE COMPLEX EXPONENTIAL FUNCTION

Lecture 5: Singular Value Decomposition SVD (1)

v w is orthogonal to both v and w. the three vectors v, w and v w form a right-handed set of vectors.

Continuous Groups, Lie Groups, and Lie Algebras

Solving Simultaneous Equations and Matrices

Linear algebra and the geometry of quadratic equations. Similarity transformations and orthogonal matrices

Linear Programming. March 14, 2014

28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. v x. u y v z u z v y u y u z. v y v z

5. Orthogonal matrices

Operators and Matrices

Geometric Transformation CS 211A

Trigonometric Functions and Triangles

2 Session Two - Complex Numbers and Vectors

1 VECTOR SPACES AND SUBSPACES

Cross product and determinants (Sect. 12.4) Two main ways to introduce the cross product

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

Linear Algebra: Vectors

Figure 1.1 Vector A and Vector F

1 Vectors: Geometric Approach

The Math Circle, Spring 2004

Matrix Differentiation

Lectures notes on orthogonal matrices (with exercises) Linear Algebra II - Spring 2004 by D. Klain

Chapter 2. Parameterized Curves in R 3

The elements used in commercial codes can be classified in two basic categories:

[1] Diagonal factorization

Rotation and Inter interpolation Using Quaternion Representation

Vector Algebra. Addition: (A + B) + C = A + (B + C) (associative) Subtraction: A B = A + (-B)

Gas Dynamics Prof. T. M. Muruganandam Department of Aerospace Engineering Indian Institute of Technology, Madras. Module No - 12 Lecture No - 25

Lecture 2 Matrix Operations

2D Geometric Transformations

x1 x 2 x 3 y 1 y 2 y 3 x 1 y 2 x 2 y 1 0.

On Motion of Robot End-Effector using the Curvature Theory of Timelike Ruled Surfaces with Timelike Directrix

13.4 THE CROSS PRODUCT

Lecture L6 - Intrinsic Coordinates

Understanding Rotations

α = u v. In other words, Orthogonal Projection

Math 241, Exam 1 Information.

discuss how to describe points, lines and planes in 3 space.

Review A: Vector Analysis

Continued Fractions and the Euclidean Algorithm

Abstract. Introduction

animation animation shape specification as a function of time

Computing Orthonormal Sets in 2D, 3D, and 4D

Linear Algebra Review. Vectors

Lecture L22-2D Rigid Body Dynamics: Work and Energy

Isaac Newton s ( ) Laws of Motion

3 Orthogonal Vectors and Matrices

Given a point cloud, polygon, or sampled parametric curve, we can use transformations for several purposes:

Chapter 9 Unitary Groups and SU(N)

1 Introduction to Matrices

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Rotation about an arbitrary axis and reflection through an arbitrary plane

Differentiation of vectors

1 Symmetries of regular polyhedra

Dr. Fritz Wilhelm, DVC,8/30/2004;4:25 PM E:\Excel files\ch 03 Vector calculations.doc Last printed 8/30/2004 4:25:00 PM

Special Theory of Relativity

MA106 Linear Algebra lecture notes

Review of Vector Analysis in Cartesian Coordinates

MATH2210 Notebook 1 Fall Semester 2016/ MATH2210 Notebook Solving Systems of Linear Equations... 3

Section V.3: Dot Product

Transcription:

Matthew T. Mason Mechanics of Manipulation

Today s outline

Readings, etc. We are starting chapter 3 of the text Lots of stuff online on representing rotations Murray, Li, and Sastry for matrix exponential Roth, Crenshaw, Ohwovoriole, Salamin, all cited in text

Analytic geometry So far, Euclidean geometry. Why? Insight Visualization Economy of expression Now Cartesian, analytic geometry. Why? Beyond 2D, beyond 3D. We need to work with high dimensional configuration spaces! For implementation For additional insight The best of all possible worlds: use both. Understand geometrical or physical meaning for all terms.

Agenda for kinematic representation Following the kinematic agenda: Spherical Spatial Constraints

planar Obvious idea 1 Displacement is rotation or translation Choose a coordinate frame (O, ˆx, ŷ) For rotation, (center, angle), i.e. ((x, y), θ) For translation, ( x, y ) Ugly Obvious idea 2 Given O, displacement is rotation about O; translation Choose a coordinate frame (O, ˆx, ŷ) ( x, y, θ)

What are representations for? Obvious ideas didn t yield homogeneous coordinate transform matrices? We didn t consider all the uses of representations! Uses of representations Communicate with humans and computers Operate on points, lines and stuff Compose Sample, interpolate, average, smooth Differentiate, integrate

Operating on stuff ( x, y, θ) is good for communication. How would you operate on points? Composition? Averaging? Sampling? To operate on points: Represent points by Cartesian coordinates: (x, y) Rotate using rotation matrix Translate using component-wise addition Tidy it up using homogeneous coordinates We will revisit later

Why representing rotations is hard. s do not commute. Vectors are out. For computation we like to represent things with real numbers, so our representations all live in R n. Even though SO(3) is a three-dimensional space, it has the topology of projective three space P 3, which cannot be smoothly mapped to R 3. And, we have lots of different applications, with different requirements: communication, operating on things, composition, interpolation, etc.

Choices Good for communication, geometrical insight Good for operating on stuff, composition, analytical insight Unit quaternions (aka Euler parameters) Good for composition, analytical insight, sampling Good for communication, geometrical insight

Euler s theorem: every spatial rotation has a rotation axis. Let O, ˆn, θ, be... Let rot(ˆn, θ) be the corresponding rotation. Many to one: rot( ˆn, θ) = rot(ˆn, θ) rot(ˆn, θ + 2kπ) = rot(ˆn, θ), for any integer k. So, restrict θ to [0, π]. But not smooth at the edges. When θ = 0, the rotation axis is indeterminate, giving an infinity-to-one mapping. Again you can fix by adopting a convention for ˆn, but result is not smooth. (Or, what about using the product, θˆn? Later.) n

What do we want from axis-angle? Operate on points Compose rotations, average, interpolate, sampling,...? Not using axis-angle Convert to other representations? There aren t any yet. But, later we will use axis-angle big time. It s very close to quaternions.

Others derive using rotation matrices: ugly and messy. The geometrical approach is clean and insightful. Given point x, decompose into components parallel and perpendicular to the rotation axis x = ˆn(ˆn x) ˆn (ˆn x) Only x is affected by the rotation, yielding : n n x n n x n n x x x x = ˆn(ˆn x)+sin θ (ˆn x) cos θ ˆn (ˆn x) O A common variation: x = x+(sin θ) ˆn x+(1 cos θ) ˆn (ˆn x)

Choose O on rotation axis. Choose frame (û 1, û 2, û 3 ). Let (û 1, û 2, û 3 ) be the image of that frame. Write the û i vectors in û i coordinates, and collect them in a matrix: û 1 = û 2 = û 3 = a 11 a 21 a 31 a 12 a 22 a 32 a 13 a 23 a 33 = = = û 1 û 1 û 2 û 1 û 3 û 1 û 1 û 2 û 2 û 2 û 3 û 2 û 1 û 3 û 2 û 3 û 3 û 3 A = ( ) (û a ij = 1 û ) 2 û 3

So many numbers! A rotation matrix has nine numbers, but spatial rotations have only three degrees of freedom, leaving six excess numbers... There are six constraints that hold among the nine numbers. û 1 = û 2 = û 3 = 1 û 3 = û 1 û 2 i.e. the û i are unit vectors forming a right-handed coordinate system. Such matrices are called orthonormal or rotation matrices.

Rotating a point Let (x 1, x 2, x 3 ) be coordinates of x in frame (û 1, û 2, û 3 ). Then x is given by the same coordinates taken in the (û 1, û 2, û 3 ) frame: x =x 1 û 1 + x 2û 2 + x 3û 3 =x 1 Aû 1 + x 2 Aû 2 + x 3 Aû 3 =A(x 1 û 1 + x 2 û 2 + x 3 û 3 ) =Ax So rotating a point is implemented by ordinary matrix multiplication.

Sub- and superscript notation for rotating a point Let A and B be coordinate frames. Let A x be coordinates in frame A. Let B AR be the rotation matrix that rotates frame B to frame A. Then (see previous slide) B AR represents the rotation of the point x: B x = B A R B x Note presuperscripts all match. Both points, and xform, must be written in same coordinate frame.

Coordinate transform There is another use for B A R: A x and B x represent the same point, in frames A and B resp. To transform from A to B: B x = B A R A x For coord xform, matrix subscript and vector superscript cancel. from B to A is the same as coordinate transform from A to B.

Example rotation matrix B A R = ( B x B A y A 1 0 0 B ) z A = 0 0 1 0 1 0 How to remember what B AR does? Pick a coordinate axis and see. The x axis isn t very interesting, so try y: 1 0 0 0 0 1 0 1 0 0 1 0 = 0 0 1

Nice things about rotation matrices Composition of rotations: {R 1 ; R 2 } = R 2 R 1. ({x; y} means do x then do y.) Inverse of rotation matrix is its transpose B A R 1 = A B R = B A RT. Coordinate xform of a rotation matrix: B R = B A R A R A B R

Converting rot(ˆn, θ) to R Ugly way: define frame with ẑ aligned with ˆn, use coordinate xform of previous slide. Keen way:! x = x + (sin θ) ˆn x + (1 cos θ) ˆn (ˆn x) Define cross product matrix N: N = 0 n 3 n 2 n 3 0 n 1 n 2 n 1 0 so that Nx = ˆn x

... using... Substituting the cross product matrix N into : Factoring out x x = x + (sin θ)nx + (1 cos θ)n 2 x R = I + (sin θ)n + (1 cos θ)n 2 That s it! in matrix form. If you want to you could expand it: n2 1 + (1 n2 1 )cθ n 1n 2 (1 cθ) n 3 sθ n 1 n 3 (1 cθ) + n 2 sθ n 1 n 2 (1 cθ) + n 3 sθ n 2 2 + (1 n2 2 )cθ n 2n 3 (1 cθ) n 1 sθ n 1 n 3 (1 cθ) n 2 sθ n 2 n 3 (1 cθ) + n 1 sθ n 2 3 + (1 n2 3 )cθ where cθ = cos θ and sθ = sin θ. Ugly.

for differential rotations Consider for a differential rotation rot(ˆn, dθ). so x =(I + sin dθn + (1 cos dθ)n 2 )x =(I + dθn)x dx =Nx dθ =ˆn x dθ It follows easily that differential rotations are vectors: you can scale them and add them up. We adopt the convention of representing angular velocity by the unit vector ˆn times the angular velocity.

Converting from R to rot(ˆn, θ)... Problem: ˆn isn t defined for θ = 0. We will do it indirectly. Convert R to a unit quaternion (next lecture), then to axis-angle.

Three numbers to describe spatial rotations. ZYZ convention: (α, β, γ) rot(γ, ẑ ) rot(β, ŷ ) rot(α, ẑ) Can we represent an arbitrary rotation? Rotate α about ẑ until ŷ ẑ ; Rotate β about ŷ until ẑ ẑ ; Rotate γ about ẑ until ŷ = ŷ. x z z y Note two choices for ŷ... x... except sometimes infinite choices.

Converting from to rotation matrices notation Define frames {0}, {1}, {2}, {3} so that rot(α, ẑ) maps {0} to {1}, etc., As before i jr is the rotation matrix rotating frame {i} to frame {j}, written in frame {i} coordinates. Let k ( i jr) be the same matrix, written in frame {k} coordinates. Then the correct sequence, written in a common coordinate frame, would be 0 3 R = 0 ( 2 3 R) 0 ( 1 2 R) 0 ( 0 1 R)

Moving frame versus fixed frame Switch to moving frame Use the coordinate transform of a matrix formula: 0 3 R = 0 ( 2 3 R) 0 ( 1 2 R) 0 1 R = ( 0 2 R 2 3 R 2 0 R) (0 1 R 1 2 R 1 0 R) 0 1 R = 0 1 R 1 2 R 2 3 R Wow! You can switch between moving frame and fixed frame, if you also switch the order! You could also have derived the above, just by interpreting 0 3R as a coordinate transform.

From (α, β, γ) to R 0 3 R = 0 1 R 1 2 R 2 3 R cα sα 0 = sα cα 0 0 0 1 = cβ 0 sβ 0 1 0 sβ 0 cβ cγ sγ 0 sγ cγ 0 0 0 1 cα cβ cγ sα sγ cα cβ sγ sα cγ cα sβ sα cβ cγ + cα sγ sα cβ sγ + cα cγ sα sβ sβ cγ sβ sγ cβ

From R to (α, β, γ) the ugly way Case 1: r 33 = 1, β = 0. α γ is indeterminate. cos(α + γ) sin(α + γ) 0 R = sin(α + γ) cos(α + γ) 0 0 0 1 Case 2: r 33 = 1, β = πor π. α + γ is indeterminate. cos(α γ) sin(α γ) 0 R = sin(α γ) cos(α γ) 0 0 0 1 For generic case: solve 3rd column for β. (Sign is free choice.) Solve third column for α and third row for γ.... but there are numerical issues...

From R to (α, β, γ) the clean way Let σ = α + γ δ = α γ Then r 22 + r 11 = cos σ(1 + cos β) r 22 r 11 = cos δ(1 cos β) r 21 + r 12 = sin δ(1 cos β) r 21 r 12 = sin σ(1 + cos β) (No special cases for cos β = ±1?) Solve for σ and δ, then for α and γ, then finally β = tan 1 (r 13 cos α + r 23 sin α, r 33 )

But what about sin β = 0? How can this method work without explicitly addressing the singularity? When β = 0, σ is determined and δ is not. When β = π, δ is determined and σ is not. If your tan 1 handles (0, 0), you can just let it go!