Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

EE-381 Robotics-1

UG ELECTIVE

Lecture 𝟑a
Representation and Homogenous
Transformations
Dr. Hafsa Iqbal
Department of Electrical Engineering,
School of Electrical Engineering and Computer Science,
National University of Sciences and Technology,
Pakistan
Example 1
• Consider that the transformations of the belt and of the robot base
with respect to a reference frame {W} are known. The
transformation of the object with respect to the belt, as well as the
transformation of the end effector with respect to the robot base
are also known.
a) Find the pose of the object with respect to the base of the robot
b) Find the pose of the object with respect to the end effector

2
Continue…
• Consider that the transformations of the belt and of the robot base
with respect to a reference frame {W} are known. The
transformation of the object with respect to the belt, as well as the
transformation of the end effector with respect to the robot base
are also known.
a) Find the pose of the object with respect to the base of the robot
b) Find the pose of the object with respect to the end effector

• Solution
• Known transformations: 𝑇𝐹𝑊 , 𝑇𝐵𝑊 , 𝑇𝑂𝐹 , 𝑇𝐸𝐵 ,
a) Desired pose (in terms of the known transformations):𝑇𝑂𝐵
𝑇𝑂𝐵 = 𝑇𝑊𝐵
𝑇𝑂𝑊 = 𝑇𝐵𝑊 −1 𝑇𝐹𝑊 𝑇𝑂𝐹

3
Continue…
b) Desired pose (in terms of the known
transformations):𝑇𝑂𝐸
• Known transformations: 𝑇𝐹𝑊 , 𝑇𝐵𝑊 , 𝑇𝑂𝐹 , 𝑇𝐸𝐵 ,
• 𝑇𝑂𝐸 = 𝑇𝑊𝐸
𝑇𝑂𝑊
• = 𝑇𝐸𝑊 −1 𝑇𝐹𝑊 𝑇𝑂𝐹
−1
𝑊
• = 𝑇𝐵 𝑇𝐸 𝐵
𝑇𝐹𝑊 𝑇𝑂𝐹
• = 𝑇𝐸𝐵 −1 𝑇𝐵𝑊 −1 𝑇𝐹𝑊 𝑇𝑂𝐹

4
Example
• The figure shows a robot whose base
is 1m away from the base of the
table. The table is 1m height and its
surface is a square. Frame {1} is fixed
on a corner of the table. A 20cm cube
is located on the middle of the table,
and it has frame {2} attached to its
center. A camera is located 2 m
above the table, just over the cube,
and it has frame {3} attached to it.
• Find the homogeneous transformations
that relate each of these frames with
the base system {0}
• Find the homogeneous transformations
that relates the cube frame {2} wrt the
camera frame {3}. 𝑥0
Robot Modeling and Control, Chapter 2, problem 37
5
Example
• Solution
a) By inspection, the homogeneous transformations that relate
each of the frames wrt the base frame {0} are:

b) Using the composition of transformations:

6
Orientation in 3D
• Rotation can be represented in different ways such as:
orthonormal rotation matrices, Euler and Cardan angles,
rotation axis and angle, and unit quaternions

• All can be represented as vectors or matrices

7
Orthonormal Rotation Matrix
• We can represent the orientation of a coordinate frame
by its unit vectors expressed in terms of the reference
coordinate frame. Each unit vector has three elements
and they form the columns of a 3 x 3 orthonormal matrix
𝑅𝐵𝐴
𝑥𝐴 𝑥𝐵
𝑦𝐴 = 𝑅𝐵𝐴 𝑦𝐵
𝑧𝐴 𝑧𝐵

• Which transforms the description of a vector defined


with respect to frame {B} to a vector with respect to {A}.

8
Orthonormal Rotation Matrices
• Orthonormal rotation matrices are;

𝑅𝑧0 ,𝜃

𝑅𝑥0 ,𝜃
𝑅𝑦0 ,𝜃

𝑅𝑧,𝜃

9
Euler’s Rotation Theorem
• Euler’s rotation theorem states that any rotation can be
considers as a sequences of rotations about different
coordinate axis

10
Euler’s Rotation Theorem
• Orientation and Pose estimation is not simple. Slight
variation results in posture change

