Week 2- 2R Robotic Arm Challenge
% Kinematics for 3R Robotic Arms
% consider a simple robotic arm with three links making an angle of theta1, theta2 and theta3 and has lenght of L1, L2 , L3
% So inputs for the program are
L1 = 1.25; % length of first link
L2 = 0.9; % lenght of second link
L3 = 1.5; % lenght of third link
theta1 = linspace(15,45,4);
theta2 = linspace(20,60,4);
theta3 = linspace(0,90,4);
ct = 1;
for i = 1:length(theta1)
Theta1 = theta1(i)
for j = 1: length(theta2)
Theta2 = theta2(j)
for k = 1:length(theta3);
Theta3 = theta3(k)
x0 = 0;
y0 = 0;
x1 = L1*cosd(Theta1);
y1 = L1*sind(Theta1);
x2 = x1 + L2*cosd(Theta2);
y2 = y1 + L2*sind(Theta2);
x3 = x2 + L3*cosd(Theta3);
y3 = y2 + L3*sind(Theta3);
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],[x2 x3],[y2 y3])
pause(0.3)
M(ct) = getframe(gcf);
ct = ct+1;
end
end
end
movie(M);
videofile = VideoWriter('forward_Kinematic','Uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
link for the animation video file for kinematic of robotic arm
https://drive.google.com/file/d/13SAEIxi7z6OHXjAwafX2lwRN3DdkA7JK/view?usp=sharing