View
214
Download
1
Tags:
Embed Size (px)
Citation preview
Robotics, Fall 2006
Lecture 3:Homogenous Transformations
(Translation & Rotation)Copyright © 2005, 2006 Jennifer Kay
Review: Transforming Points Between Coordinate Frames
Simple start: translation along one axis
xw
yw
zw
xr
yr
zr
3 uni ts
Review
We have talked about two concepts. It is extremely important that you do not confuse the two
1. How do we take a point that is in frame j coordinates and convert it to be in frame k coordinates?
2. How do we compute the transformation between frame j and frame k (i.e. how would we move frame j to line it up with frame k)?
Tjk
F jk
Review: General Matrix for Arbitrary Translation Along the X,Y,Z axes
Suppose that to get from frame p to frame q:– Move a units along p’s x axis– Move b units along p’s y axis– Move c units along p’s z axis
To take a point from q coordinatesto p coordinates, premultiply by:
1 0 0 a
0 1 0 b
0 0 1 c
0 0 0 1
Fpq
Tqp
Review
The transformation that takes a point in j coordinates and computes its location in k coordinates.
Easiest way to come up with the matrix: first figure out how to move frame k to frame j.
Fkj
Tjk
Tjk Fk
j=
What about Rotation?
How do we transform the k coordinate frame into the j coordinate frame? (i.e., what is )
xj
yj
zj
(b) the j coordinate frame, shown on its own for clar-ity.
xj
yj
zjzk
xk
yk
(a) the j and k coordinate frames overlaid on each other.
zk
xk
yk
(c) the k coordinate frame, shown on its own for clar-ity.
Fj
k
First: Visually compute the following
Consider the origin of the j axis, (in j coordinates). What is its location in k coordinates?
Consider the point (in j coordinates). What is its location in k coordinates?
xj
yj
zjzk
xk
yk
0 0 0 1T
a b c 1T
Transformation Matrices for Rotations about the Z axis
= Rot z(-90)
Rot z(θ) =
=?
xj
yj
zjzk
xk
yk
Fj
kcos sin– 0 0sin cos 0 0
0 0 1 0
0 0 0 1
Fj
k
0 1 0 0
1– 0 0 0
0 0 1 00 0 0 1
Sanity check: Let’s test our matrix on the examples we did by hand (1)
We said that
xj
yj
zjzk
xk
ykFj
k
0 1 0 0
1– 0 0 0
0 0 1 00 0 0 1
=
=0 0 0 1T
j0 0 0 1
T
k=?
0
0
0
1
0 1 0 0
1– 0 0 0
0 0 1 00 0 0 1
Sanity check: Let’s test our matrix on the examples we did by hand (2)
a b c 1T
j= b a– c 1
T0 1 0 0
1– 0 0 0
0 0 1 00 0 0 1
=?
a
b
c
1
We said that
k
xj
yj
zjzk
xk
ykFj
k
0 1 0 0
1– 0 0 0
0 0 1 00 0 0 1
=
So Where Are We?
Now: We can compute the F (and T) matrices when:
– The two frames only differ by translation along some combination of translations along the x, y, and z axes.
– The two frames only differ by a rotation about one of the z axes.
NEXT– The general case: any combination of rotations and
translations.
Two ways to compute the relationship between two frames
“Moving Axes” Approach “Fixed Axes” Approach
Both approaches give the same result You should learn to do both, because some
problems are easier to solve with moving axes, and others are easier with fixed axes.
Introduction to Solving the General Problem
What sequence of moves do you need to make to compute ? Try it with frame models!
xw
yw
zw
yg
zg
xg
5 units
Fg
w
: Moving Axesxw
yw
zw
yg
zg
xg
5 un its
(Many ways to do it) One approach:
Start in world coordinates
xw
yw
zw
Fwg
xw
yw
zw
yg
zg
xg
5 un its
One approach:
xw
yw
zw
1. Rotate about xw by –90 degrees. Call the resulting frame Frame 1, and its axes x1, y1, z1
x1z1
y1
: Moving AxesFwg
2. Rotate about z1 by –90, call the resulting frame Frame 2, with axes x2, y2, z2
xw
yw
zw
yg
zg
xg
5 un its
One approach:
x1
z1
y1
1. Rotate about xw by –90 degrees. Call the resulting frame Frame 1, and its axes x1, y1, z1
x2
y2
z2
: Moving AxesFwg
2. Rotate about z1 by –90, call the resulting frame Frame 2, with axes x2, y2, z2
xw
yw
zw
yg
zg
xg
5 un its
One approach:
3. Translate by (0,0,5) relative to coord frame 2
x2
y2
z2
1. Rotate about xw by –90 degrees. Call the resulting frame Frame 1, and its axes x1, y1, z1
xg
yg
zg
: Moving AxesFwg
Moving Axes Notes
Every step along the way is based on the resulting frame from the previous step.
– E.g. Rotation 2 is based on frame1’s axes, NOT based on the world axes.
Summary of our moves:1. Rot x (-90)
2. Rot z (-90)
3. Trans (0,0,5)
xw
yw
zw
yg
zg
xg
5 un its
Every move will be relative to the world coordinate frame’s axes.
xw
yw
zw
yg
zg
xg
5 units
: Using Fixed AxesFwg
xw
yw
zw
yg
zg
xg
5 un its
One approach:
xw
yw
zw
1. Rotate about xw by –90 degrees (now we’re yellow).
: Fixed AxesFwg
xw
yw
zw
2. Rotate about yw by –90 degrees (now we’re blue).
xw
yw
zw
yg
zg
xg
5 un its
One approach:
1. Rotate about xw by –90 degrees (now we’re yellow).
: Fixed AxesFwg
xw
yw
zw
yg
zg
xg
5 un its
One approach:
zw
xw
yw
xg
yg
zg
2. Rotate about yw by –90 degrees (now we’re blue).
1. Rotate about xw by –90 degrees (now we’re yellow).
3. Translate by (0,5,0) relative to world coords (now we’re green)
: Fixed AxesFwg
Fixed Axes Notes
Every move is relative to your initial frame
Summary of our moves:1. Rot x (-90)
2. Rot y (-90)
3. Trans (0,5,0)
Moving vs. Fixed
Moving– Each move is relative
to the frame resulting from the previous one
– Summary of our moves:1. Rot x (-90)
2. Rot z (-90)
3. Trans (0,0,5)
Fixed– Each move is done
relative to the original frame
– Summary of our moves:1. Rot x (-90)
2. Rot y (-90)
3. Trans (0,5,0)
So How Do We Get to the Matrix?
A whole pile of equations You do not need to memorize these – in a test
situation, I will give you a copy You can find them on page 16 of your reading You should become comfortable using them
Step 1: The Transformation Equations
Trans (a,b,c) = 1 0 0 a
0 1 0 b
0 0 1 c
0 0 0 1
Rot x (θ) = 1 0 0 0
0 cos sin– 0
0 sin cos 0
0 0 0 1
Rot y (θ) = cos 0 sin 0
0 1 0 0sin– 0 cos 0
0 0 0 1
Rot z (θ) = cos sin– 0 0sin cos 0 0
0 0 1 0
0 0 1
1 0 0 00 0 1 0
0 1– 0 0
0 0 0 1
0 1 0 01– 0 0 0
0 0 1 0
0 0 0 1
1 0 0 00 1 0 0
0 0 1 5
0 0 0 1
0 1 0 00 0 1 5
1 0 0 0
0 0 0 1
=
Using Moving Axes
Rot x (-90) Rot z (-90) Trans (0,0,5)
– Summary of our moves (moving axes):1. Rot x (-90)
2. Rot z (-90)
3. Trans (0,0,5)
1. List the moves from left to right
2. Replace each move with the appropriate matrix
1 0 0 00 0 1 0
0 1– 0 0
0 0 0 1
0 1 0 01– 0 0 0
0 0 1 0
0 0 0 1
1 0 0 00 1 0 0
0 0 1 5
0 0 0 1
0 1 0 00 0 1 5
1 0 0 0
0 0 0 1
=
3. Multiply the matrices together
1 0 0 00 1 0 5
0 0 1 0
0 0 0 1
0 0 1– 00 1 0 0
1 0 0 0
0 0 0 1
1 0 0 00 0 1 0
0 1– 0 0
0 0 0 1
0 1 0 00 0 1 5
1 0 0 0
0 0 0 1
=
Using Fixed Axes
Trans (0,5,0) Rot y (-90) Rot x (-90)
– Summary of our moves (fixed axes):1. Rot x (-90)
2. Rot y (-90)
3. Trans (0,5,0)
1. List the moves from right to left
2. Replace each move with the appropriate matrix
3. Multiply the matrices together
1 0 0 00 1 0 5
0 0 1 0
0 0 0 1
0 0 1– 00 1 0 0
1 0 0 0
0 0 0 1
1 0 0 00 0 1 0
0 1– 0 0
0 0 0 1
0 1 0 00 0 1 5
1 0 0 0
0 0 0 1
=
Fixed Axes: Rotation Warning!E.g.: Rotate w axis –90o about yg
xw
yw
zw
yg
zg
xg
• Think about rigidly locking the frames together as you rotate!
xw
yw
zw
yg
zg
xg
xw
zw
yw
Remember!
Moving Axes– List the equations from left to right
Fixed Axes– List the equations from right to left