myo-sim 0.2.0__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.
- myo_sim-0.2.0/LICENSE +201 -0
- myo_sim-0.2.0/PKG-INFO +9 -0
- myo_sim-0.2.0/README.md +121 -0
- myo_sim-0.2.0/myo_sim/__init__.py +189 -0
- myo_sim-0.2.0/myo_sim/build/README.md +25 -0
- myo_sim-0.2.0/myo_sim/build/__init__.py +1 -0
- myo_sim-0.2.0/myo_sim/build/compose.py +727 -0
- myo_sim-0.2.0/myo_sim/build/hand.py +194 -0
- myo_sim-0.2.0/myo_sim/build/utils.py +428 -0
- myo_sim-0.2.0/myo_sim/fragments.py +44 -0
- myo_sim-0.2.0/myo_sim/models/arm/README.md +52 -0
- myo_sim-0.2.0/myo_sim/models/arm/README_hand.md +48 -0
- myo_sim-0.2.0/myo_sim/models/arm/assets/myoarm_r_assets.xml +127 -0
- myo_sim-0.2.0/myo_sim/models/arm/assets/myoarm_r_chain.xml +926 -0
- myo_sim-0.2.0/myo_sim/models/arm/assets/myoarm_r_muscle.xml +69 -0
- myo_sim-0.2.0/myo_sim/models/arm/assets/myoarm_r_tendon.xml +617 -0
- myo_sim-0.2.0/myo_sim/models/contacts/myoarm_contacts.xml +44 -0
- myo_sim-0.2.0/myo_sim/models/contacts/myofullbody_contacts.xml +26 -0
- myo_sim-0.2.0/myo_sim/models/contacts/myohand_contacts.xml +24 -0
- myo_sim-0.2.0/myo_sim/models/contacts/myolegs26_contacts.xml +30 -0
- myo_sim-0.2.0/myo_sim/models/contacts/myolegs_contacts.xml +36 -0
- myo_sim-0.2.0/myo_sim/models/head/README.md +30 -0
- myo_sim-0.2.0/myo_sim/models/head/assets/myohead_rigid_chain.xml +31 -0
- myo_sim-0.2.0/myo_sim/models/head/assets/myohead_simple_assets.xml +35 -0
- myo_sim-0.2.0/myo_sim/models/leg/README.md +81 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs26_assets.xml +78 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs26_chain.xml +240 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs26_muscle.xml +45 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs26_tendon.xml +167 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs_assets.xml +83 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs_chain.xml +536 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs_muscle.xml +91 -0
- myo_sim-0.2.0/myo_sim/models/leg/assets/myolegs_tendon.xml +501 -0
- myo_sim-0.2.0/myo_sim/models/legacy/README.md +52 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/README.md +34 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/assets/myoelbow_1dof6muscles_1dofexo_body.xml +185 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/assets/myoelbow_1dof6muscles_body.xml +174 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/assets/myoelbow_2dof6muscles_body.xml +175 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/assets/myoelbow_assets.xml +116 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/myoelbow_1dof6muscles.xml +16 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/myoelbow_1dof6muscles_1dofSoftexo_Ideal.xml +243 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/myoelbow_1dof6muscles_1dofSoftexo_sim2.xml +248 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/myoelbow_1dof6muscles_1dofexo.xml +16 -0
- myo_sim-0.2.0/myo_sim/models/legacy/elbow/myoelbow_2dof6muscles.xml +16 -0
- myo_sim-0.2.0/myo_sim/models/legacy/finger/README.md +21 -0
- myo_sim-0.2.0/myo_sim/models/legacy/finger/finger_v0.xml +128 -0
- myo_sim-0.2.0/myo_sim/models/legacy/finger/motorfinger_v0.xml +17 -0
- myo_sim-0.2.0/myo_sim/models/legacy/finger/myofinger_v0.xml +17 -0
- myo_sim-0.2.0/myo_sim/models/legacy/osl/README.md +127 -0
- myo_sim-0.2.0/myo_sim/models/legacy/osl/assets/myolegs_osl_assets.xml +511 -0
- myo_sim-0.2.0/myo_sim/models/legacy/osl/assets/myolegs_osl_chain.xml +438 -0
- myo_sim-0.2.0/myo_sim/models/legacy/osl/myolegs_osl.xml +40 -0
- myo_sim-0.2.0/myo_sim/models/legacy/torso/assets/myotorso_rigid_assets.xml +27 -0
- myo_sim-0.2.0/myo_sim/models/legacy/torso/assets/myotorso_rigid_chain.xml +25 -0
- myo_sim-0.2.0/myo_sim/models/meshes/1mc.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/2distph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/2mc.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/2midph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/2proxph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/3distph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/3mc.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/3midph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/3proxph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/4distph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/4mc.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/4midph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/4proxph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/5distph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/5mc.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/5midph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/5proxph.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/capitate.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/clavicle.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/ground_jaw.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/ground_skull.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/ground_spine.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/hamate.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/hat_cervical.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/hat_jaw.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/hat_lumbar.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/hat_ribs_scap.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/hat_skull.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/hat_thoracic.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/humerus.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_bofoot.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_femur.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_fibula.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_foot.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_patella.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_pelvis.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_talus.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/l_tibia.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lower_exo_belt.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lower_exo_legs.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lumbar1.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lumbar2.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lumbar3.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lumbar4.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lumbar5.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/lunate.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/osl_ankle_v2.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/osl_custom_foot_v2.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/osl_femur_trans_r.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/osl_generic_socket.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/osl_knee_v2.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/osl_proximal_adapter_v2.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/pisiform.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_bofoot.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_femur.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_fibula.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_foot.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_patella.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_pelvis.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_talus.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/r_tibia.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/radius.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/sacrum.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/scaphoid.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/scapula.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic10_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic11_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic12_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic1_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic2_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic3_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic4_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic5_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic6_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic7_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic8_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thoracic9_s.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thorax.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thumbdist.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/thumbprox.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/torso_lowpoly-v1.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/trapezium.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/trapezoid.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/triquetrum.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/ulna.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/meshes/upper_exo.stl +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/floor0.png +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myobody_skeleton_decor.xml +86 -0
- myo_sim-0.2.0/myo_sim/models/scene/myobody_skeleton_decor_assets.xml +42 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_icon.png +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_logo.msh +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_logo.mtl +45 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_logo.obj +58016 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_logo.png +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_quad.xml +58 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene.msh +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene.mtl +8 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene.obj +29991 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene.png +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene.xml +56 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_musclemimic.xml +19 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_noFloor.msh +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_noFloor.mtl +8 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_noFloor.obj +29981 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_noFloor.png +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_noFloor_noPedestal.msh +0 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_noFloor_noPedestal.obj +26704 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_scene_noPedestal.xml +57 -0
- myo_sim-0.2.0/myo_sim/models/scene/myosuite_warning.png +0 -0
- myo_sim-0.2.0/myo_sim/models/sensors/myofullbody_sensors.xml +110 -0
- myo_sim-0.2.0/myo_sim/models/sensors/myolegs26_sensors.xml +16 -0
- myo_sim-0.2.0/myo_sim/models/sensors/myolegs_sensors.xml +8 -0
- myo_sim-0.2.0/myo_sim/models/textures/ground_brown.png +0 -0
- myo_sim-0.2.0/myo_sim/models/textures/ground_grey.png +0 -0
- myo_sim-0.2.0/myo_sim/models/torso/README.md +56 -0
- myo_sim-0.2.0/myo_sim/models/torso/assets/myotorso_abdomen_muscle.xml +10 -0
- myo_sim-0.2.0/myo_sim/models/torso/assets/myotorso_abdomen_tendon.xml +31 -0
- myo_sim-0.2.0/myo_sim/models/torso/assets/myotorso_assets.xml +116 -0
- myo_sim-0.2.0/myo_sim/models/torso/assets/myotorso_chain.xml +780 -0
- myo_sim-0.2.0/myo_sim/models/torso/assets/myotorso_muscle.xml +214 -0
- myo_sim-0.2.0/myo_sim/models/torso/assets/myotorso_tendon.xml +1044 -0
- myo_sim-0.2.0/myo_sim.egg-info/PKG-INFO +9 -0
- myo_sim-0.2.0/myo_sim.egg-info/SOURCES.txt +195 -0
- myo_sim-0.2.0/myo_sim.egg-info/dependency_links.txt +1 -0
- myo_sim-0.2.0/myo_sim.egg-info/requires.txt +2 -0
- myo_sim-0.2.0/myo_sim.egg-info/top_level.txt +1 -0
- myo_sim-0.2.0/pyproject.toml +52 -0
- myo_sim-0.2.0/setup.cfg +4 -0
- myo_sim-0.2.0/tests/test_bimanual_muscle_symmetry.py +48 -0
- myo_sim-0.2.0/tests/test_build_registry.py +216 -0
- myo_sim-0.2.0/tests/test_chest_ownership.py +34 -0
- myo_sim-0.2.0/tests/test_contact_paths.py +118 -0
- myo_sim-0.2.0/tests/test_equivalence.py +503 -0
- myo_sim-0.2.0/tests/test_fragment_registry.py +114 -0
- myo_sim-0.2.0/tests/test_leg_muscle_symmetry.py +49 -0
- myo_sim-0.2.0/tests/test_legs_abdomen_build.py +93 -0
- myo_sim-0.2.0/tests/test_mirror_symmetry.py +88 -0
- myo_sim-0.2.0/tests/test_model_stability.py +28 -0
- myo_sim-0.2.0/tests/test_myohand_equivalence.py +118 -0
- myo_sim-0.2.0/tests/test_package_install.py +32 -0
- myo_sim-0.2.0/tests/test_passive_torso_build.py +32 -0
- myo_sim-0.2.0/tests/test_sims.py +114 -0
- myo_sim-0.2.0/tests/test_torso_muscle_symmetry.py +53 -0
myo_sim-0.2.0/LICENSE
ADDED
|
@@ -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.
|
myo_sim-0.2.0/PKG-INFO
ADDED
myo_sim-0.2.0/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# MyoSim
|
|
2
|
+
|
|
3
|
+
[](https://github.com/MyoHub/myo_sim/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](pyproject.toml)
|
|
6
|
+
|
|
7
|
+
MyoSim is the MuJoCo musculoskeletal model library used by [MyoSuite](https://github.com/facebookresearch/myoSuite).
|
|
8
|
+
It provides anatomically detailed XML models of the human arm, leg, torso, and hand,
|
|
9
|
+
plus a Python package for loading and composing them.
|
|
10
|
+
|
|
11
|
+
## Models
|
|
12
|
+
|
|
13
|
+
| Model | DoF | Muscles | Preview | Version |
|
|
14
|
+
|---|---:|---:|---|---|
|
|
15
|
+
| [**MyoLeg**](myo_sim/models/leg/README.md) | 29 | 80 | <img width="160" alt="Screenshot 2026-08-07 at 9 00 43 AM" src="https://github.com/user-attachments/assets/687308a3-29f0-4dfd-853f-5765e242dd62" />| stable |
|
|
16
|
+
| [**MyoArm**](myo_sim/models/arm/README.md) | 38 | 63 | <img alt="myoarm_demo" src="https://github.com/user-attachments/assets/eab77a8b-18af-445c-826f-b050b2a6ed7d" width="160"/> | stable |
|
|
17
|
+
| [**MyoTorso**](myo_sim/models/torso/README.md) (MyoBack) | 18 | 210 | <img src="https://github.com/cherylwang20/myo_sim/blob/cec3ce211a516a8798ed2edf9486a0814a0965da/MyoBack.png?raw=true" width="160"> | stable |
|
|
18
|
+
| [**MyoHand**](myo_sim/models/arm/README.md) | 23 | 39 | <img src="https://user-images.githubusercontent.com/23240128/232323950-39552200-614b-4c73-aab5-8a78daa0f5f3.png" width="160"> | stable |
|
|
19
|
+
| [**MyoFullBody**](docs/wiki/build-and-composition.md) | 123 | 416 | <img src="https://github.com/user-attachments/assets/37976636-1952-48a6-83c4-506722db4c82" width="160"/> | stable |
|
|
20
|
+
| [**MyoLeg26**](myo_sim/models/leg/README.md) | 18 | 26 | <img width="160" alt="Screenshot 2026-08-07 at 8 56 17 AM" src="https://github.com/user-attachments/assets/26b733d5-e47f-4d70-b2cc-b9e6f0fd1e7c" /> |beta |
|
|
21
|
+
| [**MyoFinger**](myo_sim/models/legacy/README.md) | 4 | 5 | <img src="https://user-images.githubusercontent.com/23240128/232323930-d1721f87-731b-432d-bafd-8c818ab4bbfe.png" width="160"> | legacy |
|
|
22
|
+
| [**MyoElbow**](myo_sim/models/legacy/README.md) | 2 | 6 | <img src="https://user-images.githubusercontent.com/23240128/232323890-6a601a82-1d3c-4e12-901c-0fd9cf232691.png" width="160"> | legacy |
|
|
23
|
+
|
|
24
|
+
Legacy models ship in the pip package under `myo_sim/models/legacy/` and load via registry names such as `myoelbow`, `myofinger`, and `osl`. They are maintained for backwards compatibility only — see `myo_sim/models/legacy/README.md`.
|
|
25
|
+
|
|
26
|
+
## Buildable Models
|
|
27
|
+
|
|
28
|
+
The following registered models can be compiled with `myo_sim.build.compose.build_model("<name>")`:
|
|
29
|
+
|
|
30
|
+
- `myotorso` — torso scaffold with torso muscles.
|
|
31
|
+
- `myotorso_abdomen` — simple abdomen scaffold.
|
|
32
|
+
- `myotorso_arm_r` — torso with the right arm only.
|
|
33
|
+
- `myotorso_arms` — torso with the right arm plus a mirrored-left arm.
|
|
34
|
+
- `myoarm_r` — passive anatomical torso scaffold with the right arm.
|
|
35
|
+
- `myoarms` — passive anatomical torso scaffold with mirrored arms.
|
|
36
|
+
- `myohand_r` — passive anatomical torso scaffold with the right hand derived from the pruned right arm.
|
|
37
|
+
- `myohands` — passive anatomical torso scaffold with right and mirrored-left hands derived from pruned arms.
|
|
38
|
+
- `myolegs` — passive anatomical torso scaffold with legs.
|
|
39
|
+
- `myolegs26` — passive anatomical torso scaffold with reduced-muscle legs and simplified kinematic chain.
|
|
40
|
+
- `myolegs_abdomen` — simple abdomen scaffold with legs.
|
|
41
|
+
- `myofullbody` — full body with torso, mirrored arms, and legs.
|
|
42
|
+
|
|
43
|
+
To generate compiled MuJoCo XML files for the primary composed assemblies, run:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
uv run python -m myo_sim.build.compose --generate
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This writes loadable XML files for `myoarms`, `myotorso`, `myolegs`, `myolegs26`, and `myofullbody` under `myo_sim/models/`. Treat these as generated snapshots for GUI viewing and compatibility; for source edits, update the component XML files and `myo_sim/build/compose.py`, then regenerate. Those downstream XMLs are not actively maintained.
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install git+https://github.com/MyoHub/myo_sim.git@dev
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Note: the PyPI package `myo-sim` currently points to an older incompatible version.
|
|
58
|
+
Use the git install above until a new release is published.
|
|
59
|
+
|
|
60
|
+
## Quickstart
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
import mujoco
|
|
64
|
+
import myo_sim
|
|
65
|
+
|
|
66
|
+
# Load a model by registry name
|
|
67
|
+
model, data = myo_sim.load("myolegs")
|
|
68
|
+
print(f"Joints: {model.njnt}, Muscles: {model.nu}")
|
|
69
|
+
|
|
70
|
+
# Or compose another registered model
|
|
71
|
+
model, data = myo_sim.load("myotorso")
|
|
72
|
+
|
|
73
|
+
# Legacy models (backwards compatibility)
|
|
74
|
+
model, data = myo_sim.load("myoelbow")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
# Compose a full-body MjSpec model
|
|
79
|
+
from myo_sim.build.compose import build_model
|
|
80
|
+
model = build_model("myofullbody")
|
|
81
|
+
print(f"Full body — joints: {model.njnt}, muscles: {model.nu}")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
git clone https://github.com/MyoHub/myo_sim.git
|
|
88
|
+
cd myo_sim
|
|
89
|
+
uv sync --dev
|
|
90
|
+
uv run pytest tests/ -x -n auto --ignore=tests/test_equivalence.py
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contributor guide.
|
|
94
|
+
|
|
95
|
+
## Citation
|
|
96
|
+
|
|
97
|
+
If you find this repository useful in your research, please cite the following works:
|
|
98
|
+
|
|
99
|
+
```bibtex
|
|
100
|
+
@misc{MyoSuite2022,
|
|
101
|
+
author = {Caggiano, Vittorio and Wang, Huawei and Durandau, Guillaume
|
|
102
|
+
and Sartori, Massimo and Kumar, Vikash},
|
|
103
|
+
title = {{MyoSuite}: A contact-rich simulation suite for musculoskeletal motor control},
|
|
104
|
+
year = {2022},
|
|
105
|
+
doi = {10.48550/ARXIV.2205.13600},
|
|
106
|
+
url = {https://arxiv.org/abs/2205.13600},
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
```bibtex
|
|
111
|
+
@article{Li2026MuscleMimic,
|
|
112
|
+
title={Towards Embodied AI with MuscleMimic: Unlocking full-body musculoskeletal motor learning at scale},
|
|
113
|
+
author={Li, Chengkun and Wang, Cheryl and Ziliotto, Bianca and Simos, Merkourios and Kovecses, Jozsef and Durandau, Guillaume and Mathis, Alexander},
|
|
114
|
+
journal={arXiv preprint arXiv:2603.25544},
|
|
115
|
+
year={2026}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
Apache 2.0 — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from myo_sim.fragments import FragmentInfo as FragmentInfo
|
|
6
|
+
from myo_sim.fragments import FragmentRegistry as FragmentRegistry
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
import mujoco
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
__version__ = version("myo-sim")
|
|
13
|
+
except PackageNotFoundError:
|
|
14
|
+
__version__ = "0.0.0+unknown"
|
|
15
|
+
|
|
16
|
+
# Root of the packaged XML model tree.
|
|
17
|
+
MODELS_DIR = Path(__file__).resolve().parent / "models"
|
|
18
|
+
|
|
19
|
+
# Catalog of static XML fragments: (name, rel_path, version).
|
|
20
|
+
# Only list models whose XML files are actually present in myo_sim/models/.
|
|
21
|
+
# Legacy names match myosuite's _FALLBACK_PATHS so ModelBuilder resolves them
|
|
22
|
+
# via FragmentRegistry before falling back to the simhive submodule.
|
|
23
|
+
_FRAGMENT_CATALOG: list[tuple[str, str, int]] = [
|
|
24
|
+
# Legacy models — pending proper migration (see legacy/README.md).
|
|
25
|
+
("elbow", "legacy/elbow/myoelbow_1dof6muscles.xml", 1),
|
|
26
|
+
("myoelbow", "legacy/elbow/myoelbow_1dof6muscles.xml", 1),
|
|
27
|
+
("myoelbow_2dof", "legacy/elbow/myoelbow_2dof6muscles.xml", 1),
|
|
28
|
+
("myoelbow_exo", "legacy/elbow/myoelbow_1dof6muscles_1dofexo.xml", 1),
|
|
29
|
+
("finger", "legacy/finger/myofinger_v0.xml", 1),
|
|
30
|
+
("myofinger", "legacy/finger/myofinger_v0.xml", 1),
|
|
31
|
+
("osl", "legacy/osl/myolegs_osl.xml", 1),
|
|
32
|
+
("myolegs_osl", "legacy/osl/myolegs_osl.xml", 1),
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
REGISTRY: dict[str, str] = {}
|
|
36
|
+
|
|
37
|
+
for _name, _rel, _ver in _FRAGMENT_CATALOG:
|
|
38
|
+
_p = MODELS_DIR / _rel
|
|
39
|
+
if _p.exists():
|
|
40
|
+
FragmentRegistry._store[_name] = FragmentInfo(name=_name, path=_p, version=_ver)
|
|
41
|
+
REGISTRY[_name] = _rel
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def get_xml_path(name: str) -> Path:
|
|
45
|
+
"""Return the absolute Path to a named model XML.
|
|
46
|
+
|
|
47
|
+
Raises ValueError for unknown names.
|
|
48
|
+
"""
|
|
49
|
+
if name not in REGISTRY:
|
|
50
|
+
raise ValueError(f"Unknown model {name!r}. Available: {sorted(REGISTRY)}")
|
|
51
|
+
return MODELS_DIR / REGISTRY[name]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _composed_models() -> frozenset[str]:
|
|
55
|
+
"""Names loadable via the MjSpec compose pipeline (registry keys + aliases).
|
|
56
|
+
|
|
57
|
+
Derived from ``MODEL_REGISTRY`` and ``ALIASES`` so there is a single source
|
|
58
|
+
of truth; importing compose here (rather than at module top) keeps
|
|
59
|
+
``import myo_sim`` free of a MuJoCo dependency.
|
|
60
|
+
"""
|
|
61
|
+
from myo_sim.build.compose import ALIASES, MODEL_REGISTRY
|
|
62
|
+
|
|
63
|
+
return frozenset(MODEL_REGISTRY) | frozenset(ALIASES)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def __getattr__(name: str):
|
|
67
|
+
# Preserve the historical ``myo_sim._COMPOSED_MODELS`` attribute while keeping
|
|
68
|
+
# its contents derived from the compose registry instead of a hand-kept copy.
|
|
69
|
+
if name == "_COMPOSED_MODELS":
|
|
70
|
+
return _composed_models()
|
|
71
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _right_hand_spec():
|
|
75
|
+
from myo_sim.build.compose import load_right_hand_from_arm_spec
|
|
76
|
+
|
|
77
|
+
return load_right_hand_from_arm_spec()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _left_hand_spec():
|
|
81
|
+
from myo_sim.build.compose import load_left_hand_from_arm_spec
|
|
82
|
+
|
|
83
|
+
return load_left_hand_from_arm_spec()
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _legs_spec():
|
|
87
|
+
from myo_sim.build.compose import load_legs_spec
|
|
88
|
+
|
|
89
|
+
return load_legs_spec()
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _legs26_spec():
|
|
93
|
+
from myo_sim.build.compose import load_legs26_spec
|
|
94
|
+
|
|
95
|
+
return load_legs26_spec()
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# TODO: there should be a myohand_l alias, which should work with load. Also a given name (myolegs) should refer to the
|
|
99
|
+
# same model consistently.
|
|
100
|
+
# Maps fragment names to zero-arg callables returning an editable (uncompiled)
|
|
101
|
+
# MjSpec, with no torso scaffold. Used by downstream consumers (e.g. myosuite
|
|
102
|
+
# ModelBuilder, assist_sim) so that attaching a fragment routes through the compose
|
|
103
|
+
# pipeline instead of falling back to a bundled static XML. Includes myohand_l
|
|
104
|
+
# (left hand only); there is no myo_sim.load("myohand_l") alias — use this dict or
|
|
105
|
+
# myohands instead. Note "myolegs" here is the bare legs fragment; myo_sim.load(
|
|
106
|
+
# "myolegs") differs in that it attaches the legs to a passive torso scaffold.
|
|
107
|
+
FRAGMENT_SPEC_BUILDERS: dict[str, object] = {
|
|
108
|
+
"hand": _right_hand_spec,
|
|
109
|
+
"myohand": _right_hand_spec,
|
|
110
|
+
"myohand_r": _right_hand_spec,
|
|
111
|
+
"myohand_l": _left_hand_spec,
|
|
112
|
+
"myolegs": _legs_spec,
|
|
113
|
+
"myolegs26": _legs26_spec,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def load(name: str) -> tuple:
|
|
118
|
+
"""Load a MuJoCo model by registry name. Returns (MjModel, MjData).
|
|
119
|
+
|
|
120
|
+
Supports MjSpec-composed models such as myohand_r, myohands, myoarms,
|
|
121
|
+
myofullbody, and myolegs, plus packaged legacy static XMLs. For a
|
|
122
|
+
left-hand-only MjSpec builder, use FRAGMENT_SPEC_BUILDERS["myohand_l"].
|
|
123
|
+
"""
|
|
124
|
+
import mujoco
|
|
125
|
+
|
|
126
|
+
model = load_model(name)
|
|
127
|
+
return model, mujoco.MjData(model)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def load_model(name: str) -> tuple:
|
|
131
|
+
spec = load_spec(name)
|
|
132
|
+
model = spec.compile()
|
|
133
|
+
return model
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def load_spec(name: str) -> "mujoco.MjSpec":
|
|
137
|
+
"""Build and return the uncompiled MjSpec for a named model.
|
|
138
|
+
|
|
139
|
+
Unlike load(), this stops at the editable MjSpec so downstream consumers
|
|
140
|
+
(e.g. assist_sim) can edit the model -- attach devices, delete bodies, add
|
|
141
|
+
actuators -- before compiling it themselves.
|
|
142
|
+
"""
|
|
143
|
+
import mujoco
|
|
144
|
+
|
|
145
|
+
from myo_sim.build.compose import ALIASES, build_spec
|
|
146
|
+
|
|
147
|
+
composed_models = _composed_models()
|
|
148
|
+
if name in composed_models:
|
|
149
|
+
# Legacy aliases (e.g. hand, myohand, myoarm) resolve to a registry entry.
|
|
150
|
+
composed_name = ALIASES.get(name, name)
|
|
151
|
+
spec = build_spec(composed_name)
|
|
152
|
+
return spec
|
|
153
|
+
|
|
154
|
+
if name not in REGISTRY:
|
|
155
|
+
available = sorted(composed_models | frozenset(REGISTRY))
|
|
156
|
+
raise ValueError(f"Unknown model {name!r}. Available: {available}")
|
|
157
|
+
|
|
158
|
+
spec = mujoco.MjSpec.from_file(str(get_xml_path(name)))
|
|
159
|
+
return spec
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def get_path(rel: str) -> Path:
|
|
163
|
+
"""Return the absolute Path to a model file by relative path within MODELS_DIR.
|
|
164
|
+
|
|
165
|
+
This is a convenience wrapper for scripts and tutorials that prefer to
|
|
166
|
+
reference models by relative path (e.g. ``"scene/myosuite_scene.xml"``)
|
|
167
|
+
rather than registry name.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
rel: Relative path inside MODELS_DIR, e.g. ``"scene/myosuite_scene.xml"``.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
Absolute Path to the file.
|
|
174
|
+
|
|
175
|
+
Raises:
|
|
176
|
+
FileNotFoundError: If the path does not exist.
|
|
177
|
+
"""
|
|
178
|
+
p = MODELS_DIR / rel
|
|
179
|
+
if not p.exists():
|
|
180
|
+
raise FileNotFoundError(f"Model file not found: {p}")
|
|
181
|
+
return p
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def print_path(name: str | None = None) -> None:
|
|
185
|
+
"""Print packaged model file paths."""
|
|
186
|
+
if name:
|
|
187
|
+
print(get_path(name))
|
|
188
|
+
else:
|
|
189
|
+
print(MODELS_DIR)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# MjSpec Prototypes
|
|
2
|
+
|
|
3
|
+
This folder contains prototype utilities for composing MuJoCo models with
|
|
4
|
+
`mujoco.MjSpec` instead of relying only on static MJCF includes.
|
|
5
|
+
|
|
6
|
+
The main entry point is:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
uv run python -m myo_sim.build.compose --model myotorso_arms --view
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Available registered models:
|
|
13
|
+
|
|
14
|
+
- `myotorso_arms`: full torso plus right arm and a mirrored-left arm.
|
|
15
|
+
- `myoarm_r`: passive anatomical torso scaffold plus right arm only.
|
|
16
|
+
- `myotorso_arm_r`: full torso plus right arm only.
|
|
17
|
+
- `myofullbody`: torso, mirrored arms, and legs.
|
|
18
|
+
- `myolegs26`: passive anatomical torso scaffold with reduced 26-muscle legs.
|
|
19
|
+
- `myolegs_abdomen`: simple abdomen scaffold plus legs.
|
|
20
|
+
- `myoarms`: passive anatomical torso scaffold plus mirrored arms.
|
|
21
|
+
- `myohand_r`: passive anatomical torso scaffold plus a right hand derived by pruning `myoarm_r`.
|
|
22
|
+
- `myohands`: passive anatomical torso scaffold plus right and mirrored-left hands derived from arm specs.
|
|
23
|
+
|
|
24
|
+
`utils.py` contains shared XML and mirroring helpers. `hand.py` contains the
|
|
25
|
+
hand-specific pruning logic used to derive hand-only specs from arm specs.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""MjSpec composition prototypes for MyoSim models."""
|