Académique Documents
Professionnel Documents
Culture Documents
Lab 3 Manual
Understanding 3D Spatial Geometry
Student Name
Roll No.
Marks obtained
Date Performed
Instructor Signature
Introduction
In this lab session, the students will use the Robotics Toolbox in MATLAB to understand Position and
Orientation in 2D and 3D space.
Task 2: Pose in 2D
Defining frames
Frames may be defined through transformation matrices. There exists certain shorthand notation to
generate these matrices
x
• transl2(x,y) generates a transformation matrix that represents a pure translation of .
y
• rot2(θ) generates a transformation matrix that represents a pure rotation of θ radians.
• A general transformation matrix may be obtained by combining the pure translations,
e.g.,
x
transl2(x,y) * rot2(θ) generates a transformation matrix that is translated by and ro-
y
tated by θ.
Frames may be visualized using the trplot2 command. For instance trplot2(T1, ’frame’, ’1’,
’color’, ’b’) plots a frame whose transformation matrix is given by T1, assigns it the label {1} and
draws it in blue color.
Exercise 1
1
Plot a frame that is translated by and rotated by 45◦ with respect to the world frame. Name the
2
transformation matrix as T1. Write down the transformation matrix below
Exercise 2
1
On the same window, plot a frame that is translated by and rotated by 0◦ with respect to the
2
world frame. Before plotting, specify the limits of the graph with the command plotvol([0 5 0 5]).
Name the transformation matrix as T2. Write down the transformation matrix below
Exercise 3
Next form two transformations that combine T1 and T2 as follows: T3 = T1*T2 and T4 = T2*T1. Show
that transformation multiplication is non-commutative by plotting the frames described by T3 and T4.
Write down the position of the origin of each frame w.r.t the world frame
Exercise 4
Define P = [2 ; 1 ];. Plot the point with the command plot point(P, ’label’, ’P’, ’solid’,
’ko’);. Obtain the coordinates of P in both frame {1} and frame {4}. Write down the obtained
coordinates and the commands executed to obtain them.
Task 3: Pose in 3D
Explore the following commands used to obtain representations of pose in 3D
• R = rotx(90) rotates 90◦ about x-axis. Similar functions are roty and rotz
• trplot(R) plots a frame rotated by R w.r.t the world frame.
• trainmate(R) plays a movie that animates the rotation R.
• R = angvec2r(θ,~ν ) gives the rotation matrix for rotation about an arbitrary vector ~ν .
• transl(x,y,z) returns a homogeneous transformation that denotes pure translation. For pure
rotations one may use trotx, troty, trotz.
Exercise 5
Download the file “Triple Angle Visualizer App” from the LMS website and install it. Experiment with
the Euler and roll-pitch-yaw angles to see how the orietation of a body changes.
Report filled in
Lab report has been Parts of the report illegible writing with
filled in neatly with not filled in neatly or improper
Lab Report proper grammar and with improper pucntuations or a
(CLO2) scientific terminology grammar casual, non-scientific
tone
Shows the
Validating Shows the obtained graphs/results at
graphs/results at all some of the points Does not show the
results from
points indicated in indicated in the graphs/results at all.
instructor
(CLO2) the manual. manual
Total