The Robot Toolbox for Matlab v.1.0

Simulation manipulator motions

The toolbox provides the functions simulating manipulator motions. The first function creates a special panel in the Matlab figure window which allows changing a configuration of the manipulator using a set of controls (each control corresponds to a single configuration variable). To display this panel the following function is used

robot_panel(r)

where: r structure representing a manipulator plotted in the figure window.

The second function enables showing the manipulator realizing the pre-planned trajectory:

r = robot_motion(r, q, delay)

where: r - structure representing a manipulator object; q - matrix containing pre-planned trajectory; delay - pause between animation steps.

Example 1

To use a special panel for interactive communication with the user, first a robot object has to be created. In this example a 3PR manipulator whose DH parameters are given in the table below will be defined.

iαi-1ai-1diθi
100d10
2-π/20d2π/2
3-π/21d30
4001θ4

% workspace
axis([-5, 10, -5, 10, -5, 10])
csys_plot(csys(eye(4), 'CSysAxisLength', axis, 'CSysAxisLabel', {'','',''}));
grid on
camlight
% manipulator
r = robot([dh(0,0,5,0); dh(-pi/2,0,5,pi/2); dh(-pi/2,1,3,0); dh(0,0,1,0)], ['d','d','p','r'], 'RobotBase', rp2t(rotx(-pi/2)*rotz(-pi/2),[0;0;5]),'RobotGrasper', rp2t(roty(-pi/2),[0; 0; 2]), 'RobotGrasperSize', 0.75, 'RobotRange', [0, 10; 1, 10; 0, 5; -pi, pi], 'RobotColor', [0,0.45,0.9], 'RobotExColor', [0,0.75,1], 'RobotCylinderRadius', 0.25, 'RobotCylinderApprox', 16, 'RobotModel', 'rangeex');
r = robot_plot(r, 'surf');
% panel
robot_panel(r);

Manipulator 3PR with special panel

Example 2

The manipulator from Example 1 will be moved from its start configuration [5; 5; 3; 0] to final configuration [1; 5; 3; 0] through intermediate configurations: [4; 5; 3; 0], [3; 5; 3; 0] and [2; 5; 3; 0].

% workspace
axis([-5, 10, -5, 10, -5, 10])
csys_plot(csys(eye(4), 'CSysAxisLength', axis, 'CSysAxisLabel', {'','',''}));
grid on
camlight
% manipulator
r = robot([dh(0,0,5,0); dh(-pi/2,0,5,pi/2); dh(-pi/2,1,3,0); dh(0,0,1,0)], ['d','d','p','r'], 'RobotBase', rp2t(rotx(-pi/2)*rotz(-pi/2),[0;0;5]),'RobotGrasper', rp2t(roty(-pi/2),[0; 0; 2]), 'RobotGrasperSize', 0.75, 'RobotRange', [0, 10; 1, 10; 0, 5; -pi, pi], 'RobotColor', [0,0.45,0.9], 'RobotExColor', [0,0.75,1], 'RobotCylinderRadius', 0.25, 'RobotCylinderApprox', 16, 'RobotModel', 'rangeex');
r = robot_plot(r, 'surf');
% movement through the given configurations
c1 = [5; 5; 3; 0];
c2 = [4; 5; 3; 0];
c3 = [3; 5; 3; 0];
c4 = [2; 5; 3; 0];
c5 = [1; 5; 3; 0];
r = robot_motion(r, [c1 c2 c3 c4 c5], 0.2);

Motions of 3PR manipulator

:: Return ::