All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM To write a program to simulate the forward kinematics of the 2R robotic arm and create an animation file on the plot 2R ROBOTIC ARM It consists of two links. The first link is connected to the base in an angle of theta1. And the…
selva balaji
updated on 25 May 2019
AIM
To write a program to simulate the forward kinematics of the 2R robotic arm and create an animation file on the plot
2R ROBOTIC ARM
It consists of two links. The first link is connected to the base in an angle of theta1. And the second link is connected with the first link. The starting point of the second link is the ending point of the first link. The second link is at an angle of theta2 to the normal. The endpoint of the second link is used for the machining processes like welding or any process.
PROGRAM TO SIMULATE THE ROBOTIC ARM
import math
import matplotlib.pyplot as plt
#inputs
l1 = 1
l2 = 0.5
#thetas
n_theta = 10
theta_start = 0
theta_end = math.pi/2
theta_1 = []
theta_2 = []
for i in range(0,n_theta):
tmp = theta_start+i*(theta_end-theta_start)/(n_theta-1)
theta_1.append(tmp)
theta_2.append(tmp)
#initial coordinates
x0 = 0
y0 = 0
#loop for creating 100 values
ct = 1
for t1 in theta_1:
for t2 in theta_2:
x1 = l1*math.cos(t1)
y1 = l1*math.sin(t1)
x2 = x1+l2*math.cos(t2)
y2 = y1+l2*math.sin(t2)
filename = 'test%05d.png'%ct +'.png'
ct = ct + 1
plt.figure()
plt.plot([x0,x1],[y0,y1])
plt.plot([x1,x2],[y1,y2])
plt.xlim([0,2])
plt.ylim([0,2])
plt.savefig(filename)
EXPLANATION
ANIMATION LINK
https://youtu.be/P5nyKoEfJG8
RESULT
Thus the program was coded to simulate the 2R Robotic arm and an animation file was created on it.
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...
COMPARISON OF BENDING OF BEAMS
AIM To compare the performances of three types of beams under a bending load and to choose the best one among the three types CASE1: RECTANGULAR BEAM …
18 Jun 2019 08:35 AM IST
SOLVING ODE FOR THE TRANSIENT BEHAVIOUR OF SIMPLE PENDULUM USING PYTHON
AIM To write a program to simulate the transient behavior of the simple pendulum and create an animation on its motion ODE The above equation is a second-order equation. It cannot be solved as it is so it should be split into two first-order…
31 May 2019 05:36 AM IST
DATA ANALYSIS USING PYTHON
AIM To write a program to create a visualizer tool which will read the given data and required information is taken from the data file PROGRAM : import matplotlib.pyplot as plt import math import numpy as np import sys #compatibility check try : file = open(\'engine_data.out\',\'r\')…
31 May 2019 04:06 AM IST
CURVE FITTING USING PYTHON
AIM To write a program to perform curve fitting. CURVE FIT Curve fitting is a process of constructing a curve or a mathematical function that has been best fit to the series of data points. By curve fitting, we can obtain the relationship between the observed…
28 May 2019 01:11 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.