FORWARD KINEMATICS OF 2-R ROBOTIC ARM
EXPLAINATION ABOUT FORWARD KINEMATICS OF 2-ARMED ROBOT:
It consists of two links (link1 and link2) ,two rotational joints , base and a manipulator.One end of link1 will be connected to a base and other end of the link 1 will be connected to one side of link2 .The other end of link 2 will be connected to manipulator.
INPUTS REQUIRED:
- Length of two links .
- Inclination about horizontal base of the links .
EXPLANATION OF THE CODE:
First we need to define the position of linksusing the l1,l2 values and the given theta values.Since we need all possible motion between the links, we need to vary the theta values hence we used 'for' loop to take maximum no of values of theta for the links and then it is assigned to new THETA variable .This procedure is followed for other link too hence another 'for' loop is used .Plot command is used to plot the points across the axis.In order to mention, the number of times this process has to take place, variable 'c' is introduced .pause command is used to pause and view every position of the links.Getframe command is used to take each frame of motion and convert to a movie .
CODE AND ANIMATION :
Animation link:
https://drive.google.com/open?id=1l5Y9lUAln6vdTRtWrH2G1mn_KIoiYJKg
CODE:
theta1=linspace(0,90,10)
theta2=linspace(0,90,10)
l1=1;
l2=0.5;
c=1;
for i=1:length(theta1)
THETA1=theta1(i);
for j=1:length(theta2)
THETA2=theta2(j);
x0=0
y0=0
x1=l1*cosd(THETA1)
y1=l1*sind(THETA2)
x2=x1+l2*cosd(THETA2)
y2=y1+l2*sind(THETA2)
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',3);
axis([-1 1 0 1.5])
pause(0.01);
M(c)=getframe(gcf);
c=c+1;
end
end
%Movie(M)
%videofile=videowriter('forkinem.avi''uncompressed AVI');
%open(videofile)
%writevideo(videofile,M)
%close(videofile)