IRDYn/test_kinematics.m

28 lines
1.2 KiB
Matlab

mdh = 1;
if mdh==1
% theta d a alpha offset
L1=Link('revolute', 'd', 0, 'a', 0, 'alpha', 0, 'offset',0,'qlim',deg2rad([-20,40]),'modified');
L2=Link('revolute', 'd', 0, 'a', 1, 'alpha', 0, 'offset',0,'qlim',deg2rad([-20,45]),'modified');
L3=Link('revolute', 'd', 0, 'a', 1, 'alpha', 0, 'offset',0,'qlim',deg2rad([-20,45]),'modified');
Two_bar=SerialLink([L1 L2 L3],'name','Two_bar'); %连接连杆
Two_bar.teach();
% Two_bar.plot([0 0])%机械臂图
else
% theta d a alpha offset
L1=Link('revolute', 'd', 0, 'a', 1, 'alpha', 0, 'offset',0,'qlim',deg2rad([-20,40]),'standard');
L2=Link('revolute', 'd', 0, 'a', 1, 'alpha', 0, 'offset',0,'qlim',deg2rad([-20,45]),'standard');
Two_bar=SerialLink([L1 L2],'name','Two_bar'); %连接连杆
% Two_bar.plot([0 0])%机械臂图
Two_bar.teach();
end
% a = [0, -0.42500, -0.39225, 0, 0, 0];
% d = [0.0892, 0, 0, 0.10915, 0.09465, 0.0823];
% alpha = [1.570796327, 0, 0, 1.570796327, -1.570796327, 0];
% for i = 1:6
% L(i)=Link([0 d(i) a(i) alpha(i)]);
% L(i).qlim=[-2*pi,2*pi];
% end
% UR5=SerialLink(L,'name','UR5');
% UR5.teach();