计算机械臂运动空间

计算机械臂运动空间(随机一亿个数据)

clear
close all
clc
syms t1 t2 t3   ;
syms a b l1 l2   ;
t=[1        0         0   0
    0    0   -1         0
    0    1    0         0
    0         0         0    1];
T1=trotz(t1)*transl(a,0,b)*t; 
T2=trotz(t2)*transl(l1,0,0);
T3=trotz(t3)*transl(l2,0,0);
T=T1*T2*T3;
T=T(1:3,4);
T
a=0.6
b=0.8
l1=2.1
l2=2.5
tt=1000
t1=(rand(tt,1)*220-110)/180*pi    ;
t2=(rand(tt,1)*135-45)/180*pi    ;
t3=(rand(tt,1)*60-80)/180*pi    ;
x= a*cos(t1) + l1*cos(t1).*cos(t2) + l2*cos(t1).*cos(t2).*cos(t3) - l2*cos(t1).*sin(t2).*sin(t3);
y= a*sin(t1) + l1*cos(t2).*sin(t1) + l2*cos(t2).*cos(t3).*sin(t1) - l2*sin(t1).*sin(t2).*sin(t3);
z=            b + l1.*sin(t2) + l2*cos(t2).*sin(t3) + l2.*cos(t3).*sin(t2);
plot3(x,y,z,'.')
figure
tt=0
n=(abs(z-tt)<0.01);
plot(x(n),y(n),'.')
tt=num2str(tt)
tt=['当z=',tt,'时,所能到达区域']
title(tt)
figure
tt=0.8
n=(abs(z-tt)<0.01);
plot(x(n),y(n),'.')
tt=num2str(tt)
tt=['当z=',tt,'时,所能到达区域']
title(tt)
figure
tt=4.5
n=(abs(z-tt)<0.01);
plot(x(n),y(n),'.')
tt=num2str(tt)
tt=['当z=',tt,'时,所能到达区域']
title(tt)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值