hex-zmq-servers 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. hex_zmq_servers/__init__.py +19 -7
  2. hex_zmq_servers/cam/__init__.py +13 -6
  3. hex_zmq_servers/config/mujoco_archer_d6y.json +19 -0
  4. hex_zmq_servers/config/mujoco_e3_desktop.json +19 -0
  5. hex_zmq_servers/mujoco/archer_d6y/model/assets/assets.xml +7 -9
  6. hex_zmq_servers/mujoco/archer_d6y/model/assets/gripper_base_link.STL +0 -0
  7. hex_zmq_servers/mujoco/archer_d6y/model/assets/gripper_left_helper_link.STL +0 -0
  8. hex_zmq_servers/mujoco/archer_d6y/model/assets/gripper_left_link_1.STL +0 -0
  9. hex_zmq_servers/mujoco/archer_d6y/model/assets/gripper_left_link_2.STL +0 -0
  10. hex_zmq_servers/mujoco/archer_d6y/model/assets/gripper_right_helper_link.STL +0 -0
  11. hex_zmq_servers/mujoco/archer_d6y/model/assets/gripper_right_link_1.STL +0 -0
  12. hex_zmq_servers/mujoco/archer_d6y/model/assets/gripper_right_link_2.STL +0 -0
  13. hex_zmq_servers/mujoco/archer_d6y/model/robot.xml +37 -50
  14. hex_zmq_servers/mujoco/archer_d6y/model/scene.xml +5 -5
  15. hex_zmq_servers/mujoco/archer_d6y/model/setting.xml +21 -21
  16. hex_zmq_servers/mujoco/archer_d6y/mujoco_archer_d6y.py +44 -10
  17. hex_zmq_servers/mujoco/e3_desktop/model/assets/assets.xml +7 -9
  18. hex_zmq_servers/mujoco/e3_desktop/model/assets/gripper_base_link.STL +0 -0
  19. hex_zmq_servers/mujoco/e3_desktop/model/assets/gripper_left_helper_link.STL +0 -0
  20. hex_zmq_servers/mujoco/e3_desktop/model/assets/gripper_left_link_1.STL +0 -0
  21. hex_zmq_servers/mujoco/e3_desktop/model/assets/gripper_left_link_2.STL +0 -0
  22. hex_zmq_servers/mujoco/e3_desktop/model/assets/gripper_right_helper_link.STL +0 -0
  23. hex_zmq_servers/mujoco/e3_desktop/model/assets/gripper_right_link_1.STL +0 -0
  24. hex_zmq_servers/mujoco/e3_desktop/model/assets/gripper_right_link_2.STL +0 -0
  25. hex_zmq_servers/mujoco/e3_desktop/model/robot.xml +81 -107
  26. hex_zmq_servers/mujoco/e3_desktop/model/scene.xml +6 -6
  27. hex_zmq_servers/mujoco/e3_desktop/model/setting.xml +42 -42
  28. hex_zmq_servers/mujoco/e3_desktop/mujoco_e3_desktop.py +62 -19
  29. hex_zmq_servers/mujoco/e3_desktop/mujoco_e3_desktop_cli.py +1 -1
  30. hex_zmq_servers/mujoco/mujoco_base.py +34 -0
  31. hex_zmq_servers/robot/__init__.py +4 -1
  32. hex_zmq_servers/robot/hexarm/__init__.py +30 -0
  33. hex_zmq_servers/robot/hexarm/robot_hexarm.py +5 -3
  34. hex_zmq_servers/robot/hexarm/robot_hexarm_cli.py +1 -1
  35. hex_zmq_servers/robot/hexarm/robot_hexarm_srv.py +1 -1
  36. hex_zmq_servers/robot/hexarm/urdf/archer_d6y/empty.urdf +207 -0
  37. hex_zmq_servers/robot/hexarm/urdf/archer_d6y/gp100.urdf +207 -0
  38. hex_zmq_servers/robot/hexarm/urdf/archer_d6y/gp100_handle.urdf +207 -0
  39. hex_zmq_servers/robot/hexarm/urdf/archer_d6y/gp100_p050.urdf +207 -0
  40. hex_zmq_servers/robot/hexarm/urdf/archer_d6y/gp100_p050_handle.urdf +207 -0
  41. hex_zmq_servers/robot/hexarm/urdf/archer_l6y/empty.urdf +206 -0
  42. hex_zmq_servers/robot/hexarm/urdf/archer_l6y/gp100.urdf +206 -0
  43. hex_zmq_servers/robot/hexarm/urdf/archer_l6y/gp100_handle.urdf +206 -0
  44. hex_zmq_servers/robot/hexarm/urdf/archer_l6y/gp100_p050.urdf +206 -0
  45. hex_zmq_servers/robot/hexarm/urdf/archer_l6y/gp100_p050_handle.urdf +206 -0
  46. hex_zmq_servers-0.2.2.dist-info/METADATA +117 -0
  47. {hex_zmq_servers-0.2.0.dist-info → hex_zmq_servers-0.2.2.dist-info}/RECORD +50 -45
  48. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_base_link.STL +0 -0
  49. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_narrow1_link.STL +0 -0
  50. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_narrow2_link.STL +0 -0
  51. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_narrow3_link.STL +0 -0
  52. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_narrow_loop_link.STL +0 -0
  53. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_wide1_link.STL +0 -0
  54. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_wide2_link.STL +0 -0
  55. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_wide3_link.STL +0 -0
  56. hex_zmq_servers/mujoco/archer_d6y/model/assets/picker_wide_loop_link.STL +0 -0
  57. hex_zmq_servers/mujoco/e3_desktop/model/assets/link_camera.STL +0 -0
  58. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_base_link.STL +0 -0
  59. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_narrow1_link.STL +0 -0
  60. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_narrow2_link.STL +0 -0
  61. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_narrow3_link.STL +0 -0
  62. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_narrow_loop_link.STL +0 -0
  63. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_wide1_link.STL +0 -0
  64. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_wide2_link.STL +0 -0
  65. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_wide3_link.STL +0 -0
  66. hex_zmq_servers/mujoco/e3_desktop/model/assets/picker_wide_loop_link.STL +0 -0
  67. hex_zmq_servers-0.2.0.dist-info/METADATA +0 -37
  68. {hex_zmq_servers-0.2.0.dist-info → hex_zmq_servers-0.2.2.dist-info}/WHEEL +0 -0
  69. {hex_zmq_servers-0.2.0.dist-info → hex_zmq_servers-0.2.2.dist-info}/licenses/LICENSE +0 -0
  70. {hex_zmq_servers-0.2.0.dist-info → hex_zmq_servers-0.2.2.dist-info}/top_level.txt +0 -0
