Where am I going wrong? I'm writing the Jacobian Matrix for a robot (KUKA LWR or iiwa).
2 次查看(过去 30 天)
显示 更早的评论
%%defining DH-Parameters
syms q1 q2 q3 q4 q5 q6 q7 d3 d5 z p
a=[90 -90 -90 90 90 -90 0];
d=[0 0 d3 0 d5 0 0];
b=[q1 q2 q3 q4 q5 q6 q7];
%%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)) 0;
sin(b(i)) cos(b(i))*cosd(a(i)) -cos(b(i))*sind(a(i)) 0;
0 sind(a(i)) cosd(a(i)) d(i);
0 0 0 1];
T=T*A;
z(i)=T(1:3,3)
p(i)=T(1:3,4)
end
R=T(1:3,1:3)
P=T(1:3,4)
J=[z(1)*(p(7)-p(1)) z(2)*(p(7)-p(2)) z(3)*(p(7)-p(3)) z(4)*(p(7)-p(4)) z(5)*(p(7)-p(5)) z(6)*(p(7)-p(6));z(0) z(1) z(2) z(3) z(4) z(5) z(6)]
1 个评论
Haris Ashe
2022-10-26
编辑:Haris Ashe
2022-10-26
I think you should use cross product instead, ie. cross(z(1),(p(7)-p(1)))
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robotics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!