how can i verificate the forward kinematic in my 2d robotic arm?

2 views (last 30 days)
hi! i have made a robotic arm 2dof and my code is:
function [] = ServoAngle(Theta1,Theta2)
L1=0.065;%m
L2=0.125;%m
a=arduino('COM4');
servoAttach(a,9);
servoAttach(a,10);
px=L2*cos(Theta1+Theta2) + L1*cos(Theta1)
py=L2*sin(Theta1+Theta2) + L1*sin(Theta1)
servoWrite(a,9,Theta1);
servoWrite(a,10,Theta2);
plot(px,py,'r.');
xlabel('Px','fontsize',10);
ylabel('Py','fontsize',10);
pause(1);
end
px,py are coordinates of gripper, so im giving angles in 2 servos and i want to see if gripper goes in the correct py,py coordinates, how can i do this?

Answers (0)

Community Treasure Hunt

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

Start Hunting!