六軸可視化機械臂仿真(三維模型導入matlab)
代碼如下
clear,clc,close all
L(1) = Link( 'd', 0.122, 'a' , 0 , 'alpha', pi/2,'offset',0);
L(2) = Link( 'd', 0.019 , 'a' ,0.408 , 'alpha', 0,'offset',pi/2);
L(3) = Link( 'd', 0 , 'a' , 0.3759 , 'alpha',0,'offset',0);
L(4) = Link( 'd', 0.1023, 'a' , 0 , 'alpha', -pi/2 ,'offset',pi/2);
L(5) = Link( 'd', -0.1023 , 'a' , 0 , 'alpha',pi/2,'offset',pi);
L(6) = Link( 'd', -0.25281 , 'a' , 0 , 'alpha',0,'offset',0);
robot = SerialLink(L,'name','六軸機械臂'); %建立連桿機器
robot.display;
%定義圓弧軌跡
x=-0.75;y=-0.25;z=0;%中心點
r=0.28;%
q1=-50*(pi/180);q2=60*(pi/180);
i=q1:(q2-q1)/50:q2;
y1=x+r*sin(i);
x1=ones(1,51)*y;
z1=z+r*cos(i);
hold on
plot3(x1,y1,z1)
for i=1:length(x1)
T(:,:,i)=transl([x1(i),y1(i),z1(i)])*trotx(-(50-i)*(pi/300));
end
q=robot.ikunc(T);
plot3(x1,y1,z1)
% robot.plot(q)
%% 繪制末端位置與運動仿真
% w=[-1000,+700,-700,+700,0,+1000]*0.001;'workspace',w,
plot3(x1,y1,z1)
hold on
% view(120,20)
robot.plot3d(q,'tilesize',0.1,'view',[120,20],'path',...
'E:\Project tasks_unfinished2\機械臂stl文件\','nowrist')
hold on
plot3(x1,y1,z1)
axis equal


完整代碼+stl模型見付費鏈接、或者仿真源代碼下載可聯系扣扣2386317960
以下內容為付費內容,請購買后觀看
六軸可視化機械臂仿真(三維模型導入matlab)代碼+stl文件
工程師必備
- 項目客服
- 培訓客服
- 平臺客服
TOP




















