article-六轴可视化机械臂仿真(三维模型导入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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

CAE工作者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值