All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
% Taking inputs % Length of link-1 (L1) and link-2 (L2) in meter L1=1; L2=0.5; % Angle traced by link-1 in degrees (theta_1) theta_1=linspace(0,90,11); % Angle traced by link-2 in degrees (theta_2) theta_2=linspace(0,90,21); % Initialising base coordinates of link-1 x_0=0; y_0=0; ct=1; …
Yogessvaran T
updated on 07 Aug 2022
% Taking inputs
% Length of link-1 (L1) and link-2 (L2) in meter
L1=1;
L2=0.5;
% Angle traced by link-1 in degrees (theta_1)
theta_1=linspace(0,90,11);
% Angle traced by link-2 in degrees (theta_2)
theta_2=linspace(0,90,21);
% Initialising base coordinates of link-1
x_0=0;
y_0=0;
ct=1;
for i=1:length(theta_1)
THETA_1=theta_1(i);
for j=1:length(theta_2)
THETA_2=theta_2(j);
% Calculating the coordinates of end point of link-1
x_1=x_0+L1*cosd(THETA_1);
y_1=y_0+L1*sind(THETA_1);
% Calculating the coordinates of the end of link-2
%End coordinates for link-1 are the start coordinates for link-2
x_2=x_1+L2*cosd(THETA_2);
y_2=y_1+L2*sind(THETA_2);
% Plotting the robotic arm for simulation
plot9([x_0 x_1], {y_0 y_1], [x_1 x_2], [y_1 y_2], "linewidth",2);
axis([-0.1 1.5 0 1.5]);
% Pausing the current plot for a while before moving to the next
% plot
pause(0.03);
% Capturing the current plot to combine later
M(ct)= getframe(gcf);
% Incrementing ct so that ech frame is captued in M
ct=ct+1;
end
% making a movie from collected frames
movie(M);
% Creating a video file of '.avi' format to save the animation
videofile=VideoWriter('forward_kinematics_of_2R_robotic_arm.avi','Uncompressed AVI');
open(videofile);
% Writing the movie in the videofile created
writeVideo(videofile, M);
close(videofile);
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 14 challenge
ASSEMBLY OF BUTTERFLY VALVE:- 1.All the parts that are saved in the required folder is opened in the Add components tool box. 2.Now using the Move option and Assembly Constraints option the different parts are joined together with the help of Align,touch,infer/Axis operations. 3. Finally,the assembly of butterfly valve…
18 Feb 2023 09:34 AM IST
Project - Position control of mass spring damper system
To design a closed loop control scheme for a DC motor the following changes need to be done in the model in the previously created model. Speed is the controllable parameter, so we will set the reference speed in step block as 10,20, 40 whichever you want. Subtract the actual speed from the reference speed to generate…
21 Jan 2023 10:29 AM IST
Project - Analysis of a practical automotive wiring circuit
Identify each of the major elements in the above automotive wiring diagram. Ans: Major Elements in the above automotive wiring diagram are - Genarator, Battery, …
14 Dec 2022 03:37 AM IST
Week 6 - Data analysis
-
04 Dec 2022 11:06 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.