Vous êtes sur la page 1sur 4

MCT 351: Introdction to Robotics

Lab 3 Manual
Understanding 3D Spatial Geometry

Instructor: Talha Manzoor


Lab Engineer: Usman Qadir

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 1: Installing the Robotics Toolbox


Download the installation file from the LMS course website to a folder on your PC. The file should be in
mltbx format. From within the MATLAB file browser double click on this file, it will install and configure
the paths correctly. In order to check that the toolbox has been installed properly, run rtbdemo. The
Toolbox Demo Window should open up. The demo gives you an idea of what the toolbox can do.

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.

Exercise 6: Animate a Rotating Cube


a) Download the function cube.m from the LMS course website. The function animates the rotation of
a cube along an arbitrary axis for an arbitrary angle.
b) At the indicated location, insert your own code to complete the function.
c) Animate rotation about any axes. Show the result to one of the instructors.
Assessment Rubric for Lab 3
Method of Evaluation: Lab report and instructor observation during Lab Session.
text
Outcomes Assessed:
CLO1: Use modern tools and test equipment to assemble different types of robotic systems and
measure their performance (P).
CLO2: Ability to follow instructions and convey experiment results in an effective manner (A).

Good Satisfactory Unsatisfactory


Performance (4-5) (2-3) (1) Marks

Most tasks completed


Task correctly with some Most tasks either
All tasks completed
Completion incomplete or incomplete or
correctly
(CLO1) incorrect incorrect

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

Vous aimerez peut-être aussi