<< plot_options SerialLink rne >>

Robotics_Toolbox >> Robotics_Toolbox > SerialLink > plot_robot

plot_robot

Calling Sequence

plot_robot(R,Q, OPTIONS)

Options

"workspace", W :

size of robot 3D workspace, W = [xmn, xmx ymn ymx zmn zmx]

"delay", d :

delay betwen frames for animation (s)

"fps",fps :

set number of frames per second for display

"[no]loop" :

loop over the trajectory forever

"mag", scale :

annotation scale factor

"cylinder", C :

color for joint cylinders, C=[r g b]

"ortho" :

orthogonal camera view (default)

"perspective" :

perspective camera view

"xyz" :

wrist axis label is XYZ

"noa" :

wrist axis label is NOA

"[no]raise" :

autoraise the figure (very slow)

"[no]render" :

controls shaded rendering after drawing

"[no]base" :

controls display of base "pedestal"

"[no]wrist" :

controls display of wrist

"[no]shadow" :

controls display of shadow

"[no]name" :

display the robot"s name

"[no]jaxes" :

control display of joint axes

"[no]joints" :

controls display of joints

Description

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.

Multiple views of the same robot

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.

//Create a robot in figure 1
mdl_puma560;
handle_1 = scf(1)
handle_1.tag = "Robot"
plot_robot(p560,qz);
//Create a robot in figure 2
handle_2 = scf(2)
handle_2.tag = "Robot"
plot_robot(p560,qz);
//Now move both robots
plot_robot(p560,qn);

Multiple robots in the same figure:

//Multiple robots in the same figure:

//Create a robot in figure 1
mdl_puma560;
plot_robot(p560,qz);
//Make a clone of the robot named bob and translate it
bob = SerialLink(p560, 'name', 'bob');
bob.base = transl(0, 0.5, -0.5);
//Draw bob in this figure using hold option
plot_robot(bob,qn, 'hold')

//To animate both robots so they move together:
qtg = jtraj(qready, qz, 100);
for q=qtg'
plot_robot(p560,q');
plot_robot(bob,q');
end

Notes

See also

Authors


Report an issue
<< plot_options SerialLink rne >>