问题:达到最大递归限制 500。使用 set(0,'RecursionLimit',N) 更改限制。请注意,超出可用堆栈空间可能会使 MATLAB 和/或您的计算机崩溃。程序:
puma560;
robot=p560
N=5; % Numero de Iteraciones
z=linspace(0.432,0.482,N); % se mueve 0.05 unidades
x=zeros(1,N);
y=x;
for j=1:N
y(1,j)=-0.15;
x(1,j)=0.452;
end
phi=zeros(1,N);
for k=1:length(z)
phik=phi(k);
T(:,:,k)=[cos(phik) -sin(phik) 0 x(k);
sin(phik) cos(phik) 0 y(k);
0 0 1 z(k);
0 0 0 1];
end
qzz=ikine(robot,T)
plot(robot,qzz)
y=linspace(-0.15,0.05,N); % se mueve 0.20 unidades
x=zeros(1,N);
z=x;
for j=1:N
x(1,j)=0.452;
z(1,j)=0.482;
end
phi=zeros(1,N);
for k=1:length(y)
phik=phi(k);
T(:,:,k)=[cos(phik) -sin(phik) 0 x(k);
sin(phik) cos(phik) 0 y(k);
0 0 1 z(k);
0 0 0 1];
end
qyy=ikine(robot,T)
plot(robot,qyy)
x=linspace(0.452,0.702,N); % se mueve 0.25 unidades
y=zeros(1,N);
z=y;
for j=1:N
y(1,j)=0.05;
z(1,j)=0.482;
end
phi=zeros(1,N);
for k=1:length(x)
phik=phi(k);
T(:,:,k)=[cos(phik) -sin(phik) 0 x(k);
sin(phik) cos(phik) 0 y(k);
0 0 1 z(k);
0 0 0 1];
end
qxx=ikine(robot,T)
plot(robot,qxx)
y=linspace(0.05,-0.05,N); % se mueve 0.10 unidades
x=zeros(1,N);
z=x;
for j=1:N
x(1,j)=0.702;
z(1,j)=0.482;
end
phi=zeros(1,N);
for k=1:length(y)
phik=phi(k);
T(:,:,k)=[cos(phik) -sin(phik) 0 x(k);
sin(phik) cos(phik) 0 y(k);
0 0 1 z(k);
0 0 0 1];
end
qyy=ikine(robot,T)
plot(robot,qyy)