You are on page 1of 35

EE-381 Robotics-1

UG ELECTIVE

Lecture 𝟐
Dr. Hafsa Iqbal

Department of Electrical Engineering,


School of Electrical Engineering and Computer Science,
National University of Sciences and Technology,
Pakistan
Pose
• How to define the pose of an object in space?
• Pose: combination of position and orientation
• A point in space?

• Coordinate frame/ Cartesian coordinate system?

• A point in space can be defined as.…. combination of unit


vectors….. to the axis of the coordinate system.

2
Pose
• Assumption: Object has rigid body
• Attach the coordinate frame to the object. It enables us
to describe the pose of the object with respect to
reference/universal coordinate frame.
• What should be the required dimension to define the
pose of an object?
𝑦0 𝑦0
axis
point
Coordinate
𝑝1 vector
𝑝1 axis
𝑝1 origin

𝑥0 𝑥0
3
Pose: Position
• Position: we can locate any point in space with 3D
position vector 𝑧0

𝑢 𝑦1
𝑝1 = 𝑣 𝑧1 𝑝1
𝑤 𝑥1
or 𝑥0 𝑦0
𝑝1 = 𝑢𝑥1 + 𝑣𝑦1 + 𝑤𝑧1

4
Pose: Position
• Project the point 𝑝1 on reference frame {0}
𝑥0 𝑢𝑥1 + 𝑣𝑦1 + 𝑤𝑧1 . 𝑥0
𝑝0 = 𝑢𝑥1 + 𝑣𝑦1 + 𝑤𝑧1 . 𝑦0 = 𝑢𝑥1 + 𝑣𝑦1 + 𝑤𝑧1 . 𝑦0
𝑧0 𝑢𝑥1 + 𝑣𝑦1 + 𝑤𝑧1 . 𝑧0
𝑢𝑥1 . 𝑥0 + 𝑣𝑦1 . 𝑥0 + 𝑤𝑧1 . 𝑥0
𝑝0 = 𝑢𝑥1 . 𝑦0 + 𝑣𝑦1 . 𝑦0 + 𝑤𝑧1 . 𝑦0
𝑢𝑥1 . 𝑧0 + 𝑣𝑦1 . 𝑧0 + 𝑤𝑧1 . 𝑧0
𝑥1 . 𝑥0 + 𝑦1 . 𝑥0 + 𝑧1 . 𝑥0 𝑢
𝑝0 = 𝑥1 . 𝑦0 + 𝑦1 . 𝑦0 + 𝑧1 . 𝑦0 𝑣
0
𝑥1 . 𝑧0 + 𝑦1 . 𝑧0 + 𝑧1 . 𝑧0 𝑤
𝑅1 𝑝1
𝑝0 = 𝑅10 𝑝1
5
Pose: Rotation
• To describe the orientation of a body, we attach a
coordinate system to the body and then give a
description of this coordinate system relative to the
reference system.

𝑥𝐵 . 𝑥𝐴 𝑦𝐵 . 𝑥𝐴 𝑧𝐵 . 𝑥𝐴
• 𝑅𝐵𝐴 = 𝑥𝐵 . 𝑦𝐴 𝑦𝐵 . 𝑦𝐴 𝑧𝐵 . 𝑦𝐴
𝑥𝐵 . 𝑧𝐴 𝑦𝐵 . 𝑧𝐴 𝑧𝐵 . 𝑧𝐴

𝑃𝐴

6
Summary: Pose

• Position of point are described with vectors

• Rotation of bodies are described with an attached


coordinate system

7
Frame Description
• The information needed to completely specify the
whereabouts of the manipulator hand is a position and an
orientation
• Position and orientation of frame

𝐵 = 𝑅𝐵𝐴 , 𝑑𝐵𝐴

𝑃𝐴

8
Frame Description
• Compound rotations

