-
Notifications
You must be signed in to change notification settings - Fork 499
/
Copy pathUR5.py
50 lines (34 loc) · 1.24 KB
/
UR5.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
#!/usr/bin/env python
import numpy as np
from roboticstoolbox.robot.ERobot import ERobot
class UR5(ERobot):
"""
Class that imports a UR5 URDF model
``UR3()`` is a class which imports a Universal Robotics UR5 robot
definition from a URDF file. The model describes its kinematic and
graphical characteristics.
.. runblock:: pycon
>>> import roboticstoolbox as rtb
>>> robot = rtb.models.URDF.UR5()
>>> print(robot)
Defined joint configurations are:
- qz, zero joint angle configuration, 'L' shaped configuration
- qr, vertical 'READY' configuration
.. codeauthor:: Jesse Haviland
.. sectionauthor:: Peter Corke
"""
def __init__(self):
elinks, name = super().urdf_to_ets_args(
"ur_description/urdf/ur5_joint_limited_robot.urdf.xacro")
super().__init__(
elinks,
name=name,
manufacturer='Universal Robotics',
gripper_links=elinks[7]
)
self.addconfiguration("qz", np.array([0, 0, 0, 0, 0, 0]))
self.addconfiguration("qr", np.array([np.pi, 0, 0, 0, np.pi/2, 0]))
if __name__ == '__main__': # pragma nocover
robot = UR5()
print(robot)
print(robot.ets())