You are on page 1of 10

Problem 1: (35 Points) Consider the following pyramid shaped solid object and the 3 frames A,

B, and C assigned at the three base vertices as shown below:

a) (15 Points) Compute the homogenous transforms ABT , CAT , and CBT .
b) (10 Points) Plot the pyramid image in MATLAB and use the results from part (a) and the
trplot function in the Robotics Toolbox to draw the coordinate frames A, B, and C on the
image of the object to verify the results.
c) (10 Points) Using CAT transform from part (a), analytically calculate CAT using the inverse
homogenous transform method derived in the class lecture. Verify using standard
matrix inverse method in MATLAB to compute inverse of the transform and attach the
MATLAB output.

Solution of Part a:

Using trigonometry we can see that base is 3 and perpendicular is 5 so we bet the angle of point A
to B revolution. which is,

tan−1 (5/3)=59.04
X x Y x Zx px
A
B T= [
A
BR P Borg
000 1
A

] [ ]
= X yY y Zy py
X z Y z Zz pz
0 0 0 1

−1 0 0 3 1 0 0 0 −1 0 0 3
A
BT =
[ ][
0 1 0 0
0 0 −1 0
0 0 0 1
0 sin (−59.04 ) cos (−59.04 ) 0
0 0 0
][
0 cos (−59.04 ) −sin (−59.04 ) 0 = 0 0.514 0.857 7 0

1
0 0.857 7 −0.514 0
0 0 0 1
]
1 0 0 3 cos (−45) 0 sin(−45) 0 0.707 0 0.707 3
A
CT =
[
0 cos ( 90 ) −sin ( 90 ) 3 0
][ 1 0
0 sin ( 90 ) cos ( 90 ) 0 −sin(−45) 0 cos(−45) 0
0 0 0 1 0 0 0 1 ][
0 = 0.707 0 −0.707 3
0 1 0 0
0 0 0 1
]
In case of B to C there are angle is revolution equal to complementary angel which is 90-59

04 = 30.96

1 0 0 0 cos(90+ 45) 0 sin(90+ 45) 0 1 0 0 0 −0.707 0 0.707 0


B
CT =
0
[
cos ( 90−59.04

0
) −sin ( 90−59.04

0
) 0 0
][ 1 0
0 sin ( 90−59.04 ) cos ( 90−59.04 ) 3 −sin(90+ 45) 0 cos(90+ 45) 0
0 1 0 0 0
0

1
= 0 0.858

0 0 ][
−0.514 0
][
0 1 0 0
0 0.514 0.858 3 −0.707 0 −0.707 0
0 1 0 0 0 1

Solution of Part b:

MATLAB Code:

point = [ 0 0 0; 3 0 0 ;3 3 0 ; 3 3 5 ];
pyramid = delaunayTriangulation(CornerPoints);
tetramesh(pyramid, 'Facecolor', 'cyan', 'FaceAlpha', 0.5);
% face color to cyan and transparency to 50%
% Set axes limits and labels
axis([0 4 0 4 -1 5]);
xlabel('X');
ylabel('Y');
zlabel('Z');
grid on;
view([57.95 31.96]);
hold on
%Frame A is at the origin
Taa = eye(4);
trplot(Taa, 'frame', 'A', 'color', 'k', 'arrow')
%frames A and B.
Tab = [-1 0 0 3;0 0.5141 0.8577 0; 0 0.8577 -0.5141
0; 0 0 0 1 ];
trplot(Tab, 'frame', 'B', 'color', 'b', 'arrow')
% frames A and C.
Tac = [0.707,0,-0.707,3;-0.707,0,-0.707,3;0,1,0,0;0,0,0,1];
trplot(Tac, 'frame', 'C', 'color', 'r', 'arrow')
hold off

Result

Solution of Part c:

A
R PCorg A
A
C T=
[ C
000 1 ]
A
RT −CA RT ∗PCorg A
C
A T = AC T −1=
[ C
000 1 ]
0.707 0 0.707 3
A
CT =
[
0.707 0 −0.707 3
0 1 0 0
0 0 0 1
]
0.707 0.707 0 3
A
C R= 0
[ 0
] A

[]
1 and PCorg = 3
0.707 −0.707 0 0

So,

0.707 0.707 0 −4.24


C
A T= 0
[ 0 1 0
0.707 −0.707 0 0
0 0 0 1
]
MATLAB reults:

Problem 2: (15 Points) Given


0.25 0.43 0.86 5.0
A
B T= 0.87
[
−0.50 0.00 −4.0
0.43 0.75 −0.50 3.0
0 0 0 1
]
What is the (2, 4) element of BAT ? Use the analytical method to calculate only the required
element. Then use MATLAB to compute inverse of the transform and verify the result. Attach
your MATLAB output.

X x Y x Zx px
A
B T= [
A
BR P Borg
000 1
A

] [ ]
= X yY y Zy py
X z Y z Zz pz
0 0 0 1

X x Y x Z x −P. X
A
B T = ABT −1= [
A
B
000
T
R − R ∗P Borg
1
A
B
T A

] [
= X y Y y Z y −P . Y
X z Y z Z z −P. Z
0 0 0 1
]
So, (2,4) element of ABT Is

5 0.43
A
B T ( 2,4 )=−P . Y =− −4 . −0.5
3 0.75 [ ][ ]
= -{(5.0)(0.43) + (-4.0)(-0.5) + (3.0)(0.75)}
A
B T ( 2,4 )=−6.4

MATLAB Part:
It Is clear from the MATLAB that ABT ( 2,4 )=−6.4
Problem 3: (50 Points) Consider the diagram of figure below. A robot is setup 1.5 m from a
table. The tabletop is 1 m high and 1 m square. A frame {1 } is fixed to the edge of the table as
shown. A cube measuring 20 cm on a side is placed in the center of the table with frame {2 }
established at the center of the cube as shown. A camera is situated directly above the center
of the block 2 m above the table top with frame {3 } attached as shown.

a) (20 Points) Find the homogeneous transforms (01T , 02T , 03T ) relating each of these frames to the
base frame {0}. Find the transform 32T relating the block frame {2 } to the camera frame {3 }.
b) (15 Points) Suppose that the camera is rotated by 90° about Z3 . Represent the rotation by a
homogenous transform and use it to compute the new 03T and 32T transforms.
c) (15 Points) Assume the block on the table is rotated by 90° about Z2 and moved so that
its center coordinates are [ 0.1 , 0.8 ,0.1 ]T relative to the frame {1 }. Represent the
transformation by a homogenous transform and use it to compute the new homogeneous
transform 32T (assuming original frame {3 }) relating the block frame {2 } to the camera
frame {3 } and 02T relating the block frame {2 } to the base frame {0}.