9
Homogeneous Representation
• Translation represented by a vector 𝑑
• vector addition
• Rotation represented by a matrix 𝑅
• matrix-matrix and matrix-vector multiplication
• Convenient to have a uniform representation of
translation and rotation
• Obviously vector addition will not work for rotation
• Can we use matrix multiplication to represent
translation?

10
Mappings
Changing descriptions from Frame to Frame

•In robotics, we are concerned with expressing the same


quantity in terms of various reference coordinate systems

• We now consider the mathematics of mapping in order to


change descriptions from frame to frame.

11
Mappings
• Case 𝟏: Mappings involving rotated frames

𝑃 𝐴 = 𝑅𝐵𝐴 𝑃𝐵 𝑃𝐵

12
Mappings
Example: Figure shows a frame {B} that is rotated relative
0.0
to frame {A} about Z by 30 degrees. Given 𝑃𝐵 𝑖𝑠 2.0 ,
0.0
Find 𝑃𝐴 ?
𝑃𝐵
• Solution:
𝑃 𝐴 = 𝑅𝐵𝐴 𝑃𝐵

13
Mappings

• Case 𝟐: Mappings involving translated frame


𝑃𝐴 = 𝑑𝐵𝐴 + 𝑃𝐵

𝑃𝐴 𝑃𝐵

𝑑𝐵𝐴

14
Mappings
• Case 𝟐: Mappings involving general frame

• Very often, we know the description of a vector with


respect to some frame {B}, and we would like to know its
description with respect to another frame, {A}. We now
consider the general case of mapping.

𝑃𝐴 = 𝑅𝐵𝐴 𝑃𝐵 + 𝑑𝐵𝐴

15
Mappings
• 𝑑𝐵𝐴 : origin of frame {B} wrt frame {A}
𝑦𝐵
𝑧𝐴 𝑃 𝑃𝐵
𝑃𝐴

𝑥𝐵
𝑑𝐵𝐴

• Point P of frame {B} in frame {A}: 𝑃 𝐴 = 𝑅𝐵𝐴 𝑃𝐵 + 𝑑𝐵𝐴

16
Mappings
Example: Figure shows a frame {B}, which is rotated
relative to frame {A} about Z by 30 degrees, translated 10
units in 𝑋𝐴 , and translated 5 units in 𝑌𝐴 . Find 𝑃𝐴 , where
𝑃𝐵 = 3.0 7.0 0.0 𝑇 .
• Solution: 𝑃𝐵

𝑃𝐴 = 𝑅𝐵𝐴 𝑃𝐵 + 𝑑𝐵𝐴 𝑃𝐴

𝑑𝐵𝐴

17
Homogeneous Representation
• The compact form of 𝑃 𝐴 = 𝑅𝐵𝐴 𝑃𝐵 + 𝑑𝐵𝐴
𝑃 𝐴 = 𝑅𝐵𝐴 𝑑𝐵𝐴 𝑃𝐵
1 0 1 1
𝑃𝐴 𝑇𝐵𝐴 𝑃𝐵
• 𝑃𝐵 and 𝑃 𝐴 are called homogeneous coordinates
• 𝑇𝐵𝐴 are called Homogeneous transformation
matrix
• It represent the position and orientation (pose) of
a frame with respect to another frame