@@ -15,7 +15,6 @@ from .zmq_base import HexZMQDummyClient, HexZMQDummyServer
15
15
 
16
16
  from .cam import HexCamBase, HexCamClientBase, HexCamServerBase
17
17
  from .cam import HexCamDummy, HexCamDummyClient, HexCamDummyServer
18
- from .cam import HexCamBerxel, HexCamBerxelClient, HexCamBerxelServer
19
18
 
20
19
  from .mujoco import HexMujocoBase, HexMujocoClientBase, HexMujocoServerBase
21
20
  from .mujoco import HexMujocoArcherD6y, HexMujocoArcherD6yClient, HexMujocoArcherD6yServer
@@ -24,7 +23,7 @@ from .mujoco import HexMujocoE3Desktop, HexMujocoE3DesktopClient, HexMujocoE3Des
24
23
  from .robot import HexRobotBase, HexRobotClientBase, HexRobotServerBase
25
24
  from .robot import HexRobotDummy, HexRobotDummyClient, HexRobotDummyServer
26
25
  from .robot import HexRobotGello, HexRobotGelloClient, HexRobotGelloServer
27
- from .robot import HexRobotHexarm, HexRobotHexarmClient, HexRobotHexarmServer
26
+ from .robot import HexRobotHexarm, HexRobotHexarmClient, HexRobotHexarmServer, HEXARM_URDF_PATH_DICT
28
27
 
29
28
  import os
30
29
 
