hex-driver-mujoco 0.0.1a1__tar.gz

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 (59) hide show
  1. hex_driver_mujoco-0.0.1a1/LICENSE +201 -0
  2. hex_driver_mujoco-0.0.1a1/MANIFEST.in +11 -0
  3. hex_driver_mujoco-0.0.1a1/PKG-INFO +31 -0
  4. hex_driver_mujoco-0.0.1a1/README.md +2 -0
  5. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/__init__.py +20 -0
  6. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/base.py +102 -0
  7. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/__init__.py +14 -0
  8. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/arm_base_link.STL +0 -0
  9. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/arm_link_1.STL +0 -0
  10. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/arm_link_2.STL +0 -0
  11. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/arm_link_3.STL +0 -0
  12. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/arm_link_4.STL +0 -0
  13. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/arm_link_5.STL +0 -0
  14. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/assets.xml +17 -0
  15. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/camera_link.STL +0 -0
  16. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/gripper_base_link.STL +0 -0
  17. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/gripper_left_helper_link.STL +0 -0
  18. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/gripper_left_link_1.STL +0 -0
  19. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/gripper_left_link_2.STL +0 -0
  20. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/gripper_right_helper_link.STL +0 -0
  21. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/gripper_right_link_1.STL +0 -0
  22. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/gripper_right_link_2.STL +0 -0
  23. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/assets/table_link.STL +0 -0
  24. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/joint_class.xml +23 -0
  25. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/robot.xml +100 -0
  26. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/scene.xml +55 -0
  27. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/model/setting.xml +37 -0
  28. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_archer_y6/mujoco.py +537 -0
  29. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/__init__.py +14 -0
  30. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/arm_base_link.STL +0 -0
  31. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/arm_link_1.STL +0 -0
  32. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/arm_link_2.STL +0 -0
  33. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/arm_link_3.STL +0 -0
  34. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/arm_link_4.STL +0 -0
  35. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/arm_link_5.STL +0 -0
  36. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/assets.xml +18 -0
  37. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/camera_link.STL +0 -0
  38. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/e3_desktop_base_link.STL +0 -0
  39. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/gripper_base_link.STL +0 -0
  40. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/gripper_left_helper_link.STL +0 -0
  41. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/gripper_left_link_1.STL +0 -0
  42. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/gripper_left_link_2.STL +0 -0
  43. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/gripper_right_helper_link.STL +0 -0
  44. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/gripper_right_link_1.STL +0 -0
  45. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/gripper_right_link_2.STL +0 -0
  46. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/assets/table_link.STL +0 -0
  47. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/joint_class.xml +23 -0
  48. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/robot.xml +200 -0
  49. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/scene.xml +57 -0
  50. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/model/setting.xml +72 -0
  51. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/mujoco_e3_desktop/mujoco.py +667 -0
  52. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco/util.py +53 -0
  53. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco.egg-info/PKG-INFO +31 -0
  54. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco.egg-info/SOURCES.txt +57 -0
  55. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco.egg-info/dependency_links.txt +1 -0
  56. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco.egg-info/requires.txt +3 -0
  57. hex_driver_mujoco-0.0.1a1/hex_driver_mujoco.egg-info/top_level.txt +1 -0
  58. hex_driver_mujoco-0.0.1a1/pyproject.toml +40 -0
  59. hex_driver_mujoco-0.0.1a1/setup.cfg +4 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,11 @@
