8000 Merge branch 'master' of https://github.com/petercorke/robotics-toolb… · navrobot/robotics-toolbox-python@5d12cef · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d12cef

Browse files
committed
2 parents 2f8ddb1 + 1ee5851 commit 5d12cef

File tree

8 files changed

+445
-26
lines changed

8 files changed

+445
-26
lines changed

roboticstoolbox/models/DH/Ball.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox import DHRobot, RevoluteDH
7+
from math import pi
8+
import numpy as np
9+
10+
11+
class Ball(DHRobot):
12+
'''
13+
reate model of a ball manipulator
14+
15+
Ball() creates the workspace variable ball which describes the
16+
kinematic characteristics of a serial link manipulator with 50 joints
17+
that folds into a ball shape.
18+
19+
Ball(N) as above but creates a manipulator with N joints.
20+
21+
Also define the workspace vectors:
22+
q joint angle vector for default ball configuration
23+
Reference:
24+
- "A divide and conquer articulated-body algorithm for parallel O(log(n))
25+
calculation of rigid body dynamics, Part 2",
26+
Int. J. Robotics Research, 18(9), pp 876-892.
27+
28+
Notes:
29+
- Unlike most other model scripts this one is actually a function that
30+
behaves like a script and writes to the global workspace.
31+
'''
32+
33+
def __init__(self, N=None):
34+
35+
links = []
36+
self._qz = []
37+
if not N:
38+
N = 10
39+
self.N = N
40+
41+
for i in range(self.N):
42+
links.append(RevoluteDH(a=0.1, alpha=pi/2))
43+
self._qz.append(self.fract(i+1))
44+
45+
# and build a serial link manipulator
46+
super(Ball, self).__init__(links, name='ball')
47+
48+
@property
49+
def qz(self):
50+
return self._qz
51+
52+
def fract(self, i):
53+
theta1 = 1
54+
theta2 = -2/3
55+
56+
out = i % 3
57+
if out < 1:
58+
f = self.fract(i/3)
59+
elif out < 2:
60+
f = theta1
61+
else:
62+
f = theta2
63+
return f

roboticstoolbox/models/DH/Cobra600.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox import DHRobot, RevoluteDH, PrismaticDH
7+
from math import pi
8+
import numpy as np
9+
10+
11+
class Cobra600(DHRobot):
12+
13+
# %MDL_COBRA600 Create model of Adept Cobra 600 manipulator
14+
# %
15+
# % MDL_COBRA600 is a script that creates the workspace variable c600 which
16+
# % describes the kinematic characteristics of the 4-axis Adept Cobra 600
17+
# % SCARA manipulator using standard DH conventions.
18+
# %
19+
# % Also define the workspace vectors:
20+
# % qz zero joint angle configuration
21+
# %
22+
# % Notes::
23+
# % - SI units are used.
24+
# %
25+
# % See also SerialRevolute, mdl_puma560akb, mdl_stanford.
26+
def __init__(self):
27+
deg = pi/180
28+
29+
L = [RevoluteDH(d=0.387, a=0.325, qlim=[-50*deg, 50*deg]),
30+
RevoluteDH(a=0.275, alpha=pi, qlim=[-88*deg, 88*deg]),
31+
PrismaticDH(qlim=[0, 0.210]),
32+
RevoluteDH()]
33+
34+
super(Cobra600, self).__init__(L, name='Cobra600', manufacturer='Adept')
35+
36+
self._qz = [0, 0, 0, 0]
37+
38+
@property
39+
def qz(self):
40+
return self._qz

