Assignment 1
Assignment 1
1. The following MATLAB function generates the homogenous transformation for translation of d along
axis
function T=Trans(axis, distance)
%Homogenous transformation along "axis" for the amount of "distance"
axis=upper(axis);
if (axis == 'X')
T=[1 0 0 distance; 0 1 0 0; 0 0 1 0; 0 0 0 1];
end
if (axis == 'Y')
T=[1 0 0 0; 0 1 0 distance; 0 0 1 0; 0 0 0 1];
end
if (axis =='Z')
T=[1 0 0 0; 0 1 0 0; 0 0 1 distance; 0 0 0 1];
end
2. Write a similar function that performs homogenous rotation about axis for angle
function R=Rot(axis, angle)
3. Write a MATLAB function that finds the location of the end-effector (last link) with respect to a fixed
frame as a function of 1, 2 , and d. Show your notations and frame assignments (follow the Denavit-
Hartenberg convention) on the following figure and submit along with your MATLAB code.