1
+ include LICENSE
2
+ include README.md
3
+ include requirements.txt
4
+
5
+ recursive-include package_name *
6
+ recursive-include hex_driver_mujoco/mujoco_archer_y6/model * *
7
+ recursive-include hex_driver_mujoco/mujoco_e3_desktop/model * *
8
+
9
+ recursive-exclude * *.pyc
10
+ recursive-exclude * .DS_Store
11
+ recursive-exclude * __pycache__
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.4
2
+ Name: hex_driver_mujoco
3
+ Version: 0.0.1a1
4
+ Summary: HEXFELLOW Mujoco Driver
5
+ Author-email: Dong Zhaorui <dzr159@gmail.com>
6
+ Maintainer-email: jecjune <zejun.chen@hexfellow.com>, Dong Zhaorui <dzr159@gmail.com>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/hexfellow/hex_driver_mujoco
9
+ Project-URL: Repository, https://github.com/hexfellow/hex_driver_mujoco.git
10
+ Project-URL: Bug Tracker, https://github.com/hexfellow/hex_driver_mujoco/issues
11
+ Project-URL: Documentation, https://github.com/hexfellow/hex_driver_mujoco/wiki
12
+ Keywords: hex,driver,mujoco
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Operating System :: POSIX :: Linux
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: hex_util_runtime<0.1.0,>=0.0.0
26
+ Requires-Dist: opencv-python>=4.10.0
27
+ Requires-Dist: mujoco>=3.3.0
28
+ Dynamic: license-file
29
+
30
+ # hex_driver_mujoco
31
+ Hex Mujoco Driver
@@ -0,0 +1,2 @@
1
+ # hex_driver_mujoco
2
+ Hex Mujoco Driver
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding:utf-8 -*-
3
+ ################################################################
4
+ # Copyright 2026 Dong Zhaorui. All rights reserved.
5
+ # Author: Dong Zhaorui 847235539@qq.com
6
+ # Date : 2026-03-23
7
+ ################################################################
8
+
9
+ from .mujoco_archer_y6 import HexMujocoArcherY6, HexMujocoArcherY6Params
10
+ from .mujoco_e3_desktop import HexMujocoE3Desktop, HexMujocoE3DesktopParams
11
+
12
+ __all__ = [
13
+ # mujoco archer y6
14
+ "HexMujocoArcherY6",
15
+ "HexMujocoArcherY6Params",
16
+
17
+ # mujoco e3 desktop
18
+ "HexMujocoE3Desktop",
19
+ "HexMujocoE3DesktopParams",
20
+ ]
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding:utf-8 -*-
3
+ ################################################################
4
+ # Copyright 2026 Dong Zhaorui. All rights reserved.
5
+ # Author: Dong Zhaorui 847235539@qq.com
6
+ # Date : 2026-03-23
7
+ ################################################################
8
+
9
+ import os
10
+ import multiprocessing as mp
11
+ from dataclasses import dataclass
12
+ from abc import ABC, abstractmethod
13
+ from multiprocessing.synchronize import Event as MpEvent
14
+ from typing import Optional
15
+
16
+
17
+ def _hex_mujoco_worker_main(mujoco: "HexMujocoBase") -> None:
18
+ try:
19
+ mujoco.init_mujoco()
20
+ mujoco.work_loop()
21
+ finally:
22
+ mujoco.deinit_mujoco()
23
+
24
+
25
+ @dataclass
26
+ class HexMujocoBaseParams:
27
+ sim_rate: float = 1000
28
+ state_rate: float = 1000
29
+ cam_rate: float = 30
30
+ headless: bool = False
31
+
32
+ state_buffer_size: int = 200
33
+ cmd_buffer_size: int = 200
34
+ cam_buffer_size: int = 8
35
+
36
+
37
+ class HexMujocoBase(ABC):
38
+
39
+ def __init__(self) -> None:
40
+ os.environ["QT_QPA_FONTDIR"] = "/usr/share/fonts/truetype/dejavu/"
41
+ self._worker_process: Optional[mp.Process] = None
42
+ self._stop_event = mp.Event()
43
+ self._init_event = mp.Event()
44
+
45
+ def __del__(self):
46
+ self.deinit_mujoco()
47
+
48
+ def is_working(self) -> bool:
49
+ p = self._worker_process
50
+ return p is not None and p.is_alive()
51
+
52
+ @property
53
+ def stop_event(self) -> MpEvent:
54
+ """Set by `stop_background_worker`; subclasses should exit `work_loop` when this is set."""
55
+ return self._stop_event
56
+
57
+ def start(self, *, daemon: bool = True) -> None:
58
+ """Spawn a subprocess that runs `work_loop` until `stop_event` is set (or process ends)."""
59
+ if self._worker_process is not None and self._worker_process.is_alive(
60
+ ):
61
+ return
62
+ self._stop_event.clear()
63
+ self._worker_process = mp.Process(
64
+ target=_hex_mujoco_worker_main,
65
+ args=(self, ),
66
+ daemon=daemon,
67
+ )
68
+ self._worker_process.start()
69
+ self._init_event.wait()
70
+
71
+ def stop(self, timeout: Optional[float] = 5.0) -> None:
72
+ """Signal the worker to stop, then join. Uses `terminate` if join times out."""
73
+ self._stop_event.set()
74
+ proc = self._worker_process
75
+ if proc is None:
76
+ return
77
+ proc.join(timeout=timeout)
78
+ if proc.is_alive():
79
+ proc.terminate()
80
+ proc.join()
81
+ self._worker_process = None
82
+
83
+ @abstractmethod
84
+ def init_vars(self):
85
+ raise NotImplementedError(
86
+ "`init_vars` should be implemented by the child class")
87
+
88
+ @abstractmethod
89
+ def init_mujoco(self):
90
+ raise NotImplementedError(
91
+ "`init_mujoco` should be implemented by the child class")
92
+
93
+ @abstractmethod
94
+ def deinit_mujoco(self):
95
+ raise NotImplementedError(
96
+ "`deinit_mujoco` should be implemented by the child class")
97
+
98
+ @abstractmethod
99
+ def work_loop(self):
100
+ """Long-running camera read loop. Must return when `stop_event` is set (cooperative shutdown)."""
101
+ raise NotImplementedError(
102
+ "`work_loop` should be implemented by the child class")
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding:utf-8 -*-
3
+ ################################################################
4
+ # Copyright 2026 Dong Zhaorui. All rights reserved.
5
+ # Author: Dong Zhaorui 847235539@qq.com
6
+ # Date : 2026-03-23
7
+ ################################################################
8
+
9
+ from .mujoco import HexMujocoArcherY6, HexMujocoArcherY6Params
10
+
11
+ __all__ = [
12
+ "HexMujocoArcherY6",
13
+ "HexMujocoArcherY6Params",
14
+ ]
@@ -0,0 +1,17 @@
1
+ <mujocoinclude>
2
+ <mesh name="arm_base_link" file="arm_base_link.STL"/>
3
+ <mesh name="arm_link_1" file="arm_link_1.STL"/>
4
+ <mesh name="arm_link_2" file="arm_link_2.STL"/>
5
+ <mesh name="arm_link_3" file="arm_link_3.STL"/>
6
+ <mesh name="arm_link_4" file="arm_link_4.STL"/>
7
+ <mesh name="arm_link_5" file="arm_link_5.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"/>
15
+ <mesh name="camera_link" file="camera_link.STL"/>
16
+ <mesh name="table_link" file="table_link.STL" scale="0.001 0.001 0.001"/>
17
+ </mujocoinclude>
@@ -0,0 +1,23 @@
1
+ <mujocoinclude>
2
+ <default class="j1_class">
3
+ <joint armature="0.01" damping="0.02" frictionloss="0.2" actuatorfrcrange="-28 28"/>
4
+ </default>
5
+ <default class="j2_class">
6
+ <joint armature="0.01" damping="0.02" frictionloss="0.2" actuatorfrcrange="-28 28"/>
7
+ </default>
8
+ <default class="j3_class">
9
+ <joint armature="0.01" damping="0.02" frictionloss="0.2" actuatorfrcrange="-28 28"/>
10
+ </default>
11
+ <default class="j4_class">
12
+ <joint armature="0.01" damping="0.02" frictionloss="0.2" actuatorfrcrange="-28 28"/>
13
+ </default>
14
+ <default class="j5_class">
15
+ <joint armature="0.01" damping="0.02" frictionloss="0.05" actuatorfrcrange="-8 8"/>
16
+ </default>
17
+ <default class="j6_class">
18
+ <joint armature="0.01" damping="0.02" frictionloss="0.05" actuatorfrcrange="-8 8"/>
19
+ </default>
20
+ <default class="jg_class">
21
+ <joint armature="0.01" damping="0.02" frictionloss="0.05" actuatorfrcrange="-8 8"/>
22
+ </default>
23
+ </mujocoinclude>
@@ -0,0 +1,100 @@
1
+ <mujocoinclude>
2
+ <body name="base_link">
3
+ <inertial pos="-0.001 0 0.031" quat="0 0.707107 0 0.707107" mass="0.748" diaginertia="0.0008 0.0007 0.0006"/>
4
+ <geom type="mesh" rgba="1 1 1 1" mesh="arm_base_link"/>
5
+
6
+ # link 1
7
+ <body name="link_1" pos="0 0 0.06655">
8
+ <inertial pos="0.006 -0.0013 0.0209" quat="0.707107 0.707107 0 0" mass="0.2289" diaginertia="0.0004 0.0004 0.0002"/>
9
+ <joint name="joint_1" class="j1_class" pos="0 0 0" axis="0 0 1" range="-2.8623 2.8623" limited="true"/>
10
+ <geom type="mesh" rgba="0.92549 0.92549 0.92549 1" mesh="arm_link_1"/>
11
+
12
+ # link 2
13
+ <body name="link_2" pos="0.02 0 0.045">
14
+ <inertial pos="0.0001 -0.0013 0.1301" quat="0.999997 -0.00253798 0 0" mass="1.5141" diaginertia="0.021 0.0208005 0.00109949"/>
15
+ <joint name="joint_2" class="j2_class" pos="0 0 0" axis="0 1 0" range="-1.57 2.09" limited="true"/>
16
+ <geom type="mesh" rgba="1 1 1 1" mesh="arm_link_2"/>
17
+
18
+ # link 3
19
+ <body name="link_3" pos="0 0 0.264">
20
+ <inertial pos="-0.054 -0.0015 0.1603" quat="0.998349 0 -0.0574445 0" mass="1.2023" diaginertia="0.011127 0.0106 0.00147299"/>
21
+ <joint name="joint_3" class="j3_class" pos="0 0 0" axis="0 1 0" range="0 3.14" limited="true"/>
22
+ <geom type="mesh" rgba="1 1 1 1" mesh="arm_link_3"/>
23
+
24
+ # link 4
25
+ <body name="link_4" pos="-0.06 0 0.245">
26
+ <inertial pos="-0.058 -0.002 0.0558" quat="0 0.92388 0 0.382683" mass="0.6233" diaginertia="0.0015 0.0012 0.0007"/>
27
+ <joint name="joint_4" class="j4_class" pos="0 0 0" axis="0 1 0" range="-1.57 1.57" limited="true"/>
28
+ <geom type="mesh" rgba="0.792157 0.792157 0.792157 1" mesh="arm_link_4"/>
29
+
30
+ # link 5
31
+ <body name="link_5" pos="-0.0553 0 0.0702">
32
+ <inertial pos="0.0512 0 0.0026" quat="0.5 0.5 0.5 0.5" mass="0.4173" diaginertia="0.0003 0.0003 0.0002"/>
33
+ <joint name="joint_5" class="j5_class" pos="0 0 0" axis="-1 0 0" range="-1.57 1.57" limited="true"/>
34
+ <geom type="mesh" rgba="0.898039 0.917647 0.929412 1" mesh="arm_link_5"/>
35
+
36
+ # link 6
37
+ <body name="link_6" pos="0.0552 0 0.02895">
38
+ <inertial pos="-0.0139 0.0001 0.0578" quat="0.567843 0.421372 0.421372 0.567843" mass="0.7751" diaginertia="0.0021 0.00143028 0.00106972"/>
39
+ <joint name="joint_6" class="j6_class" pos="0 0 0" axis="0 0 1" range="-2.96 2.96" limited="true"/>
40
+
41
+ <body name="gripper_base_link" pos="0.0 0.0 0.0" quat="0.707107 0 -0.707107 0 ">
42
+ <inertial pos="0.0 0.0 0.0" quat="1.0 0.0 0.0 0.0" mass="0.0" diaginertia="0.0 0.0 0.0"/>
43
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_base_link"/>
44
+ <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" />
45
+ <camera name="end_camera" pos="0.066 0 0.105" quat="0.8660254 0.0 -0.5 0.0" fovy="50"/>
46
+
47
+ # ee frame
48
+ <body name="ee_frame" pos="0.1870 0.0 0.0" quat="1 0 0 0">
49
+ <inertial pos="0.0 0.0 0.0" quat="1.0 0.0 0.0 0.0" mass="0.0" diaginertia="0.0 0.0 0.0"/>
50
+ <geom type="cylinder" size="0.002 0.01" pos="0.01 0.00 0.00" quat="0.7071068 0.0000000 0.7071068 0.0000000" rgba="1 0 0 1" contype="0" conaffinity="0" group="4"/>
51
+ <geom type="cylinder" size="0.002 0.01" pos="0.00 0.01 0.00" quat="0.7071068 0.7071068 0.0000000 0.0000000" rgba="0 1 0 1" contype="0" conaffinity="0" group="4"/>
52
+ <geom type="cylinder" size="0.002 0.01" pos="0.00 0.00 0.01" quat="1.0000000 0.0000000 0.0000000 0.0000000" rgba="0 0 1 1" contype="0" conaffinity="0" group="4"/>
53
+ </body>
54
+
55
+ # gripper helper
56
+ <body name="gripper_left_helper_link" pos="0.057667 0.030604 2.5e-05">
57
+ <inertial pos="0.00299357 0.0232625 -5e-05" quat="0.996724 0 0 0.0808839" mass="1e-6" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
58
+ <joint name="gripper_left_help_joint" class="jg_class" pos="0 0 0" axis="0 0 -1" range="0 1.52" limited="true" />
59
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_left_helper_link"/>
60
+ </body>
61
+ <body name="gripper_right_helper_link" pos="0.057667 -0.030604 2.5e-05">
62
+ <inertial pos="0.00299357 -0.0232625 -5e-05" quat="0.996724 0 0 -0.0808839" mass="1e-6" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
63
+ <joint name="gripper_right_help_joint" class="jg_class" pos="0 0 0" axis="0 0 1" range="0 1.52" limited="true" />
64
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_right_helper_link"/>
65
+ </body>
66
+
67
+ # left gripper
68
+ <body name="gripper_left_link_1" pos="0.0721 0.014 2.5e-05">
69
+ <inertial pos="0.00299357 0.0232625 -5e-05" quat="0.996724 0 0 0.0808839" mass="1e-6" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
70
+ <joint name="gripper_left_joint_1" class="jg_class" pos="0 0 0" axis="0 0 -1" range="0 1.52" limited="true" />
71
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_left_link_1"/>
72
+
73
+ <body name="gripper_left_link_2" pos="0.0085108 0.04927 0">
74
+ <inertial pos="0.0255016 0.00914642 -0.00175617" quat="0.424541 0.412629 0.571518 0.568216" mass="1e-6" diaginertia="1.36949e-05 1.35554e-05 3.4264e-06"/>
75
+ <joint name="gripper_left_joint_2" class="jg_class" pos="0 0 0" axis="0 0 1" range="0 1.52" limited="true" />
76
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_left_link_2"/>
77
+ </body>
78
+ </body>
79
+
80
+ # right gripper
81
+ <body name="gripper_right_link_1" pos="0.0721 -0.014 2.5e-05">
82
+ <inertial pos="0.00299357 -0.0232625 -5e-05" quat="0.996724 0 0 -0.0808839" mass="1e-6" diaginertia="2.74798e-06 1.47567e-06 1.34732e-06"/>
83
+ <joint name="gripper_right_joint_1" class="jg_class" pos="0 0 0" axis="0 0 1" range="0 1.52" limited="true" />
84
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_right_link_1"/>
85
+
86
+ <body name="gripper_right_link_2" pos="0.0085108 -0.04927 0">
87
+ <inertial pos="0.0255016 -0.00914642 -0.00175616" quat="0.568212 0.571522 0.412623 0.424547" mass="1e-6" diaginertia="1.36948e-05 1.35553e-05 3.4264e-06"/>
88
+ <joint name="gripper_right_joint_2" class="jg_class" pos="0 0 0" axis="0 0 -1" range="0 1.52" limited="true" />
89
+ <geom type="mesh" rgba="1 1 1 1" mesh="gripper_right_link_2"/>
90
+ </body>
91
+ </body>
92
+ </body>
93
+ </body>
94
+ </body>
95
+ </body>
96
+ </body>
97
+ </body>
98
+ </body>
99
+ </body>
100
+ </mujocoinclude>
@@ -0,0 +1,55 @@
1
+ <mujoco model="archer_y6 scene">
2
+ <compiler angle="radian"/>
3
+ <option integrator="implicitfast"/>
4
+ <option timestep="1e-3"/>
5
+
6
+ <statistic center="0.3 0 0.45" extent="0.8" meansize="0.05"/>
7
+
8
+ <visual>
9
+ <headlight diffuse="0.6 0.6 0.6" ambient="0.1 0.1 0.1" specular="0 0 0"/>
10
+ <rgba haze="0.15 0.25 0.35 1"/>
11
+ <global azimuth="120" elevation="-20"/>
12
+ <map znear="0.01" zfar="50"/>
13
+ </visual>
14
+
15
+ <asset>
16
+ <texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="3072"/>
17
+ <texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3" markrgb="0.8 0.8 0.8" width="300" height="300"/>
18
+ <material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2"/>
19
+ <include file="assets/assets.xml"/>
20
+ </asset>
21
+
22
+ <default>
23
+ <include file="joint_class.xml"/>
24
+ </default>
25
+
26
+ <worldbody>
27
+ <light pos="0.0 0.0 1.5" directional="true"/>
28
+ <geom name="floor" size="0.0 0.0 0.05" type="plane" material="groundplane"/>
29
+
30
+ <body pos="0.0 0.0 0.25">
31
+ <include file="robot.xml"/>
32
+ </body>
33
+
34
+ <body name="table" pos="0.5 0.0 0.3" quat="0.707107 0 0 0.707107">
35
+ <geom mesh="table_link" pos="0 0 0" type="mesh" name="table" rgba="0.2 0.2 0.2 1" />
36
+ </body>
37
+ <body name="box" pos="0.5 0.0 0.5">
38
+ <joint name="red_box_joint" type="free" frictionloss="0.01" />
39
+ <inertial pos="0 0 0" mass="0.05" diaginertia="0.002 0.002 0.002" />
40
+ <geom condim="4" solimp="2 1 0.01" solref="0.01 1" friction="1 0.005 0.0001" pos="0 0 0" size="0.02 0.02 0.02" type="box" name="red_box" rgba="1 0 0 1" />
41
+ </body>
42
+ <geom name="tar_plane" pos="0.6 0.0 0.301" type="box" size="0.04 0.04 0.001" rgba="0 1 0 1" />
43
+ </worldbody>
44
+
45
+ <include file="setting.xml"/>
46
+
47
+ <keyframe>
48
+ # qpos: 12 + 7
49
+ # ctrl: 7
50
+ <key name="home" qpos="
51
+ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
52
+ 0.5 0.0 0.5 1.0 0.0 0.0 0.0" ctrl="
53
+ 0.0 0.0 0.0 0.0 0.0 0.0 0.0"/>
54
+ </keyframe>
55
+ </mujoco>