roboticstoolbox/models/DH/Irb140.py

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
2+
"""
3+
@author: Peter Corke
4+
@author: Samuel Drew
5+
"""
6+
7+
from roboticstoolbox import DHRobot, RevoluteDH, PrismaticDH
8+
from math import pi
9+
import numpy as np
10+
11+
12+
class Irb140(DHRobot):
13+
"""
14+
Irb140 Create model of ABB IRB 140 manipulator
15+
16+
Irb140 is a script that creates the workspace variable irb140 which
17+
describes the kinematic characteristics of an ABB IRB 140 manipulator
18+
using standard DH conventions.
19+
Also define the workspace vectors:
20+
qz zero joint angle configuration
21+
qr vertical 'READY' configuration
22+
qd lower arm horizontal as per data sheet
23+
24+
Reference::
25+
- "IRB 140 data sheet", ABB Robotics.
26+
- "Utilizing the Functional Work Space Evaluation Tool for Assessing a
27+
System Design and Reconfiguration Alternatives"
28+
A. Djuric and R. J. Urbanic
29+
30+
Notes::
31+
- SI units of metres are used.
32+
- Unlike most other mdl_xxx scripts this one is actually a function that
33+
behaves like a script and writes to the global workspace.
34+
"""
35+
def __init__(self):
36+
deg = pi/180
37+
38+
# robot length values (metres)
39+
d1 = 0.352
40+
a1 = 0.070
41+
a2 = 0.360
42+
d4 = 0.380
43+
d6 = 0.065
44+
45+
# Create Links
46+
L1 = RevoluteDH(
47+
theta=0,
48+
d=d1,
49+
a=a1,
50+
alpha=-pi/2,
51+
m=34655.36e-3,
52+
r=np.array([27.87, 43.12, -89.03])*1e-3,
53+
I=np.array([512052539.74, 1361335.88, 51305020.72,
54+
1361335.88, 464074688.59, 70335556.04,
55+
51305020.72, 70335556.04, 462745526.12])*1e-9
56+
57+
L2 = RevoluteDH(
58+
theta=0,
59+
d=0,
60+
a=a2,
61+
alpha=0,
62+
m=15994.59e-3,
63+
r=np.array([198.29, 9.73, 92.43])*1e03,
64+
I=np.array([94817914.40, -3859712.77, 37932017.01,
65+
-3859712.77, 328604163.24, -1088970.86,
66+
37932017.01, -1088970.86, 277463004.88])*1e-9
67+
)
68+
69+
L3 = RevoluteDH(
70+
theta=0,
71+
d=0,
72+
a=0,
73+
alpha=pi/2,
74+
m=20862.05e-3,
75+
r=np.array([-4.56, -79.96, -5.86]),
76+
I=np.array([500060915.95, -1863252.17, 934875.78,
77+
-1863252.17, 75152670.69, -15204130.09,
78+
934875.78, -15204130.09, 515424754.34])*1e-9,
79+
)
80+
81+
L4 = RevoluteDH(
82+
theta=0,
83+
d=d4,
84+
a=0,
85+
alpha=-pi/2
86+
)
87+
88+
L5 = RevoluteDH(
89+
theta=0,
90+
d=0,
91+
a=0,
92+
alpha=pi/2
93+
)
94+
95+
L6 = RevoluteDH(
96+
theta=0,
97+
d=d6,
98+
a=0,
99+
alpha=pi/2
100+
)
101+
102+
L = [L1, L2, L3, L4, L5, L6]
103+
104+
self._qz = np.array([0, 0, 0, 0, 0, 0])
105+
106+
self._qd = np.array([0, -90*deg, 180*deg, 0, 0, -90*deg])
107+
108+
self._qr = np.array([0, -90*deg, 90*deg, 0, 90*deg, -90*deg])
109+
110+
super(Irb140, self).__init__(
111+
L,
112+
basemesh="ABB/IRB140/link0.stl",
113+
name='IRB 140',
114+
manufacturer='ABB')
115+
116+
@property
117+
def qz(self):
118+
return self._qz
119+
120+
@property
121+
def qr(self):
122+
return self._qr
123+
124+
@property
125+
def qd(self):
126+
return self._qd

roboticstoolbox/models/DH/KR5.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
"""
2+
@author: Peter Corke
3+
@author: Samuel Drew
4+
"""
5+
6+
from roboticstoolbox import DHRobot, RevoluteDH
7+
from math import pi
8+
9+
10+
class KR5(DHRobot):
11+
'''
12+
KR5 Create model of Kuka KR5 manipulator
13+
14+
MDL_KR5 is a script that creates the workspace variable KR5 which
15+
describes the kinematic characteristics of a Kuka KR5 manipulator using
16+
standard DH conventions.
17+
18+
Also define the workspace vectors:
19+
qk1 nominal working position 1
20+
qk2 nominal working position 2
21+
qk3 nominal working position 3
22+
23+
Notes::
24+
- SI units of metres are used.
25+
- Includes an 11.5cm tool in the z-direction
26+
27+
Author::
28+
- Gautam Sinha,
29+
Indian Institute of Technology, Kanpur.
30+
31+
Define simplest line model for KUKA KR5 robot
32+
Contain DH parameters for KUKA KR5 robot
33+
All link lenghts and offsets are measured in cm
34+
'''
35+
def __init__(self):
36+
37+
L1 = RevoluteDH(a=0.18, d=0.4,
38+
alpha=pi/2,
39+
mesh='KUKA/KR5_arc/link1.stl')
40+
L2 = RevoluteDH(a=0.6, d=0.135,
41+
alpha=pi,
42+
10000 mesh='KUKA/KR5_arc/link2.stl')
43+
L3 = RevoluteDH(a=0.12,
44+
d=0.135,
45+
alpha=-pi/2,
46+
mesh='KUKA/KR5_arc/link3.stl')
47+
L4 = RevoluteDH(a=0.0,
48+
d=0.62,
49+
alpha=pi/2,
50+
mesh='KUKA/KR5_arc/link4.stl')
51+
L5 = RevoluteDH(a=0.0,
52+
d=0.0,
53+
alpha=-pi/2,
54+
mesh='KUKA/KR5_arc/link5.stl')
55+
L6 = RevoluteDH(mesh='KUKA/KR5_arc/link6.stl')
56+
57+
L = [L1, L2, L3, L4, L5, L6]
58+
59+
self._qz = [0, 0, 0, 0, 0, 0]
60+
61+
self._qk1 = [pi/4, pi/3, pi/4, pi/6, pi/4, pi/6]
62+
63+
self._qk2 = [pi/4, pi/3, pi/6, pi/3, pi/4, pi/6]
64+
65+
self._qk3 = [pi/6, pi/3, pi/6, pi/3, pi/6, pi/3]
66+
67+
# Create SerialLink object
68+
super(KR5, self).__init__(
69+
L,
70+
basemesh="KUKA/KR5_arc/link0.stl",
71+
name='KR5',
72+
manufacturer='KUKA')
73+
74+
@property
75+
def qz(self):
76+
return self._qz
77+
78+
@property
79+
def qk1(self):
80+
return self._qk1
81+
82+
@property
83+
def qk2(self):
84+
return self._qk2
85+
86+
@property
87+
def qk3(self):
88+
return self._qk3

0 commit comments

Comments
 (0)
0