0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 close all;
0021
0022 fprintf('\nThe demo shows how to compute the end effectors speed as a function of the joint speeds')
0023
0024 robot = load_robot('example','scara');
0025
0026 T=1;
0027
0028 q1=0:0.01:pi/2;
0029 q2=0:0.01:pi/2;
0030
0031 q_v=pi/2/T;
0032 V=zeros(3, length(q1));
0033 for i=1:length(q1),
0034 V(:,i) = compute_end_velocity(robot, [q1(i) -q2(i) 0 0], [q_v q_v 0 0]);
0035 end
0036
0037 figure, hold
0038 plot(V(1, :), 'r')
0039 plot(V(2, :), 'g')
0040 plot(V(3, :), 'b')
0041 legend('V_x', 'V_y', 'V_z')
0042 title('End effector speed (m/s)')
0043 xlabel('time (s)')
0044
0045 figure, hold
0046 plot(q1, 'r')
0047 plot(q2, 'g')
0048 legend('q_1', 'q_2')
0049 title('Joint positions (rad)')
0050 xlabel('time (s)')