检查时发现上述程序输入时有点小错误:L,改后为:
syms theta1 theta2 theta3 d2;
a=[cos(theta1) -sin(theta1)*cosd(78) sin(theta1)*sind(78) 100*cos(theta1);sin(theta1) cos(theta1)*cosd(78) -cos(theta1)*sind(78) 100*sin(theta1);0 sind(78) cosd(78) 0;0 0 0 1];
b=[cos(theta2) -sin(theta2)*cosd(-45) sin(theta2)*sind(-45) 10*cos(theta2);sin(theta2) cos(theta2)*cosd(-45) -cos(theta2)*sind(-45) 10*sin(theta2);0 sind(-45) cosd(-45) d2;0 0 0 1];
c=[cos(theta3) -sin(theta3)*cosd(97) sin(theta3)*sind(97) 150*cos(theta3);sin(theta3) cos(theta3)*cosd(97) -cos(theta3)*sind(97) 150*sin(theta3);0 sind(97) cosd(97) 180;0 0 0 1];
P=[0 0 1;0 0 0;40 1 0;1 0 0];
A=a*b*c;
R=A*P;
H=R-[260.188 -9.83535 98.7370;-0.225849 0.390972 0.892263;0.163272 -0.88778 0.430335;1 0 0];
[theta1,theta2,theta3,d2]=solve(H(1,1),H(3,1),H(3,2),H(3,3));
theta1=double(theta1)
theta2=double(theta2)
theta3=double(theta3)
d2=double(d2)
theta1 =
-419.1482
-419.1482
-326.5611
-326.5611
-137.2703
-137.2703
-47.2336
-47.2336
theta2 =
-1.1270 + 0.6609i
-1.1270 - 0.6609i
0.1811
-1.7333
0.8236 - 1.3005i
0.8236 + 1.3005i
0.6056
-0.7136
theta3 =
1.3917
1.3917
-1.3917
-1.3917
1.8655
1.8655
-1.8655
-1.8655
d2 =
-1.1321
-1.1321
2.0589
2.0589
-1.4811
-1.4811
2.3722
2.3722