Robotics Toolbox: Display all DH link frames in Seriallink.plot()

I am using the Robotics Toolbox by Peter Corke to create a plot of a simple four-link robot. For an assignment, I want a figure of the robot with all frames according to the DH-convention. Though even after reading through the documentation and googling for an hour, I couldn't find an option.

Seriallink.plot(...) offers the options 'jaxis' and 'jvec', though they only display the joint axes, not the complete xyz-frame per link.

How can I get a plot of a robot with all DH frames included?

If this is not possible, is there any other way to quickly render such a plot from a DH table? I am almost tempted to do it on paper after already wasting so much time on such an easy task.

2 Answers

The easiest way to do this would be to use the trplot function (documented for v9 at http://www.petercorke.com/RTB/r9/html/trplot.html). You can simply call this function with the transformation matrices for each link and it will add frame axes in those locations.

And the forward kinematics function has a second output argument which is an array of the transforms for each frame. The following code will do what you want:

p560.plot(qz)
[T,A] = p560.fkine(qz);
hold on
for i=1:6
trplot(A(i), 'frame', num2str(i))
end