% PUMA560_IK_DEMO 6-DOF Puma 560 zero-pose plot and closed-form ikine6s test.
% Fixes the multiline matrix multiplication syntax error from the original ws#02.m.

mdl_puma560;
figure('Name', 'Puma 560 Zero & IK Pose', 'NumberTitle', 'off');
p560.plot(qz);

T = transl(0.6, 0.1, 0) * rpy2tr(0, 180, 0, 'deg');
hold on;
trplot(T, 'frame', 'Target', 'color', 'r');

q = p560.ikine6s(T);
disp('Closed-form IK joint solution q (rad):');
disp(q);

T_check = p560.fkine(q);
disp('FK verification pose error (norm):');
disp(norm(double(T_check) - T));
