plot_robot(R,Q, OPTIONS)
size of robot 3D workspace, W = [xmn, xmx ymn ymx zmn zmx]
delay betwen frames for animation (s)
set number of frames per second for display
loop over the trajectory forever
annotation scale factor
color for joint cylinders, C=[r g b]
orthogonal camera view (default)
perspective camera view
wrist axis label is XYZ
wrist axis label is NOA
autoraise the figure (very slow)
controls shaded rendering after drawing
controls display of base "pedestal"
controls display of wrist
controls display of shadow
display the robot"s name
control display of joint axes
controls display of joints
plot_robot(R,Q, options) displays a graphical animation of a robot based on the kinematic model. A stick figure polyline joins the origins of the link coordinate frames. The robot is displayed at the joint angle Q (1xN), or if a matrix (MxN) it is animated as the robot moves along the M-point trajectory.
The options come from 2 sources and are processed in order:
- Struct of options given by the 'plotopt' option when creating the SerialLink object.
- List of arguments in the command line.
Many boolean options can be enabled or disabled with the 'no' prefix. The various option sources can toggle an option, the last value is taken.
Graphical annotations and options:
The robot is displayed as a basic stick figure robot with annotations such as: shadow on the floor, XYZ wrist axes and labels, joint cylinders and axes, which are controlled by options.
The size of the annotations is determined using a simple heuristic from the workspace dimensions. This dimension can be changed by setting the multiplicative scale factor using the 'mag' option.
Figure behaviour:
- If no figure exists one will be created and teh robot drawn in it.
- If no robot of this name is currently displayed then a robot will be drawn in the current figure. If hold is enabled (hold on) then the robot will be added to the current figure.
- If the robot already exists then that graphical model will be found and moved.
If one or more plots of this robot already exist then these will all be moved according to the argument Q. All robots in all windows with the same name will be moved.
Delay betwen frames can be eliminated by setting option 'delay', 0 or 'fps', 0
By default a quite detailed plot is generated, but turning off labels, axes, shadows etc. will speed things up.
The graphical state holds the last joint configuration which can be retrieved using q = robot.plot().