Challenge

Week 2- 2R Robotic Arm Challenge

% To write a progrma to simulate the forward kinematic of 2R Robotic arm
close all
clc

% length of Arms ^ Meter
L1 = 3.2;
L2 = 2.2;

% Angle of Arms with Base ^ Degree
A1 = linspace(0,90,10);
A2 = linspace(0,90,10);


% Counter for assigned value as 1
ct = 1;

% Since A1 & A2 have 10 values hence i & j are introduced to have the all values 
for  i = 1: length(A1);
    a1 = A1(i);
   j = 1:length(A2);
        a2 = A2(j);

 end

        % Cordinates of Arm at starting point of Arm1 based on LAL/KKA theory
      for x0 = 0;
        y0 = 0;

        % Cordinates of Arm at End point of Arm1 & starting point of Arm2 based on LAL/KKA theory
        x1 = L1*cosd(a1);
        y1 = L1*sind(a1);

        % Cordinates of Arm at End point of Arm2 based on LAL/KKA theory
        x2 = x1 + L2*cosd(a2);
        y2 = y1 + L2*sind(a2);

        % Plot
        
        plot([x0 x1], [y0 y1], [x1 x2], [y1 y2],'linewidth',3,'color','r');
        axis([-0.1 1.5 0 1.5]);
        pause(0.2);
        ct = ct+1;
        
       
    end


    
----- I tried many times but couldn't make the video....
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.

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.