CH2 Spatial_Representations_I
CH2 Spatial_Representations_I
- Topic 2 -
Spatial Representations of
Rigid Bodies (Part I)
Prof. Oscar E. Ramos, Ph.D.
- Week 1 -
Outline
1. Introduction
4. Rotation Matrix
End effector
{E}
object
{O}
{F}
conveyor
belt
{B}
base
3
Introduction
Where is the Mobile Robot?
https://www.nasa.gov/images/content/482680main_PIA09201-full.jpg 4
Introduction
Where are the Aerial Robots?
{R3} {R1}
{R2}
{I}
inertial
5
Introduction
How to interpret the sensor data?
{R}
{I} {S}
sensor
robot
Image from: Kuindersma et al. Optimization-based Locomotion Planning, Estimation, and Control Design for the Atlas Humanoid Robot,
Autonomous Robots, July 2015 6
Introduction
… And a Humanoid Robot?
{Hl}
• The position and orientation of {Wr}
these parts with respect to a {Hr}
reference frame is obtained
{Fl}
{I} {Fr}
1. Introduction
4. Rotation Matrix
ẑ
P
OP
ŷ
O
x̂
9
Position of a Rigid Body
1. Cartesian coordinates
ẑ
P
x
z
ŷ p y
x
z
x̂
y
2. Cylindrical coordinates
ẑ x cos
P
y sin
Relation with
z ŷ p Cartesian
coordinates
z x2 y 2
atan2( y, x)
x̂
10
Position of a Rigid Body
3. Spherical coordinates
ẑ
P with:
r
r 0
p 0 2
ŷ r0
x̂
1. Introduction
4. Rotation Matrix
Relation
ẑ
between frames
{W}
ŷ
O
x̂
13
Orientation of a Rigid Body
• In general:
- Orientation is not as straight-forward as position
- The problem is the topology of the space that describes the orientation (it is
not Euclidean)
• Example:
Description of the surface of a
2-D sphere in the 3-D space
• Representations of orientation:
- Rotation matrix (implicit representation)
• Exponential coordinates
- Parameterizations
• Axis/angle representation: 3 parameters (minimal)
• Roll, Pitch, Yaw angles: 3 parameters (minimal)
• Euler angles: 3 parameters (minimal)
• Quaternions: 4 parameters (implicit representation)
14
Outline
1. Introduction
4. Rotation Matrix
- In vector form …
17
Rotation Matrix
Generic Rotation Matrix
- Matrix R is:
T
B
RA RB
A
19
Rotation Matrix
Generic Rotation Matrix
• Example 1:
Given the following
frames {A} and {B} …
• Example 2: obtain the rotation of frame {B} with respect to frame {A}
• Example 3: given the following rotation, plot frames {A} and {B}
0 1 0
A
RB 0 0 1
1 0 0
21
Rotation Matrix
Generic Rotation Matrix
• Example 4:
There is a table, and on the table there is a
cube. There is a camera over the center of the
cube and its frame is {3}. Find the rotation
matrix that relates frame {2} to the camera
frame {3}
0 1 0
3
R2 1 0 0
0 0 1
1. Introduction
4. Rotation Matrix
R is an orthogonal matrix
25
Properties of a Rotation Matrix
3 constraints
3 constraints
6 constraints
• R has 9 elements
• R has 6 constraints (due to the orthonormal columns)
• R has 9 – 6 = 3 degrees of freedom (only 3 dof for orientation)
26
Properties of a Rotation Matrix
RT R I det( RT R) det( I )
det( RT ) det( R ) 1 Property: det( RT ) det( R)
2
det( R) 1
det( R ) 1
z Right-handed frame:
In a right-handed frame (normally used):
x y z
yz x
y
det( R ) 1 zx y
x
x1 y1 z1
det( R ) x1 ( y2 z3 y3 z2 ) x2 ( y1 z3 y3 z1 ) x3 ( y1 z2 y2 z1 )
R x2 y2 z2
x3 y3 z3 x12 x2 2 x32 1
In a right-handed frame: y z ( y2 z3 y3 z2 , z1 y3 y1 z3 , y1 z2 z1 y2 ) ( x1 , x2 , x3 )
27
Rotation Group: SO(3)
• SO = Special Orthogonal
- Orthogonal matrices
- Special because the determinant is +1 (positive)
• SO(3)
- It represents rotations of rigid bodies
- It is a mathematical formalism (a Lie group)
28
Properties of a Rotation Matrix
• Example 1
Do the following matrices represent rotation matrices?
a) 1 3 b) 1 3
0 0
2 2 2 2
R1 0 1 0 R2 0 1 0
3 0
1 3 0
1
2 2 2 2
Solution
a) 1
det R1 It is not a rotation matrix
2
b) det R2 1
It is a rotation matrix
R2 R2T I
29
Properties of a Rotation Matrix
• Example 2
The following matrix is a rotation matrix. a) Compute its inverse, b) Verify that
it is a rotation matrix, c) Compute its transpose
Solution
a) Since it is a rotation matrix, its transpose is its inverse. Thus the inverse is:
30
Outline
1. Introduction
4. Rotation Matrix
4.1. Main Properties and SO(3)
:
• Interpretation 1: Represents frame {B} in terms of frame {A}
32
Interpretations of the Rotation Matrix
b) Mapping between frames
- We want: start with point in {B} and represent it in {A} (obtain the coordinates in {A})
33
Interpretations of the Rotation Matrix
b) Mapping between frames
- Objective: start with point in {B} and represent it in {A} (obtain the coordinates in {A})
- In matrix form:
34
Interpretations of the Rotation Matrix
b) Mapping between frames
Example
a) Determine by inspection the coordinates of
point P in frame B
d2 d1 P
B
p d1
0
d2
b) Starting with point P in frame B, determine
its coordinates in frame A
0 1 0
- Rotation matrix: A
RB 1 0 0
0 0 1
0 1 0 d 2 d1
- Transformed point: A
p A RB B p 1 0 0 d1 d 2
0 0 1 0 0
35
Interpretations of the Rotation Matrix
c) Rotation Operator
- Example:
Find the resulting vector after rotating vector p1 = (0, 3, 1) an angle 30°
about axis x
0
1 0 0 1 0
R(30, x) 0 cos(30) sin(30) 0 3
2
1
2
0 sin(30) cos(30) 0 1 3
2 2
0
p 2 R (30, x)p1 1
3
36
Outline
1. Introduction
4. Rotation Matrix
4.1. Main Properties and SO(3)
• Relations:
A
- Point from frame {B} to frame {A}: p A RB B p
B
- Point from frame {C} to frame {B}: p B RC C p
- Point from frame {C} in frame {A}: A
p A RB B RC C p
• Composition of rotations:
A
RC A RB B RC
Interpretations of ARC:
1) It rotates point P from {C} to {B} and then from {B} to {A}
2) It starts with frame {A}, then makes it coincident with {B}, and then with {C}
38
Composition of Rotations
a) Rotation with Respect to the Current (mobile) System
• Example 1
Initial frame: {0}
1º: Rotate θ1 about axis y0: Ry(θ1) → we obtain frame {1}
2º: Rotate θ2 about axis z1 (of the current system {1}): Rz(θ2) → we obtain
frame {2}
Resulting rotation: R = Ry(θ1) Rz(θ2)
1° z0 2° Final: z0
z1 z2 z1 y2 z2 y2
y1 2
y1
y0 y0
1
x0 x2 x0 Ry (1 ) Rz ( 2 )
x1 Ry (1 ) x1 Rz ( 2 ) x2
39
Composition of Rotations
b) Rotation with Respect to the Fixed Frame
• Example 2
Initial frame: {0}
1º: Rotate θ1 about frame y0: Ry(θ1) → we obtain frame {1}
2º: Rotate θ2 about frame z0 (of the initial, fixed {0}): Rz(θ2) → we obtain
frame {2}
Resulting rotation: R = Rz(θ2) Ry(θ1)
1° z0 2° z0
z1 2
z2 y2
y1
y0 y0
1
x0 x0
x1 Ry (1 ) x2 Rz ( 2 )
40
Composition of Rotations
Example 3
Consider the following rigid body
Ry (90)
a) current y
R Rz (90) Ry (90)
Rz (90)
R Ry (90) Rz (90)
Ry (90)
b) fixed y
Images from B. Siciliano et al, Robotics Modelling, Planning and Control, 2009 41
Composition of Rotations
Example 4
Consider the following rigid body
Rz (90)
a) current z
R Ry (90) Rz (90)
Ry (90)
R Rz (90) Ry (90)
Rz (90)
b) fixed z
Images from B. Siciliano et al, Robotics Modelling, Planning and Control, 2009 42
Composition of Rotations
Example 5
We apply the following rotations to a reference frame in the following order:
1. Rotation of θ about the current x axis
2. Rotation of ϕ about the current z axis
3. Rotation of α about the fixed z axis
4. Rotation of β about the current y axis
5. Rotation of γ about the fixed x axis
Write the expression of the resulting rotation matrix
Rx ( )
Rx ( ) Rz ( )
Rz ( ) Rx ( ) Rz ( )
Rz ( ) Rx ( ) Rz ( ) Ry ( )
R Rx ( ) Rz ( ) Rx ( ) Rz ( ) Ry ( )
43
References
• Murray, Richard. M., Li, Z., Sastry, S. S., & Sastry, S. S. A Mathematical
Introduction to Robotic Manipulation. CRC press, 1994 (Chapter 2.1)
44