@@ -32,7 +31,6 @@ file_dir = os.path.dirname(os.path.abspath(__file__))
32
31
  HEX_ZMQ_SERVERS_PATH_DICT = {
33
32
  "zmq_dummy": f"{file_dir}/zmq_base.py",
34
33
  "cam_dummy": f"{file_dir}/cam/dummy/cam_dummy_srv.py",
35
- "cam_berxel": f"{file_dir}/cam/berxel/cam_berxel_srv.py",
36
34
  "mujoco_archer_d6y":
37
35
  f"{file_dir}/mujoco/archer_d6y/mujoco_archer_d6y_srv.py",
38
36
  "mujoco_e3_desktop":
@@ -44,7 +42,6 @@ HEX_ZMQ_SERVERS_PATH_DICT = {
44
42
  HEX_ZMQ_CONFIGS_PATH_DICT = {
45
43
  "zmq_dummy": f"{file_dir}/config/zmq_dummy.json",
46
44
  "cam_dummy": f"{file_dir}/config/cam_dummy.json",
47
- "cam_berxel": f"{file_dir}/config/cam_berxel.json",
48
45
  "mujoco_archer_d6y": f"{file_dir}/config/mujoco_archer_d6y.json",
49
46
  "mujoco_e3_desktop": f"{file_dir}/config/mujoco_e3_desktop.json",
50
47
  "robot_dummy": f"{file_dir}/config/robot_dummy.json",
@@ -59,6 +56,7 @@ __all__ = [
59
56
  # path
60
57
  "HEX_ZMQ_SERVERS_PATH_DICT",
61
58
  "HEX_ZMQ_CONFIGS_PATH_DICT",
59
+ "HEXARM_URDF_PATH_DICT",
62
60
 
63
61
  # launch
64
62
  "HexLaunch",
@@ -85,9 +83,6 @@ __all__ = [
85
83
  "HexCamDummy",
86
84
  "HexCamDummyClient",
87
85
  "HexCamDummyServer",
88
- "HexCamBerxel",
89
- "HexCamBerxelClient",
90
- "HexCamBerxelServer",
91
86
 
92
87
  # mujoco
93
88
  "HexMujocoBase",
@@ -115,4 +110,21 @@ __all__ = [
115
110
  "HexRobotHexarmServer",
116
111
  ]
117
112
 
113
+ # Optional: berxel
114
+ try:
115
+ from .cam import HexCamBerxel, HexCamBerxelClient, HexCamBerxelServer
116
+ HEX_ZMQ_SERVERS_PATH_DICT[
117
+ "cam_berxel"] = f"{file_dir}/cam/berxel/cam_berxel_srv.py"
118
+ HEX_ZMQ_CONFIGS_PATH_DICT[
119
+ "cam_berxel"] = f"{file_dir}/config/cam_berxel.json"
120
+ __all__.extend([
121
+ "HexCamBerxel",
122
+ "HexCamBerxelClient",
123
+ "HexCamBerxelServer",
124
+ ])
125
+ except ImportError:
126
+ # berxel_py_wrapper not installed
127
+ # Install with: pip install hex_zmq_servers[berxel]
128
+ pass
129
+
118
130
  # print("#### Thanks for using hex_zmq_servers :D ####")
@@ -8,7 +8,6 @@
8
8
 
9
9
  from .cam_base import HexCamBase, HexCamClientBase, HexCamServerBase
10
10
  from .dummy import HexCamDummy, HexCamDummyClient, HexCamDummyServer
11
- from .berxel import HexCamBerxel, HexCamBerxelClient, HexCamBerxelServer
12
11
 
13
12
  __all__ = [
14
13
  # base
@@ -20,9 +19,17 @@ __all__ = [
20
19
  "HexCamDummy",
21
20
  "HexCamDummyClient",
22
21
  "HexCamDummyServer",
23
-
24
- # berxel
25
- "HexCamBerxel",
26
- "HexCamBerxelClient",
27
- "HexCamBerxelServer",
28
22
  ]
23
+
24
+ # Optional: berxel (requires berxel_py_wrapper)
25
+ try:
26
+ from .berxel import HexCamBerxel, HexCamBerxelClient, HexCamBerxelServer
27
+ __all__.extend([
28
+ "HexCamBerxel",
29
+ "HexCamBerxelClient",
30
+ "HexCamBerxelServer",
31
+ ])
32
+ except ImportError:
33
+ # berxel_py_wrapper not installed
34
+ # Install with: pip install hex_zmq_servers[berxel]
35
+ pass
@@ -9,6 +9,25 @@
9
9
  "params": {
10
10
  "states_rate": 250,
11
11
  "img_rate": 30,
12
+ "tau_ctrl": false,
13
+ "mit_kp": [
14
+ 200.0,
15
+ 200.0,
16
+ 200.0,
17
+ 75.0,
18
+ 15.0,
19
+ 15.0,
20
+ 20.0
21
+ ],
22
+ "mit_kd": [
23
+ 12.5,
24
+ 12.5,
25
+ 12.5,
26
+ 6.0,
27
+ 0.31,
28
+ 0.31,
29
+ 1.0
30
+ ],
12
31
  "headless": false,
13
32
  "sens_ts": true
14
33
  }
@@ -9,6 +9,25 @@
9
9
  "params": {
10
10
  "states_rate": 250,
11
11
  "img_rate": 30,
12
+ "tau_ctrl": false,
13
+ "mit_kp": [
14
+ 200.0,
15
+ 200.0,
16
+ 200.0,
17
+ 75.0,
18
+ 15.0,
19
+ 15.0,
20
+ 20.0
21
+ ],
22
+ "mit_kd": [
23
+ 12.5,
24
+ 12.5,
25
+ 12.5,
26
+ 6.0,
27
+ 0.31,
28
+ 0.31,
29
+ 1.0
30
+ ],
12
31
  "headless": false,
13
32
  "sens_ts": true
14
33
  }
@@ -5,15 +5,13 @@
5
5
  <mesh name="arm_link_3" file="arm_link_3.STL"/>
6
6
  <mesh name="arm_link_4" file="arm_link_4.STL"/>
7
7
  <mesh name="arm_link_5" file="arm_link_5.STL"/>
8
- <mesh name="picker_base_link" file="picker_base_link.STL"/>
9
- <mesh name="picker_narrow1_link" file="picker_narrow1_link.STL"/>
10
- <mesh name="picker_narrow2_link" file="picker_narrow2_link.STL"/>
11
- <mesh name="picker_narrow3_link" file="picker_narrow3_link.STL"/>
12
- <mesh name="picker_narrow_loop_link" file="picker_narrow_loop_link.STL"/>
13
- <mesh name="picker_wide1_link" file="picker_wide1_link.STL"/>
14
- <mesh name="picker_wide2_link" file="picker_wide2_link.STL"/>
15
- <mesh name="picker_wide3_link" file="picker_wide3_link.STL"/>
16
- <mesh name="picker_wide_loop_link" file="picker_wide_loop_link.STL"/>
8
+ <mesh name="gripper_base_link" file="gripper_base_link.STL"/>
9
+ <mesh name="gripper_left_helper_link" file="gripper_left_helper_link.STL"/>
10
+ <mesh name="gripper_left_link_1" file="gripper_left_link_1.STL"/>
11
+ <mesh name="gripper_left_link_2" file="gripper_left_link_2.STL"/>
12
+ <mesh name="gripper_right_helper_link" file="gripper_right_helper_link.STL"/>
13
+ <mesh name="gripper_right_link_1" file="gripper_right_link_1.STL"/>
14
+ <mesh name="gripper_right_link_2" file="gripper_right_link_2.STL"/>
17
15
  <mesh name="camera_link" file="camera_link.STL"/>
18
16
  <mesh name="table_link" file="table_link.STL" scale="0.001 0.001 0.001"/>
19
17
  </mujocoinclude>
@@ -6,7 +6,7 @@
6
6
  # link 1
7
7
  <body name="link_1" pos="0 0 0.0665">
8
8
  <inertial pos="0.008 -0.0023 0.0213" quat="0.707107 0.707107 0 0" mass="0.2154" diaginertia="0.0003 0.0003 0.0002"/>
9
- <joint name="joint_1" pos="0 0 0" axis="0 0 1" range="-2.61 3.14" limited="true" armature="0.1" damping="3.0" frictionloss="1.0"/>
9
+ <joint name="joint_1" pos="0 0 0" axis="0 0 1" range="-2.7 2.7" limited="true" armature="0.1" damping="3.0" frictionloss="1.0"/>
10
10
  <geom type="mesh" rgba="0.92549 0.92549 0.92549 1" mesh="arm_link_1"/>
11
11
 
12
12
  # link 2
@@ -33,64 +33,51 @@
33
33
  <joint name="joint_5" pos="0 0 0" axis="-1 0 0" range="-1.57 1.57" limited="true" armature="0.1" damping="3.0" frictionloss="1.0"/>
34
34
  <geom type="mesh" rgba="0.898039 0.917647 0.929412 1" mesh="arm_link_5"/>
35
35
 
36
- # picker base link
37
- <body name="picker_base_link" pos="0.0547 0 0.02895">
38
- <inertial pos="0.00913219 -0.00104428 0.0437714" quat="0.779177 -0.153227 -0.105966 0.598478" mass="0.416893" diaginertia="0.00112999 0.000894143 0.000426247"/>
39
- <joint name="joint_6" pos="0 0 0" axis="0 0 1" range="-1.57 1.57" limited="true" armature="0.1" damping="3.0" frictionloss="1.0"/>
40
- <geom pos="0 0 0.005" type="mesh" mesh="picker_base_link" rgba="0.75 0.75 0.75 1.0" />
41
- <camera name="end_camera" pos="-0.07 0.0 0.03" quat="0.1227878 0.6963642 -0.6963642 -0.1227878" fovy="50"/>
42
- <geom pos="-0.08 0.0 0.015" quat="0.819152 0.0 -0.5735764 0.0" type="mesh" mesh="camera_link" rgba="0.1 0.1 0.1 1" contype="0" conaffinity="0" />
36
+ # gripper base link
37
+ <body name="gripper_base_link" pos="0.0547 0 0.02895" quat="0.707107 0.0 -0.707107 0.0">
38
+ <inertial pos="0.0141517 0.0120671 0.037083" quat="0.332786 0.772745 0.486202 0.236063" mass="0.404149" diaginertia="0.00182378 0.00177437 0.000232349"/>
39
+ <joint name="joint_6" pos="0 0 0" axis="1 0 0" range="-1.57 1.57" limited="true" armature="0.1" damping="3.0" frictionloss="1.0"/>
40
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_base_link"/>
41
+ <geom pos="0.04 0 0.12" quat="0.6830127 0.6830127 0.1830127 -0.1830127" type="mesh" rgba="0.1 0.1 0.1 1" mesh="camera_link" />
42
+ <camera name="end_camera" pos="0.066 0 0.105" quat="0.8660254 0.0 -0.5 0.0" fovy="50"/>
43
43
 
44
- # narrow gripper
45
- <body name="picker_narrow1_link" pos="0 -0.0195 0.0565" quat="0.0 -0.707 0.0 -0.707">
46
- <inertial pos="0.0094685 0.0068806 6.5437e-05" quat="0.488058 0.00022793 0.00062709 0.872811" mass="0.025428" diaginertia="2.65562e-06 1.69368e-06 1.5501e-06"/>
47
- <joint name="hand_narrow1_joint" pos="0 0 0" axis="0 0 1" range="0.0 0.8" limited="true" armature="0.01" damping="1.0" frictionloss="0.1" />
48
- <geom type="mesh" mesh="picker_narrow1_link" rgba="0.75 0.75 0.75 1.0" />
49
-
50
- <body name="picker_narrow2_link" pos="0.030852 0.018551 0">
51
- <inertial pos="0.0088027 -0.007035 1.6424e-05" quat="0.259339 0.661207 -0.251356 0.657547" mass="0.0040132" diaginertia="1.70091e-07 1.66561e-07 5.03584e-08"/>
52
- <joint name="hand_narrow2_joint" pos="0 0 0" axis="0 0 -1" range="-1.57 1.57" limited="true" armature="0.001" damping="1.0" frictionloss="0.1" springref="-0.01" stiffness="1.0" />
53
- <geom type="mesh" mesh="picker_narrow2_link" rgba="0.75 0.75 0.75 1.0" />
54
-
55
- <body name="picker_narrow3_link" pos="0.018118 -0.01574 0">
56
- <inertial pos="0.012508 -0.0079729 9.4339e-05" quat="0.575033 0.575033 0.411506 0.411506" mass="0.018029" diaginertia="2.75843e-06 2.3252e-06 9.52273e-07"/>
57
- <joint name="hand_narrow3_joint" pos="0 0 0" axis="0 0 -1" range="-0.5 0.5" limited="true" armature="0.001" damping="1.0" frictionloss="0.1" />
58
- <geom type="mesh" mesh="picker_narrow3_link" rgba="0.75 0.75 0.75 1.0" />
59
- </body>
60
- </body>
44
+ # gripper helper
45
+ <body name="gripper_left_helper_link" pos="0.057667 0.030604 2.5e-05">
46
+ <inertial pos="0.00299357 0.0232625 -5e-05" quat="0.996724 0 0 0.0808839" mass="0.00594562" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
47
+ <joint name="gripper_left_help_joint" pos="0 0 0" axis="0 0 -1" range="0 1.52" limited="true" armature="0.01" damping="1.0" frictionloss="0.1" />
48
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_left_helper_link"/>
61
49
  </body>
62
-
63
- # narrow helper
64
- <body name="picker_narrow_loop_link" pos="0 -0.021633 0.07387" quat="0.0 -0.707 0.0 -0.707">
65
- <inertial pos="0.014869 -0.0036066 0.00029307" quat="0.800794 2.10378e-06 -6.78039e-07 0.59894" mass="0.022591" diaginertia="4.76981e-06 4.35879e-06 6.0445e-07"/>
66
- <joint name="hand_narrow_loop_joint" pos="0 0 0" axis="0 0 -1" limited="auto" armature="0.0" damping="0.01" frictionloss="0.01" />
67
- <geom type="mesh" mesh="picker_narrow_loop_link" rgba="0.75 0.75 0.75 1.0" />
50
+ <body name="gripper_right_helper_link" pos="0.057667 -0.030604 2.5e-05">
51
+ <inertial pos="0.00299357 -0.0232625 -5e-05" quat="0.996724 0 0 -0.0808839" mass="0.00594562" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
52
+ <joint name="gripper_right_help_joint" pos="0 0 0" axis="0 0 1" range="0 1.52" limited="true" armature="0.01" damping="1.0" frictionloss="0.1" />
53
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_right_helper_link"/>
68
54
  </body>
69
55
 
70
- # wide gripper
71
- <body name="picker_wide1_link" pos="0 0.0195 0.0565" quat="0.0 -0.707 0.0 -0.707">
72
- <inertial pos="0.0095051 -0.0068479 6.8268e-05" quat="0.872477 -0.000843631 -0.000472499 0.488655" mass="0.025428" diaginertia="2.65502e-06 1.69428e-06 1.5501e-06"/>
73
- <joint name="hand_wide1_joint" pos="0 0 0" axis="0 0 -1" range="0.0 0.8" limited="true" armature="0.1" damping="1.0" frictionloss="0.1" />
74
- <geom type="mesh" mesh="picker_wide1_link" rgba="0.75 0.75 0.75 1.0" />
75
56
 
76
- <body name="picker_wide2_link" pos="0.030852 -0.018551 0">
77
- <inertial pos="0.0088027 0.007035 -1.6424e-05" quat="-0.251356 0.657548 0.259339 0.661207" mass="0.0040132" diaginertia="1.70091e-07 1.66561e-07 5.03584e-08"/>
78
- <joint name="hand_wide2_joint" pos="0 0 0" axis="0 0 -1" range="-1.57 1.57" limited="true" armature="0.001" damping="1.0" frictionloss="0.1" springref="0.01" stiffness="1.0" />
79
- <geom type="mesh" mesh="picker_wide2_link" rgba="0.75 0.75 0.75 1.0" />
57
+ # left gripper
58
+ <body name="gripper_left_link_1" pos="0.0721 0.014 2.5e-05">
59
+ <inertial pos="0.00299357 0.0232625 -5e-05" quat="0.996724 0 0 0.0808839" mass="0.00594562" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
60
+ <joint name="gripper_left_joint_1" pos="0 0 0" axis="0 0 -1" range="0 1.52" limited="true" armature="0.01" damping="1.0" frictionloss="0.1" />
61
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_left_link_1"/>
80
62
 
81
- <body name="picker_wide3_link" pos="0.018118 0.01574 0">
82
- <inertial pos="0.016206 0.0094593 4.7668e-05" quat="0.574355 3.4175e-06 6.47256e-06 0.818606" mass="0.035835" diaginertia="1.16461e-05 8.09447e-06 4.6309e-06"/>
83
- <joint name="hand_wide3_joint" pos="0 0 0" axis="0 0 -1" range="-0.5 0.5" limited="true" armature="0.001" damping="1.0" frictionloss="0.1" />
84
- <geom type="mesh" mesh="picker_wide3_link" rgba="0.75 0.75 0.75 1.0" />
85
- </body>
63
+ <body name="gripper_left_link_2" pos="0.0085108 0.04927 0">
64
+ <inertial pos="0.0255016 0.00914642 -0.00175617" quat="0.424541 0.412629 0.571518 0.568216" mass="0.0339319" diaginertia="1.36949e-05 1.35554e-05 3.4264e-06"/>
65
+ <joint name="gripper_left_joint_2" pos="0 0 0" axis="0 0 1" range="0 1.52" limited="true" armature="0.01" damping="1.0" frictionloss="0.1" />
66
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_left_link_2"/>
86
67
  </body>
87
68
  </body>
88
69
 
89
- # wide helper
90
- <body name="picker_wide_loop_link" pos="0 0.021633 0.07387" quat="0.0 -0.707 0.0 -0.707">
91
- <inertial pos="0.016268 0.0040555 0.00030323" quat="0.599119 -2.137e-06 -5.96717e-07 0.80066" mass="0.025142" diaginertia="6.26903e-06 5.85397e-06 6.2389e-07"/>
92
- <joint name="hand_wide_loop_joint" pos="0 0 0" axis="0 0 -1" limited="auto" armature="0.0" damping="0.01" frictionloss="0.01" />
93
- <geom type="mesh" mesh="picker_wide_loop_link" rgba="0.75 0.75 0.75 1.0" />
70
+ # right gripper
71
+ <body name="gripper_right_link_1" pos="0.0721 -0.014 2.5e-05">
72
+ <inertial pos="0.00299357 -0.0232625 -5e-05" quat="0.996724 0 0 -0.0808839" mass="0.00594562" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
73
+ <joint name="gripper_right_joint_1" pos="0 0 0" axis="0 0 1" range="0 1.52" limited="true" armature="0.01" damping="1.0" frictionloss="0.1" />
74
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_right_link_1"/>
75
+
76
+ <body name="gripper_right_link_2" pos="0.0085108 -0.04927 0">
77
+ <inertial pos="0.0255016 -0.00914642 -0.00175616" quat="0.568212 0.571522 0.412623 0.424547" mass="0.0339319" diaginertia="1.36948e-05 1.35553e-05 3.4264e-06"/>
78
+ <joint name="gripper_right_joint_2" pos="0 0 0" axis="0 0 -1" range="0 1.52" limited="true" armature="0.01" damping="1.0" frictionloss="0.1" />
79
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_right_link_2"/>
80
+ </body>
94
81
  </body>
95
82
  </body>
96
83
  </body>
@@ -9,7 +9,7 @@
9
9
  <headlight diffuse="0.6 0.6 0.6" ambient="0.1 0.1 0.1" specular="0 0 0"/>
10
10
  <rgba haze="0.15 0.25 0.35 1"/>
11
11
  <global azimuth="120" elevation="-20"/>
12
- <map znear="0.01" zfar="50"/>
12
+ <map znear="0.001" zfar="50"/>
13
13
  </visual>
14
14
 
15
15
  <asset>
@@ -41,11 +41,11 @@
41
41
  <include file="setting.xml"/>
42
42
 
43
43
  <keyframe>
44
- # qpos: 14 + 7
45
- # ctrl: (6 + 2)
44
+ # qpos: 12 + 7
45
+ # ctrl: 7
46
46
  <key name="home" qpos="
47
- 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
47
+ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
48
48
  0.5 0.0 0.5 1.0 0.0 0.0 0.0" ctrl="
49
- 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/>
49
+ 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/>
50
50
  </keyframe>
51
51
  </mujoco>
@@ -5,33 +5,33 @@
5
5
  <exclude body1="link_2" body2="link_3" />
6
6
  <exclude body1="link_3" body2="link_4" />
7
7
  <exclude body1="link_4" body2="link_5" />
8
- <exclude body1="link_5" body2="picker_base_link" />
9
- <exclude body1="picker_base_link" body2="picker_narrow1_link" />
10
- <exclude body1="picker_narrow1_link" body2="picker_narrow2_link" />
11
- <exclude body1="picker_narrow2_link" body2="picker_narrow3_link" />
12
- <exclude body1="picker_narrow3_link" body2="picker_narrow_loop_link" />
13
- <exclude body1="picker_narrow_loop_link" body2="picker_base_link" />
14
- <exclude body1="picker_base_link" body2="picker_wide1_link" />
15
- <exclude body1="picker_wide1_link" body2="picker_wide2_link" />
16
- <exclude body1="picker_wide2_link" body2="picker_wide3_link" />
17
- <exclude body1="picker_wide3_link" body2="picker_wide_loop_link" />
18
- <exclude body1="picker_wide_loop_link" body2="picker_base_link" />
8
+ <exclude body1="link_5" body2="gripper_base_link" />
9
+ <exclude body1="gripper_base_link" body2="gripper_left_helper_link" />
10
+ <exclude body1="gripper_left_helper_link" body2="gripper_left_link_1" />
11
+ <exclude body1="gripper_left_helper_link" body2="gripper_left_link_2" />
12
+ <exclude body1="gripper_left_link_1" body2="gripper_left_link_2" />
13
+ <exclude body1="gripper_base_link" body2="gripper_right_helper_link" />
14
+ <exclude body1="gripper_right_helper_link" body2="gripper_right_link_1" />
15
+ <exclude body1="gripper_right_helper_link" body2="gripper_right_link_2" />
16
+ <exclude body1="gripper_right_link_1" body2="gripper_right_link_2" />
19
17
  </contact>
20
18
 
21
19
  <equality>
22
- <connect body1="picker_narrow_loop_link" body2="picker_narrow3_link" anchor="0.03153 -0.00975 0.0" />
23
- <connect body1="picker_wide_loop_link" body2="picker_wide3_link" anchor="0.03153 0.00975 0.0" />
20
+ <joint joint1="gripper_left_joint_1" joint2="gripper_left_joint_2" />
21
+ <joint joint1="gripper_left_joint_1" joint2="gripper_left_help_joint" />
22
+ <joint joint1="gripper_left_joint_1" joint2="gripper_right_joint_1" />
23
+ <joint joint1="gripper_left_joint_1" joint2="gripper_right_joint_2" />
24
+ <joint joint1="gripper_left_joint_1" joint2="gripper_right_help_joint" />
24
25
  </equality>
25
26
 
26
27
  <actuator>
27
- <position joint="joint_1" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="-2.7 2.7" forcerange="-30 30"/>
28
- <position joint="joint_2" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="-1.57 2.09" forcerange="-30 30"/>
29
- <position joint="joint_3" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="0 3.14" forcerange="-30 30"/>
30
- <position joint="joint_4" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="-1.57 1.57" forcerange="-30 30"/>
31
- <position joint="joint_5" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="-1.57 1.57" forcerange="-30 30"/>
32
- <position joint="joint_6" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="-1.57 1.57" forcerange="-30 30"/>
33
- <position joint="hand_narrow1_joint" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="0.0 0.8" forcerange="-20 20"/>
34
- <position joint="hand_wide1_joint" kp="1500" kv="15.0" ctrllimited="true" ctrlrange="0.0 0.8" forcerange="-20 20"/>
28
+ <motor joint="joint_1" ctrlrange="-28 28" forcerange="-28 28"/>
29
+ <motor joint="joint_2" ctrlrange="-28 28" forcerange="-28 28"/>
30
+ <motor joint="joint_3" ctrlrange="-28 28" forcerange="-28 28"/>
31
+ <motor joint="joint_4" ctrlrange="-10 10" forcerange="-10 10"/>
32
+ <motor joint="joint_5" ctrlrange="-10 10" forcerange="-10 10"/>
33
+ <motor joint="joint_6" ctrlrange="-10 10" forcerange="-10 10"/>
34
+ <motor joint="gripper_left_joint_1" ctrlrange="-10 10" forcerange="-10 10"/>
35
35
  </actuator>
36
36
 
37
37
  </mujocoinclude>
@@ -21,10 +21,14 @@ from ...zmq_base import (
21
21
  HexRate,
22
22
  HexSafeValue,
23
23
  )
24
+ from hex_robo_utils import HexCtrlUtilMit as CtrlUtil
24
25
 
25
26
  MUJOCO_CONFIG = {
26
27
  "states_rate": 250,
27
28
  "img_rate": 30,
29
+ "tau_ctrl": False,
30
+ "mit_kp": [200.0, 200.0, 200.0, 75.0, 15.0, 15.0, 20.0],
31
+ "mit_kd": [12.5, 12.5, 12.5, 6.0, 0.31, 0.31, 1.0],
28
32
  "headless": False,
29
33
  "sens_ts": True,
30
34
  }
@@ -41,6 +45,9 @@ class HexMujocoArcherD6y(HexMujocoBase):
41
45
  try:
42
46
  states_rate = mujoco_config["states_rate"]
43
47
  img_rate = mujoco_config["img_rate"]
48
+ self.__tau_ctrl = mujoco_config["tau_ctrl"]
49
+ self.__mit_kp = mujoco_config["mit_kp"]
50
+ self.__mit_kd = mujoco_config["mit_kd"]
44
51
  self.__headless = mujoco_config["headless"]
45
52
  self.__sens_ts = mujoco_config["sens_ts"]
46
53
  except KeyError as ke:
@@ -56,13 +63,19 @@ class HexMujocoArcherD6y(HexMujocoBase):
56
63
 
57
64
  # state init
58
65
  self.__state_robot_idx = [0, 1, 2, 3, 4, 5, 6]
59
- self.__state_obj_idx = [14, 15, 16, 17, 18, 19, 20]
66
+ self.__state_obj_idx = [12, 13, 14, 15, 16, 17, 18]
60
67
  self.__ctrl_robot_idx = [0, 1, 2, 3, 4, 5, 6]
61
68
  self.__ctrl_obj_idx = [0, 1, 2, 3, 4, 5, 6]
62
69
  self._limits = np.stack(
63
70
  [self.__model.jnt_range[self.__state_robot_idx, :]],
64
71
  axis=0,
65
72
  )
73
+ if not self.__tau_ctrl:
74
+ self.__mit_kp = np.ascontiguousarray(np.asarray(self.__mit_kp))
75
+ self.__mit_kd = np.ascontiguousarray(np.asarray(self.__mit_kd))
76
+ self.__mit_ctrl = CtrlUtil()
77
+ self.__gripper_ratio = 1.33 / 1.52
78
+ self._limits[0, -1] *= self.__gripper_ratio
66
79
  self._dofs = np.array([len(self.__state_robot_idx)])
67
80
  keyframe_id = mujoco.mj_name2id(
68
81
  self.__model,
@@ -80,10 +93,10 @@ class HexMujocoArcherD6y(HexMujocoBase):
80
93
  self.__states_trig_thresh = int(self.__sim_rate / states_rate)
81
94
 
82
95
  # camera init
83
- width, height = 400, 400
96
+ width, height = 640, 400
84
97
  fovy_rad = self.__model.cam_fovy[0] * np.pi / 180.0
85
98
  focal = 0.5 * height / np.tan(fovy_rad / 2.0)
86
- self._intri = np.array([focal, focal, width / 2, height / 2])
99
+ self._intri = np.array([focal, focal, height / 2, height / 2])
87
100
  self.__rgb_cam = mujoco.Renderer(self.__model, height, width)
88
101
  self.__depth_cam = mujoco.Renderer(self.__model, height, width)
89
102
  self.__depth_cam.enable_depth_rendering()
@@ -188,9 +201,8 @@ class HexMujocoArcherD6y(HexMujocoBase):
188
201
  pos = copy.deepcopy(self.__data.qpos)
189
202
  vel = copy.deepcopy(self.__data.qvel)
190
203
  eff = copy.deepcopy(self.__data.qfrc_actuator)
191
- pos[self.__state_robot_idx[-1]] = 0.8 - pos[self.__state_robot_idx[-1]]
192
- vel[self.__state_robot_idx[-1]] *= -1
193
- eff[self.__state_robot_idx[-1]] *= -1
204
+ pos[self.__state_robot_idx[-1]] = pos[
205
+ self.__state_robot_idx[-1]] * self.__gripper_ratio
194
206
  return self.__mujoco_ts() if self.__sens_ts else hex_zmq_ts_now(
195
207
  ), np.array([
196
208
  pos[self.__state_robot_idx],
@@ -199,10 +211,32 @@ class HexMujocoArcherD6y(HexMujocoBase):
199
211
  ]).T, self.__data.qpos[self.__state_obj_idx].copy()
200
212
 
201
213
  def __set_cmds(self, cmds: np.ndarray):
202
- self.__data.ctrl[self.__ctrl_robot_idx] = cmds
203
- self.__data.ctrl[self.__ctrl_robot_idx[-1]] = 0.8 - cmds[-1]
204
- self.__data.ctrl[self.__ctrl_robot_idx[-1] +
205
- 1] = self.__data.ctrl[self.__ctrl_robot_idx[-1]]
214
+ tau_cmds = None
215
+ if not self.__tau_ctrl:
216
+ if len(cmds.shape) == 1:
217
+ cmd_pos = cmds.copy()
218
+ cmd_tor = np.zeros_like(cmds)
219
+ else:
220
+ cmd_pos = cmds[:, 0].copy()
221
+ cmd_tor = cmds[:, 1].copy()
222
+ cmd_pos = self._apply_pos_limits(
223
+ cmd_pos,
224
+ self._limits[0, :, 0],
225
+ self._limits[0, :, 1],
226
+ )
227
+ cmd_pos[-1] /= self.__gripper_ratio
228
+ tau_cmds = self.__mit_ctrl(
229
+ self.__mit_kp,
230
+ self.__mit_kd,
231
+ cmd_pos,
232
+ np.zeros(len(self.__state_robot_idx)),
233
+ self.__data.qpos[self.__state_robot_idx],
234
+ self.__data.qvel[self.__state_robot_idx],
235
+ cmd_tor,
236
+ )
237
+ else:
238
+ tau_cmds = cmds.copy()
239
+ self.__data.ctrl[self.__ctrl_robot_idx] = tau_cmds
206
240
 
207
241
  def __get_rgb(self):
208
242
  self.__rgb_cam.update_scene(self.__data, "end_camera")
@@ -6,15 +6,13 @@
6
6
  <mesh name="arm_link_3" file="arm_link_3.STL"/>
7
7
  <mesh name="arm_link_4" file="arm_link_4.STL"/>
8
8
  <mesh name="arm_link_5" file="arm_link_5.STL"/>
9
- <mesh name="picker_base_link" file="picker_base_link.STL"/>
10
- <mesh name="picker_narrow1_link" file="picker_narrow1_link.STL"/>
11
- <mesh name="picker_narrow2_link" file="picker_narrow2_link.STL"/>
12
- <mesh name="picker_narrow3_link" file="picker_narrow3_link.STL"/>
13
- <mesh name="picker_narrow_loop_link" file="picker_narrow_loop_link.STL"/>
14
- <mesh name="picker_wide1_link" file="picker_wide1_link.STL"/>
15
- <mesh name="picker_wide2_link" file="picker_wide2_link.STL"/>
16
- <mesh name="picker_wide3_link" file="picker_wide3_link.STL"/>
17
- <mesh name="picker_wide_loop_link" file="picker_wide_loop_link.STL"/>
9
+ <mesh name="gripper_base_link" file="gripper_base_link.STL"/>
10
+ <mesh name="gripper_left_helper_link" file="gripper_left_helper_link.STL"/>
11
+ <mesh name="gripper_left_link_1" file="gripper_left_link_1.STL"/>
12
+ <mesh name="gripper_left_link_2" file="gripper_left_link_2.STL"/>
13
+ <mesh name="gripper_right_helper_link" file="gripper_right_helper_link.STL"/>
14
+ <mesh name="gripper_right_link_1" file="gripper_right_link_1.STL"/>
15
+ <mesh name="gripper_right_link_2" file="gripper_right_link_2.STL"/>
18
16
  <mesh name="camera_link" file="camera_link.STL"/>
19
17
  <mesh name="table_link" file="table_link.STL" scale="0.001 0.001 0.001"/>
20
18
  </mujocoinclude>