I'm coding a Kuka robot jacobian matrix. but I get below errors!
2 次查看(过去 30 天)
显示 更早的评论
syms q1 q2 q3 q4 q5 q6 q7 d1 d2 d3 d4 d5 d6 d7 z1 p1
syms a1 a2 a3 a4 a5 a6 a7 l1 l2 l3 l4 l5 l6 l7
d=[0 0 d3 0 d5 0 0];
b=[q1 q2 q3 q4 q5 q6 q7];
%%we define 'a' & 'l' matrice sizes
a=[90 -90 -90 90 90 -90 0];
l=[0 0 0 0 0 0 0];
%%defining 'z' & 'p' as a matrix variable
z=[z1 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 0 0 0 0];
p=[p1 0 0 0 0 0 0;0 0 0 0 0 0 0;0 0 0 0 0 0 0];
%%Calculating Rotation Matrix
T=eye(4);
for i=1:7
%%because cos(pi/2)=!0 ,so we use degrees instead of rads for a
%%matrix
A=[cos(b(i)) -sin(b(i))*cosd(a(i)) sin(b(i))*sind(a(i)) l(i)*cos(b(i));
sin(b(i)) cos(b(i))*cosd(a(i)) -cos(b(i))*sind(a(i)) l(i)*sin(b(i));
0 sind(a(i)) cosd(a(i)) d(i) ;
0 0 0 1 ];
T=T*A;
%%calculating Z & Position Matrices in case to find Jacobian Matrice
z(1:3,i)=T(1:3,3);
p(1:3,i)=T(1:3,4);
end
w=[0;0;0];
P=horzcat(w,p);
Z=horzcat(z,w);
%%Jacobian Matrice
Jac=[cross(Z(:,1),(P(:,8)-P(:,1))) cross(Z(:,2),(P(:,8)-P(:,2)))
cross(Z(:,3),(P(:,8)-P(:,3))) cross(Z(:,4),(P(:,8)-P(:,4)))
cross(Z(:,5),(P(:,8)-P(:,5))) cross(Z(:,6),(P(:,8)-P(:,6)))
cross(Z(:,7),(P(:,8)-P(:,7)));
Z(:,1) Z(:,2) Z(:,3) Z(:,4) Z(:,5) Z(:,6) Z(:,7) ];
simplify(T);simplify(z);simplify(P),simplify(Jac);
Error using sym/cat>checkDimensions (line 74) CAT arguments dimensions are not consistent.
Error in sym/cat>catMany (line 39) [resz, ranges] = checkDimensions(sz,dim);
Error in sym/cat (line 31) ySym = catMany(dim, args);
Error in sym/vertcat (line 19) ySym = cat(1,args{:});
which part of my program is wrong?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!