Non-Commutative

11
Three-Angle Representations
• We recall that Euler’s rotation theorem states that any
rotation can be represented by not more than three
rotations about coordinate axis.
• Euler’s rotation theorem requires successive rotation
about three axis such that no two successive rotations
are about the same axis.
• There are two classes of rotation sequence: Eulerian and
Cardanian, named after Euler and Cardano respectively,
• Euler: XYX, XZX,YXY,YZY, ZXZ, or ZYZ
• Cardanian: XYZ, XZY,YZX,YXZ, ZXY, or ZYX

12
Euler’s Angle

• Euler-Angles: Most common sequence: ZYZ

𝑅 = 𝑅𝑧 𝜙 𝑅𝑦 𝜃 𝑅𝑧 (𝜓) or 𝑅 = 𝑅𝑧,𝜙 𝑅𝑦,𝜃 𝑅𝑧,𝜓

The Euler angles are the 3-vector Γ = 𝜙, 𝜃, 𝜓

13
Three-Angle Representations
• Cardan Angles: roll-pitch-yaw sequence as XYZ or ZYX
depending on if it is a mobile robot or a robotic arm.

• Convention for vehicles (ships, aircraft and cars): x-axis


points in the forward direction and z-axis points
z
either up
or down.
y x

-z
• Convention for robot gripper: the z-axis points forward
and the x-axis is either up or down. This leads to the XYZ
angle sequence
14
Roll, Pitch, Yaw Angles
• As we studied following rotation before

𝜓 𝜓
𝜓
𝜓 𝜓

𝜙
𝜙 𝜙
𝑅𝑧,𝜙 𝜙 𝜙
𝜃
𝜓

16
Roll, Pitch, Yaw Angles
• roll-pitch-yaw transformation will be

• Similarly pitch-yaw-roll can also be computed as


𝑅10 = 𝑅𝑦,𝜃 𝑅𝑥,𝜓 𝑅𝑧,𝜙

17
Axis/angle Representation
• Two coordinate frames of arbitrary orientation are
related by a single rotation about some axis in space
• Rotation axis must be unchanged
• Rotation matrix has three eigenvalues
• Rotation axis is given by real value eigenvalue
• Theta is given by complex eigenvalues

𝑘𝑥
𝒌 = 𝑘𝑦
𝑘𝑧
We wish to derive the rotation
matrix representing a rotation
of 𝜃 degrees about the arbitrary
axis.
18
Axis/angle Representation
1. We can rotate 𝑲 into 𝑧0 by first rotating about 𝑧0 by −𝛼
2. Then rotating 𝑲 about 𝑦0 by rotating −𝛽
3. All rotations will be performed relative to the fixed
frame {0}, the resultant rotation matrix will be

axis/angle
representation of 𝑅
19
Axis/angle Representation: Inverse Problem
• An arbitrary rotation matrix with 𝑟𝑖𝑗

Rotation matrix

• The equivalent angle 𝜃

20
Axis/angle Representation: Inverse Problem
• and equivalent axis 𝒌 are given by the expressions

• Limitation: 𝜃 is always in between [0,180]. A rotation of


− 𝜃 about −𝒌 is the same as a rotation of 𝜃 about 𝒌

• Fails if 𝜃 = 0 or 𝜃 = 180.
21
Axis/angle Representation:
• Example: Suppose R is generated by a rotation of
90 degree about 𝑧0 followed by a rotation of 30 degree
about 𝑦0 followed by a rotation of 60 degree 𝑥0 . Then

• Compute theta and arbitrary axis?

22
Quaternions
• It is tuple of 4 real elements 𝑤, 𝜖𝑥 𝑖 + 𝜖𝑦 𝑗 + 𝜖𝑧 𝑘 :
𝑄 = 𝑤 + 𝜖𝑥 𝑖 + 𝜖𝑦 𝑗 + 𝜖𝑧 𝑘
𝑧
𝑄 = 𝑤+𝝐
𝑤 < 𝜖𝑥 , 𝜖𝑦 , 𝜖𝑧 >
𝑘
• Scalar part: 𝑤 Alternative
representation