1
1.5 1
Solution of Part a:

1 0 0 −1
0
1
[ ]
T = 0 1 0 1.5
001 1
000 1

now,

1 0 0 −1+0.5 1 0 0−0.5
0
2 T= 0
[
1 0
0 0 1 1+0.1
000 1
][ ]
1.5+0.5 = 010 2
0 0 1 1.1
000 1

as cube is 0.1m above the table, that why 0.1 is added at Pz.

Now,

0 1 0 −1+0.5 0 1 0 −0.5
0
3 T= 1
[
0 0 1.5+0.5
0 0 −1 1+2
00 0 1
][ ]
= 10 0 2
0 0 −1 3
00 0 1

Also, the between {2} and {3} z axis is at 2-0.1 = 1.9 cm. so,

01 0 0
3
2T =
[ ]
10 0 0
0 0 −1 1.9
00 0 1

Also,

1 0 0 0.5
1
2T =
[ ]
0 1 0 0.5
0 0 1 0.1
000 1

So,
1 0 0 −1 1 0 0 0.5 1 0 0 −0.5
0 0
2 1
1
2
[ ][ ] [ ]
T = ¿ T T = 0 1 0 1.5
001 1
000 1
0 1 0 0.5 = 0 1 0 2 ¿
0 0 1 0.1
000 1
0 0 1 1.1
0 00 1

And also,
−1
0 1 0 −0.5 1 0 0 −0.5 01 0 0
3 0 −1 0

[ ][ ][ ]
T = 2 ¿ 3 T 2T = 1 0 0 2
0 0 −1 3
00 0 1
010 2 = 10 0 0 ¿
0 0 1 1.1
000 1
0 0 −1 1.9
00 0 1

Solution of Part b:

As we rotate 90o about Z we get,

0 −1 0 0
3
3
'

[ ]
T= 1 0 0 0
0 0 −1 0
0 0 0 1

So,

0 1 0 −0.5 0 −1 0 0 1 0 0 −0.5
0
3
' T= T T = 1 0 0 2
0
3
3
3
'

0 0−1 3
00 0 1
[ ][ ] [ ]
1 0 0 0 = 0 −1 0 2
0 0 −1 0
0 0 0 1
0 0 1 3
0 0 0 1

−1
0−1 0 0 01 0 0 1 0 0 −2
3
'
3 −1 3
2T = 3 T 2T =
'
1 0 0 0
[ ][ ][ ]
0 0 −1 0
0 0 0 1
1 0 0 0 = 0 1 0 0.5
0 0 −1 1.9
00 0 1
0 0 1 1.1
000 1

Solution of Part c:

First, we perform the transformation that is mentioned in the question and we following result.

1 0 0 0.1−0.5 0 −1 0 0 0 −1 0 −0.4
2
2
'

[
T = 0 1 0 0.8−0.5
0 0 1 0.1−0.1
000 1
][ ] [ ]
1 0 0 0 = 1 0 0 0.3
0 0 10 0 0 1 0
0 0 01 0 0 0 1

Now, calculation of 0 to new 2 transformation and 3 to new 2.


1 0 0−0.5 0 −1 0 −0.4 0 −1 0 −0.9
0
2
T= T T 010 2
'
0
2
2
2
'

[ ][ ] [ ]
0 0 1 1.1
000 1
1 0 0 0.3 = 1 0 0 2.3
0 0 1 0
0 0 0 1
0 0 1 1.1
0 0 0 1

−1
0 1 0 −0.5 0 −1 0 −0.9 1 0 0 0.3
3
2
'
0 −1 0
'

[ ][ ][ ]
T = 3T 2 T = 1 0 0 2
0 0 −1 3
00 0 1
1 0 0 2.3 = 0 1 0 0.4
0 0 1 1.1
0 0 0 1
0 0−1 1.9
00 0 1

You might also like