Week 2- 2R Robotic Arm Challenge
Forward Kinematics of the Two Arm RobotBelow configuration shows a simple two arm robot in X-Y plane.
Drive Link for Project -
https://drive.google.com/open?id=1d_oKIvOySjL4p9BFSiuLli5VwKilxWFK
Enclosure -
- Rport
- Code
- errors
Youtube Link for Animation
% forward kinematic of 2R robotclear allclose allclc% Inputs - length of the two links% L1 - length of link connected to the fixed base% length of link L1 is 1.2 m, coordinate of the two ends (x0,y0) and (x1,y1)% End of L1 attached to fixed base is considered as origin (x0,y0)L1 = 1.2;% Length of the second link attached to L1 in mL2 = 0.6;% Range of the angular possition of the L1 0d to 90dtheta = linspace(0,90,10);% Range of the angular possition of the L2 0d to 45dbeta = linspace(0,45,10);% for loop to get combinations of theta and betact = 1; %counter startfor i = 1:length(theta) % angular possitions of first link THETA = theta(i); for j = 1:length(beta) % angular possitions of second link BETA = beta(j); x0 = 0; % possitions of the starting point of L1 in x-y coordinates y0 = 0; x1 = L1*cosd(THETA); % end point of L1 and start point of L2 y1 = L1*sind(THETA); x2 = x1 + L2*cosd(BETA); % end point of the L2 y2 = y1 + L2*sind(BETA); % plot of the possitions plot([x0 x1],[y0 y1],[x1 x2],[y1 y2],'linewidth',5); % plot with line width of 5 pause (0.1); axis([-0.5 2 0 2]); M(ct) = getframe(gcf); % frame of the current window ct = ct+1; % frame increment grid on end % end of second for loopend % end of the first for loopmovie(M)videofile = VideoWriter('forward_kin_2R_Robot.avi','Uncompressed AVI'); % writing the video file open(videofile)writeVideo(videofile,M)close(videofile)