Practice your MATLAB by doing the following exercises. To do this, you can explore some helpful functions in the Robotics Toolbox. Learn how to use rotz() to build the necessary 3x3 rotation matrix. Type help rotz to find out how to use it. Also, learn about trplot() and tranimate(). What do you think tranimate is doing?
Assume {0} to be the base frame. Create a transformation matrix that represents {1} that is located at P10=[5 5 5]' (P of {1} wrt {0} with a rotation about the Z axis of 45 degrees. Using trplot (), as described in the course notes, render a plot of {0} in blue and {1} in red. Copy plot to a Word document and include T {1} wrt {0}.
Add {2} that is located at P21 (i.e. P of {2} wrt {1} not frame {0} = [3 2 1] and a rotation of 90 degrees about the Z axis wrt {1}. Do this by creating T21, T of {2} wrt {1}. Plot {2} on the plot that contains {1} and {0}. To do this : Create a new transformation matrix T20 that defines {2} wrt {0}. Hint: You can multiply transformation matrices to create combined matrices. Use this new matrix with P10 and show that the new {2} is the same as the old {2}.
Use trplot() to view the transformation of {2} if we assume that it started at T00 and moved to T20. Now experiment with Robotics Toolbox function tranimate()
Find the transformation matrix T02, i.e. T defining {0} with respect to {2}. Learn how to compute the inverse of T20 to get this. Verify that this works by using tranimate to view the movement of frame {2} at T20 to T02*T20
REMEMBER TO USE axis([xmin xmax ymin ymax zmin zmax]) and hold on.