Challenge

Week 2- 2R Robotic Arm Challenge

% A program for forward kinematics of a robotic arm manipulator

clear all;
clc;

% inputs
l1=1;
l2=0.5;
thetha1=linspace(0,90,10);
thetha2=linspace(0,90,10);


ct=1


for i=1:length(thetha1)
    THETHA1=thetha1(i);
    for j=1:length(thetha2)
        THETHA2=thetha2(j);

        x0=0;
        y0=0;
        
        x1=l1*cosd(THETHA1);
        y1=l1*sind(THETHA1);
       
        x2=x1+l2*cosd(THETHA2);
        y2=y1+l2*sind(THETHA2);

         % plotting
         
         plot([x0 x1],[y0 y1] ,[x1 x2],[y1 y2],'linewidth',3)
         axis([-0.1 1.5 0 1.5]);
         pause(0.3)
         M(ct) = getframe(gcf);
         ct=ct+1
         


            
    end
end

movie(M);
Videofile = VideoWriter('forward_kinematics.avi','Uncompressed AVI');
open(Videofile)
writeVideo(Videofile,M)
close(Videofile)

1 comment
  1. Rajat RaoHello i want to talk you 8901999998 msg me or call its important
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.