-
Notifications
You must be signed in to change notification settings - Fork 499
/
Copy pathUR20.py
99 lines (70 loc) · 2.48 KB
/
UR20.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import numpy as np
from roboticstoolbox import DHRobot, RevoluteDH
from spatialmath import SE3
class UR20(DHRobot):
"""
Class that models a Universal Robotics UR20 manipulator
:param symbolic: use symbolic constants
:type symbolic: bool
``UR20()`` is an object which models a Unimation Puma560 robot and
describes its kinematic and dynamic characteristics using standard DH
conventions.
.. runblock:: pycon
>>> import roboticstoolbox as rtb
>>> robot = rtb.models.DH.UR20()
>>> print(robot)
Defined joint configurations are:
- qz, zero joint angle configuration
- qr, arm horizontal along x-axis
.. note::
- SI units are used.
:References:
- `Parameters for calculations of kinematics and dynamics <https://www.universal-robots.com/articles/ur/parameters-for-calculations-of-kinematics-and-dynamics>`_
:sealso: :func:`UR4`, :func:`UR10`
.. codeauthor:: Peter Corke
""" # noqa
def __init__(self, symbolic=False):
if symbolic:
import spatialmath.base.symbolic as sym
zero = sym.zero()
pi = sym.pi()
else:
from math import pi
zero = 0.0
deg = pi / 180
inch = 0.0254
# robot length values (metres)
a = [0, -0.8620, -0.7287, 0, 0, 0]
d = [0.2363, 0, 0, 0.2010, 0.1593, 0.1543]
alpha = [pi / 2, zero, zero, pi / 2, -pi / 2, zero]
# mass data, no inertia available
mass = [16.343, 29.632, 7.879,3.054, 3.126, 0.846]
center_of_mass = [
[0, -0.0610, 0.0062],
[0.5226, 0, 0.2098],
[0.3234, 0, 0.0604],
[0, -0.0026, 0.0393],
[0, 0.0024, 0.0379],
[0, -0.0003, -0.0318],
]
links = []
for j in range(6):
link = RevoluteDH(
d=d[j], a=a[j], alpha=alpha[j], m=mass[j], r=center_of_mass[j], G=1
)
links.append(link)
super().__init__(
links,
name="UR20",
manufacturer="Universal Robotics",
keywords=("dynamics", "symbolic"),
symbolic=symbolic,
)
self.qr = np.array([180, 0, 0, 0, 90, 0]) * deg
self.qz = np.zeros(6)
self.addconfiguration("qr", self.qr)
self.addconfiguration("qz", self.qz)
if __name__ == "__main__": # pragma nocover
UR20 = UR20(symbolic=False)
print(UR20)
# print(UR20.dyntable())