18
Homogeneous Representation
• It represent the position and orientation (pose) of a frame
with respect to another frame
𝑟11 𝑟12 𝑟13 𝑑𝑥
𝑟21 𝑟22 𝑟23 𝑑𝑦 𝑹 𝒅
𝑇= =
𝑟31 𝑟32 𝑟33 𝑑𝑧 𝟎 1
0 0 0 1
• R can be derived from the perspective of projective
geometry, i.e., dot product
• Pure transformations
𝑹 𝟎 𝑰 𝒅
𝑇= 𝑇=
𝟎 1 𝟎 1
Pure rotation Pure translation
19
Pure transformations
Pure rotation transformations
1 0 0 0
0 cos 𝜃 − 𝑠𝑖𝑛𝜃 0
𝑅𝑜𝑡𝑥 𝜃 =
0 𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃 0
0 0 0 1
𝑐𝑜𝑠𝜃 0 𝑠𝑖𝑛𝜃 0
0 1 0 0
𝑅𝑜𝑡𝑦 𝜃 =
−𝑠𝑖𝑛𝜃 0 𝑐𝑜𝑠𝜃 0
0 0 0 1
𝑐𝑜𝑠𝜃 − 𝑠𝑖𝑛𝜃 0 0
𝑠𝑖𝑛𝜃 cos 𝜃 0 0
𝑅𝑜𝑡𝑧 𝜃 =
0 0 1 0
0 0 0 1
20
Pure Transformations
Pure translation transformations
1 0 0 𝑑
0 1 0 0
𝑇𝑟𝑎𝑛𝑠𝑥 𝑑 =
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 𝑑
𝑇𝑟𝑎𝑛𝑠𝑦 𝑑 =
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
𝑇𝑟𝑎𝑛𝑠𝑧 𝑑 =
0 0 1 𝑑
0 0 0 1
21
Composition
• Composition of transformations
• When a transformation is applied with respect to the
fixed frame:
• A pre-multiplication is used
• When a transformation is applied with respect to the
mobile frame (current new)
• A post-multiplication is used

22
Example 1
• A frame {A} is rotated 90𝑜 about x-axis, and then it is
translated a vector (6, −2,10) with respect to the fixed
(initial) frame. Find the homogeneous transformation
that describes {B} with respect to {A}.
• Solution
𝑇𝐵𝐴 = 𝑇𝑟𝑎𝑛𝑠 6, −2,10 𝑅𝑜𝑡𝑥 (90𝑜 )
pre-multiplication

23
Example 2
• Find the homogeneous transformations matrix that
represents a rotation of an angle 𝛼 about the 𝑥 −axis,
followed by a translation of 𝑏 units along the new 𝑥-axis,
followed by a translation of 𝑑 units along the new 𝑧-axis,
followed by a rotation of an angle 𝜃 about the new z-axis
• Solution
𝑇𝐵𝐴 = 𝑅𝑜𝑡𝑥 (𝛼)𝑇𝑟𝑎𝑛𝑠𝑥 𝑏 𝑇𝑟𝑎𝑛𝑠𝑧 𝑑 𝑅𝑜𝑡𝑧 (𝜃)
post-multiplication

24
Composition
• Decomposition in pure transformations
• Any homogeneous transformation can be decomposed in 2
components:
𝐴 𝐴 𝑹 0 𝑰 𝑑
𝑇= 𝑅 𝐵 𝑑 𝐵 =
0 1 𝟎 1 𝟎 1
• Interpretation of the (de)composition of T
1. Interpretation 1: (post-multiplication) (moving frame)
• First, it applies a translation of 𝒅 units
• Then it applies a rotation 𝑹 with respect to the new frame
2. Interpretation 2:(pre-multiplication) (rigid frame)
• First, it applies a rotation 𝑹
• Then it applies a translation of 𝒅 units with respect to the fixed
(initial) frame

25
Advantages
• Homogeneous transformation represent the pose
(position + orientation) of a frame with respect to
another frame
• It change the reference frame in which a point is
represented (using a linear relation):
𝑃 𝐴 = 𝑇𝐵𝐴 𝑃𝐵
• Note: the point must be represented using homogeneous
coordinates (its notation uses)
• It apply a transformation (rotation + translation) to a
point in the same reference frame

26
Example 2
• A frame {A} is rotated 90𝑜 about 𝑥, and then it is
translated a vector (6, −2,10) with respect to the fixed
(initial) frame. Consider a point 𝑃 = (−5,2, −12) with
respect to the new frame {B}. Determine the coordinates
of that point with respect to the initial frame.
Solution pre-multiplication
• Homogeneous transformation
𝑇𝐵𝐴 = 𝑇𝑟𝑎𝑛𝑠 6, −2,10 𝑅𝑜𝑡𝑥 (900 )

• Point after transformation ? 𝑃 𝐴 = 𝑇𝐵𝐴 𝑃𝐵


