Week 2- 2R Robotic Arm Challenge
AIM : to simulator the forward kinematics of a 2r robotic arm using
introduction: a manipulator/end effector movement determine the workspace where the robotic arm can be appilicable. our motive is to animate the movement of the robotic arm with the subsequent relative motion between the two -comprising links

forward kinematics
if theta1 and theta2 given
step1: calculate the parlier of link1
objective
1) write a program to simulator forward kinematics of a 2r robotic arm
2)animating and creating a movie from the plots/figures obtained from the program
inputs
(x0,y0) = starting points of link 1
(x1,y1)= endpoint of link/ starting point of link 2
(x2,y2)= endpoint of link 2
1=length of the link attahed to the base
2=length of the link between the first link and the end effector
theta1=angle made by link 1 with x-axis
theta2= angle by link 2withx-axis
progeam:
clear all
close all
clc
%inputs
l1 = 1;
l2 = 0.5;
theta1 = linspace(0,90,10);
theta2 = linspace(0,90,10);
ct=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(THETA1);
x2 = x1 + l2*cosd(THETA2);
y2 = y1 +l2*sind(THETA2);
%plotting
plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',3)
axis([-0.1 1.5 0 1.5])
pause(0.03)
M(ct) = getfraME(gcf);
ct = ct+1;
end
end
Movie(M)
videofile = VideoWrite('forward_kinematics.avi','uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)
conclusion : a practical scenarion regarding the functioning of the robotic arm and its wrokspace has been experienced by simulating the forward kinematics with a program