Lab2 1
Lab2 1
Faculty of Engineering
Mechatronics Eng. Department
MT502 - Robotics
>> T = transl(1, 2, 3)
T=
1 0 0 1
0 1 0 2
0 0 1 3
0 0 0 1
3D –Rotation
➢ The functions roty and rotz compute Ry(θ) and Rz(θ) respectively.
➢ The corresponding coordinate frame can be displayed graphically:
>> trplot(R)
➢ We can visualize a rotation more powerfully using the Toolbox function tranimate
which animates a rotation
>> tranimate(R)
Animation
Exercise-2:
➢ Create a function that can be used for 3d -animation?
(a)
tranimate(F1)
show the animation of frame (F1) moving from world frame to pose F1.
(b)
tranimate(F1, F2)
show the animation of frame (F2) moving from frame(F1) to pose F2.
3D –Fixed vs Euler Rotation -Example
ans =
0.0000 0 1.0000
1.0000 0.0000 -0.0000
-0.0000 1.0000 0.0000
3D –Rotation -Example
ans =
0.0000 0 1.0000
1.0000 0.0000 -0.0000
-0.0000 1.0000 0.0000
>> rotz(pi/2)*rotx(pi/2);
>> rotx(pi/2)*roty(pi/2);
>> roty(pi/2)*rotz(pi/2);
Three-Angle Representations
We can think of this expression as representing a walk along the x-axis for 1 unit,
then a rotation by 90°about the x-axis and then a walk of 1 unit along the new y-
axis which was the previous z-axis.
Any Questions ?!
Eng. Yahya AL-Lathi