Where am I going wrong? I'm writing the Jacobian Matrix for a robot (KUKA LWR or iiwa).

14 visualizaciones (últimos 30 días)
%%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)]

Respuestas (0)

Categorías

Más información sobre ROS Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by