Matlab——KUKA机器人

%建立KR10_R1100_sixx机器人
%       theta    d        a        alpha     offset
L1=Link([0       0.4      0.025    pi/2      0     ]);
L2=Link([pi/2    0        0.56     0         0     ]);
L3=Link([0       0        0.035    pi/2      0     ]);
L4=Link([0       0.515    0        pi/2      0     ]);
L5=Link([pi      0        0        pi/2      0     ]);
L6=Link([0       0.08     0        0         0     ]);
KR10_R1100_sixx=SerialLink([L1 L2 L3 L4 L5 L6],'name','KR10 R1100 sixx');
KR10_R1100_sixx.plot([0,pi/2,0,0,pi,0]);

%3D图形仿真
T1=trotx(180,'deg')*transl(0.5,0,0);
T2=trotx(180,'deg')*transl(0,0.5,0);
q1=KR10_R1100_sixx.ikine(T1);
q2=KR10_R1100_sixx.ikine(T2);

%五次多项式轨迹

[q ,qd, qdd]=jtraj(q1,q2,50); 


KR10_R1100_sixx.plot(q);
grid on
% KR10_R1100_sixx.teach
% KR10_R1100_sixx.fkine([pi/4,pi/2,pi/8,pi/2,7*pi/6,pi/2])


%显示末端执行器轨迹
hold on
T=KR10_R1100_sixx.fkine(q);
plot3(squeeze(T(1,4,:)),squeeze(T(2,4,:)),squeeze(T(3,4,:)))
hold on
KR10_R1100_sixx.plot(q)
figure;

%显示每个关节的 角度位移,角速度,角加速度 曲线
hold on;
t=[0:0.01:4];

subplot(3,1,1);
plot(q);
xlabel( 'Time(s)');
ylabel( '角度位移(rad)');
grid on;

subplot(3,1,2);
plot(qd); 
xlabel('Time(s)');
ylabel('角速度(rad/s)');
grid on;

subplot(3,1,3);
plot(qdd);
xlabel('Time(s)'); 
ylabel('角加速度(rad/s^2)');
grid on;

subplot(3,2,2);
i=1:6;
plot(q(:,i));
title('位置');
grid on;
subplot(3,2,4);
i=1:6;
plot(qd(:,i));
title('速度');
grid on;
subplot(3,2,6);
i=1:6;
plot(qdd(:,i));
title('加速度');

grid on;

Matlab——KUKA机器人


Matlab——KUKA机器人


示教: KR10_R1100_sixx.teach

Matlab——KUKA机器人