28
Example 3
• A frame {A} is translated a vector (6, −2,10) and then it is
rotated 90𝑜 about 𝑥-axis of the fixed (initial) frame.
Consider a point 𝑃 = (−5,2, −12) with respect to the
new frame {B}. Find the coordinates of that point with
respect to the initial frame.
Solution pre-multiplication
• Homogeneous transformation
𝑇𝐵𝐴 = 𝑅𝑜𝑡𝑥 (900 )𝑇𝑟𝑎𝑛𝑠 6, −2,10

• Transformed point? 𝑃 𝐴 = 𝑇𝐵𝐴 𝑃𝐵


29
Inverse Transformation
• Inverse of a homogeneous transformation:
𝑇
𝑇=
𝑹 𝒅 −1
𝑇 = 𝑹 − 𝑅𝑇 𝒅
𝟎 1 𝟎 1
Why?
B
𝐴 𝐵 Solve for 𝑃
𝑃𝐴= d𝐵𝐴 + 𝐑𝐵 𝑃 𝑃B = (𝑅𝐵𝐴 )𝑇 𝑃A − d𝐵𝐴 (𝑅𝐵𝐴 )𝑇
Solve for 𝑃B
𝑃 𝐴 = 𝑇𝐵𝐴 𝑃B 𝑃B = (𝑇𝐵𝐴 )−1 𝑃 𝐴 = 𝑇𝐴𝐵 𝑃 𝐴

Note that (𝑇𝐵𝐴 )−1 = 𝑇𝐴𝐵

• Product of homogeneous transformations:

𝑹1 𝒅𝟏 𝑹 𝒅𝟐 𝑹1 𝑹2 𝑹𝟏 𝒅𝟐 + 𝒅𝟏
𝑇1 = , 𝑇2 = 2 𝑇1 𝑇2 =
𝟎 1 𝟎 1 𝟎 1
30
Compound Transformations
Example: A frame {A} is translated a vector (6, −2,10) and
then it is rotated 90𝑜 about 𝑥-axis of the fixed (initial)
frame. Thus, we have a description of 𝑇𝐵𝐴 . Find, 𝑇𝐴𝐵
Solution
• Homogeneous transformation
𝑇𝐵𝐴 = 𝑅𝑜𝑡𝑥 (900 )𝑇𝑟𝑎𝑛𝑠 6, −2,10

• 𝑇𝐴𝐵 ?
(𝑇𝐵𝐴 )−1 = 𝑇𝐴𝐵

31
Compound Transformations
• Given 𝑃𝐶 , we wish to find 𝑃𝐴
𝑃𝐶
𝑃𝐴

𝑃𝐵 = 𝑇𝐶𝐵 𝑃𝐶
𝑃𝐴 = 𝑇𝐵𝐴 𝑃𝐵
Combining two equations
𝑃𝐴 = 𝑇𝐵𝐴 𝑇𝐶𝐵 𝑃𝐶
We could define
𝑇𝐶𝐴 = 𝑇𝐵𝐴 𝑇𝐶𝐵
32
Transforming Equations
• We can express frame {D} as product of different transformations
in different ways
• 𝑇𝐷𝑈 = 𝑇𝐴𝑈 𝑇𝐷𝐴
• 𝑇𝐷𝑈 = 𝑇𝐵𝑈 𝑇𝐶𝐵 𝑇𝐷𝐶
Equate both equations
• 𝑇𝐵𝑈 𝑇𝐶𝐵 𝑇𝐷𝐶 = 𝑇𝐴𝑈 𝑇𝐷𝐴

• It can be used to find


unknown transforms.
For example 𝑇𝐶𝐵
𝐵 𝑈 −1 𝑈 𝐴 −1
𝑇𝐶 = 𝑇𝐵 𝑇𝐴 𝑇𝐷 𝑇𝐷𝐶

33
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

34
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 𝑇𝐹𝑊 𝑇𝑂𝐹

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

36

You might also like