Skip to content

Commit 6136118

Browse files
committed
Add necessary Z1 files
Extracted from petercorke#342
1 parent 2a8111b commit 6136118

File tree

15 files changed

+21645
-0
lines changed

15 files changed

+21645
-0
lines changed

roboticstoolbox/models/URDF/Z1.py

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env python
2+
3+
import numpy as np
4+
from roboticstoolbox.robot.ERobot import ERobot
5+
from math import pi
6+
7+
8+
class Z1(ERobot):
9+
"""
10+
Class that imports a Z1 URDF model
11+
``Z1()`` is a class which imports a Unitree Z1 robot
12+
definition from a URDF file. The model describes its kinematic and
13+
graphical characteristics.
14+
.. runblock:: pycon
15+
>>> import roboticstoolbox as rtb
16+
>>> robot = rtb.models.URDF.Z1()
17+
>>> print(robot)
18+
Defined joint configurations are:
19+
- qz, zero joint angle configuration, 'L' shaped configuration
20+
- qr, vertical 'READY' configuration
21+
.. codeauthor:: Keith Siilats
22+
.. sectionauthor:: Peter Corke
23+
"""
24+
25+
def __init__(self):
26+
27+
links, name, urdf_string, urdf_filepath = self.URDF_read(
28+
"z1_description/xacro/robot.xacro"
29+
)
30+
# for link in links:
31+
# print(link)
32+
33+
super().__init__(
34+
links,
35+
name=name.upper(),
36+
manufacturer="Unitree",
37+
# gripper_links=links[9],
38+
urdf_string=urdf_string,
39+
urdf_filepath=urdf_filepath,
40+
)
41+
# forward, -0.000019, 1.542859, -1.037883, -0.531308, 0.002487, -0.012173, 0.999650, -0.002146, -0.026357, 0.389527, 0.002468, 0.999923, 0.012173, 0.000269, 0.026329, -0.012234, 0.999578, 0.402549, 0.000000, 0.000000, 0.000000, 1.000000,
42+
# start, -0.000336, 0.001634, 0.000000, 0.064640, 0.000248, 0.000230, 0.997805, 0.000104, 0.066225, 0.048696, -0.000087, 1.000000, -0.000252, 0.000011, -0.066225, 0.000246, 0.997805, 0.148729, 0.000000, 0.000000, 0.000000, 1.000000,
43+
44+
self.qr = np.array([0.000922, 0.000680, -0.003654, -0.075006, -0.000130, 0.000035,0])
45+
self.qz = np.array([0.000922, 0.000680, -0.003654, -0.075006, -0.000130, 0.000035,0])
46+
self.grab3 = np.array([-0.247,1.271, -1.613, -0.267, -0.617,0.916,0])
47+
48+
49+
self.addconfiguration("qr", self.qr)
50+
self.addconfiguration("qz", self.qz)
51+
self.addconfiguration("grab3", self.grab3)
52+
53+
# sol=robot.ikine_LM(SE3(0.5, -0.2, 0.2)@SE3.OA([1,0,0],[0,0,-1]))
54+
# 0, 0.000922, 0.000680, -0.003654, -0.075006, -0.000130, 0.000035, 0.000006, -0.002146, -0.002523, -0.003688, -0.002988, -0.000048, 0.001385, 0.016346,
55+
self.addconfiguration_attr(
56+
"qn",
57+
np.array(
58+
[0.000922, 0.000680, -0.003654, -0.075006, -0.000130, 0.000035,0]
59+
),
60+
)
61+
self.addconfiguration_attr("q1", [0.000922, 0.000680, -0.003654, -0.075006, -0.000130, 0.000035,0])
62+
63+
64+
if __name__ == "__main__": # pragma nocover
65+
66+
robot = Z1()
67+
print(robot)
68+
print(robot.ets())
69+
print(robot.fkine(q=np.ones(6)))

roboticstoolbox/models/URDF/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from roboticstoolbox.models.URDF.FetchCamera import FetchCamera
2424
from roboticstoolbox.models.URDF.Valkyrie import Valkyrie
2525
from roboticstoolbox.models.URDF.AL5D import AL5D
26+
from roboticstoolbox.models.URDF.Z1 import Z1
2627

2728
__all__ = [
2829
"Panda",
@@ -50,4 +51,5 @@
5051
"FetchCamera",
5152
"Valkyrie",
5253
"AL5D",
54+
"Z1"
5355
]

0 commit comments

Comments
 (0)