Week 2- 2R Robotic Arm Challenge
https://drive.google.com/file/d/1HUFlPokJagNdMlOIFG4uBryLo_J3k1Er/view?usp=sharing
% FORWORD KINEMATIC OF A ROBOTIC ARM
now write the code
close all
clear all
clc
% INPUTS
l1=0.8;
l2=0.6;
theta1=45;
theta2=30;
%COORDINATES
x0=0;
y0=0;
x1=l1*cosd(theta1);
y1=l1*sind(theta2);
x2= x1+l2*cosd(theta2);
y2= y1+l2*sind(theta2);
now exicte the code
now plotting
line([x0 x1],[y0 y1],'linewidth',4,'color',b)
line([x1 x2],[y1 y2],'linewidth',4,'color',r)
now exicute the programme
now the ANIMATION OF A ROBOTIC ARM
noe we tack new window
close all
clear all
clc
% inputs
l1=0.8;
l2=0.6;
theta1=linspace(0,90,10);
theta2=linspace(0,90,10);
ct=1;
now we tack forloop
for i=1:length(theta1)
theta1=theta1(i); the i= [1,2,3,4,5,,6,7,8,9,10]
for j=1:length(theta2)
theta2=theta2(j);
and copy the values like x0,y0,x1,x2,y1,y2
the values are shown by the above inputs
now the PLOTTING
plot([xo x1],[y0 y1],[x1 x2],[y2 y2];'linewiidth',4)
axis ([-0.15 1.5 0 1.5])
pause(0.03)
M(ct)=getframe(gcf);
ct=ct+1;
end
end
now the movie file
movie(M)
videofile=videowriter('forword_kinematics.avi',uncomprssed AVI');
open(videofile)
write video(videofile,M)
close(videofile)
THE ANIMATION OF ROBOTIC ARM SHOWN BY THE BELOW GOOGLE DRIVE LINK
https://drive.google.com/file/d/1HUFlPokJagNdMlOIFG4uBryLo_J3k1Er/view?usp=sharing
hence i am write the code i am facing some errors , we the errors are shown by the command window
and what made my mistacke and what will give the correct values are shown by the command window
some of the errors are shown the below in the form if screenshots