• Vector part: 𝝐 = 𝜖𝑥 𝑖 + 𝜖𝑦 𝑗 + 𝜖𝑧 𝑘
• They were created by William R. Hamilton as a
generalization of complex number (for 3D) such as:
𝑖 2 = 𝑗 2 = 𝑘 2 = 𝑖𝑗𝑘 = −1
23
Unit Quaternions
• Quaternions with unit norm: 𝑄 = 1
Relation with rotation:
• Unit quaternions represent a rotation of 𝜃 about a unit
axis 𝒓 (rotation axis)
𝜃 𝜃
𝑄 = 𝑤, 𝝐 = 𝑐𝑜𝑠 , 𝒓 𝑠𝑖𝑛
2 2
• Some important properties of unit quaternions are:
• 𝑄−1 = 𝑄∗
• 𝑄1 o 𝑄2 = 1
• Note: in robotics we usually refer to unit quaternions
simply as quaternions
24
Quaternions: Operations
• Consider the following quaternions:
𝑄1 = 𝑤1 , 𝝐1 , 𝑄2 = 𝑤2 , 𝝐2 , 𝑄 = (𝑤, 𝝐)
• Addition: 𝑄1 + 𝑄2 = 𝑤1 + 𝑤2 , 𝝐1 + 𝝐2
(associative and commutative)
• Compounding:
𝑄1 o𝑄2 = 𝑤1 𝑤2 − 𝝐1T 𝝐2 , 𝑤1 𝝐2 + 𝑤2 𝝐1 + 𝝐1 × 𝝐1
Hamilton product
• Conjugate:𝑄 ∗ = 𝑤, −𝝐
2
• Normal 𝑄 : 𝑄 = 𝑤 2 + 𝜖𝑥2 + 𝜖𝑦2 + 𝜖𝑧2 = 𝑄o𝑄 ∗
Norm of a vector

25
Unit Quaternions
• Example:
a) Find the quaternions that represents a rotation of 600 about
1,0,0

b) Find the conjugate and inverse of the previous quaternions 𝑄

26
Unit Quaternions
Application of a rotation 𝑄 to a vector 𝒗:
1. Convert vector 𝒗 to a quaternion (0 scalar component):
𝒗 = 𝟎, 𝒗
2. Apply the rotation 𝑄: 𝒗𝒒𝒓𝒐𝒕 = 𝑸 o 𝒗 o 𝑸∗
3. The rotation vector 𝒗rot is the vector component
𝒗rot = (𝟎, 𝒗𝒓𝒐𝒕 )

27
Unit Quaternions
Example
Find the rotation of point p=(3,5,2) by an angle of 600 about
(1,0,0) (a) using quaternions, (b) using a rotation matrix
Solution
a) Using quaternions

b) Using a rotation matrix

28
Unit Quaternions
• Another representation of orientation is by means of four numbers
called the Euler parameters.
• Sometimes, the Euler parameters are viewed as a 3 × 1 vector
plus a scalar. However, as a 4 × 1 vector, the Euler parameters are
known as a unit quaternion.
𝑇
• In terms of equivalent axis 𝐾 = 𝐾𝑥 𝐾𝑦 𝐾𝑧 and equivalent
angle theta

29
Quaternions
• The rotation matrix 𝑅ϵ that is equivalent to a set of Euler
parameters is

• Given a rotation matrix, the equivalent Euler parameters


are

30
Pose in 3D
• Pose position and orientation

Translation and rotation


• Homogeneous transformation

• Vector + Euler angles

• Vector + roll-pitch-yaw angles

• Vector + Quaternion
31
Skew-Symmetric Matrices
• Nine numbers are enough to describe an orientation?
• A matrix is skew symmetric iff;
𝑆𝑇 + 𝑆 = 0
• A result from linear algebra states that for any
orthonormal matrix R, there exists a skew matrix S such
that;
𝑅 = 𝐼3 − 𝑆 −1 𝐼3 + 𝑆
A skew-symmetric matrix of 3D is specified by three
parameters [𝑠1 , 𝑠2 , 𝑠3 ] as;
0 − 𝑠1 𝑠2
𝑆 = 𝑠1 0 − 𝑠3
−𝑠2 𝑠3 0
32

You might also like