urdf2any 0.1.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.
Files changed (57) hide show
  1. urdf2any-0.1.0/.gitattributes +12 -0
  2. urdf2any-0.1.0/.github/workflows/ci.yml +47 -0
  3. urdf2any-0.1.0/.github/workflows/release.yml +73 -0
  4. urdf2any-0.1.0/.gitignore +19 -0
  5. urdf2any-0.1.0/AGENTS.md +27 -0
  6. urdf2any-0.1.0/CLAUDE.md +1 -0
  7. urdf2any-0.1.0/LICENSE +202 -0
  8. urdf2any-0.1.0/PKG-INFO +138 -0
  9. urdf2any-0.1.0/README.md +111 -0
  10. urdf2any-0.1.0/pyproject.toml +60 -0
  11. urdf2any-0.1.0/scripts/generate_reference.py +117 -0
  12. urdf2any-0.1.0/src/urdf2any/__init__.py +77 -0
  13. urdf2any-0.1.0/src/urdf2any/backends/__init__.py +0 -0
  14. urdf2any-0.1.0/src/urdf2any/backends/mjcf.py +318 -0
  15. urdf2any-0.1.0/src/urdf2any/backends/usd.py +438 -0
  16. urdf2any-0.1.0/src/urdf2any/cli.py +179 -0
  17. urdf2any-0.1.0/src/urdf2any/config.py +318 -0
  18. urdf2any-0.1.0/src/urdf2any/geom_inertia.py +96 -0
  19. urdf2any-0.1.0/src/urdf2any/ir.py +180 -0
  20. urdf2any-0.1.0/src/urdf2any/mesh.py +96 -0
  21. urdf2any-0.1.0/src/urdf2any/transforms.py +135 -0
  22. urdf2any-0.1.0/src/urdf2any/urdf/__init__.py +3 -0
  23. urdf2any-0.1.0/src/urdf2any/urdf/parser.py +267 -0
  24. urdf2any-0.1.0/tests/assets/franka/NOTICE +15 -0
  25. urdf2any-0.1.0/tests/assets/franka/meshes/panda_hand.stl +3 -0
  26. urdf2any-0.1.0/tests/assets/franka/meshes/panda_leftfinger.stl +3 -0
  27. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link0.stl +3 -0
  28. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link1.stl +3 -0
  29. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link2.stl +3 -0
  30. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link3.stl +3 -0
  31. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link4.stl +3 -0
  32. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link5.stl +3 -0
  33. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link6.stl +3 -0
  34. urdf2any-0.1.0/tests/assets/franka/meshes/panda_link7.stl +3 -0
  35. urdf2any-0.1.0/tests/assets/franka/meshes/panda_rightfinger.stl +3 -0
  36. urdf2any-0.1.0/tests/assets/franka/robot.urdf +434 -0
  37. urdf2any-0.1.0/tests/assets/simple_2_link/NOTICE +12 -0
  38. urdf2any-0.1.0/tests/assets/simple_2_link/simple_2_link.urdf +82 -0
  39. urdf2any-0.1.0/tests/conftest.py +58 -0
  40. urdf2any-0.1.0/tests/fixtures/two_link.urdf +63 -0
  41. urdf2any-0.1.0/tests/golden/franka.json +491 -0
  42. urdf2any-0.1.0/tests/golden/franka_merged.json +174 -0
  43. urdf2any-0.1.0/tests/golden/simple_2_link.json +116 -0
  44. urdf2any-0.1.0/tests/golden/simple_2_link_merged.json +72 -0
  45. urdf2any-0.1.0/tests/parity/samples.json +45 -0
  46. urdf2any-0.1.0/tests/test_cli.py +110 -0
  47. urdf2any-0.1.0/tests/test_config.py +81 -0
  48. urdf2any-0.1.0/tests/test_golden_parity.py +69 -0
  49. urdf2any-0.1.0/tests/test_merge_fixed_joints.py +208 -0
  50. urdf2any-0.1.0/tests/test_mjcf_backend.py +184 -0
  51. urdf2any-0.1.0/tests/test_mjcf_parity.py +74 -0
  52. urdf2any-0.1.0/tests/test_parser.py +93 -0
  53. urdf2any-0.1.0/tests/test_transforms.py +59 -0
  54. urdf2any-0.1.0/tests/test_usd_backend.py +141 -0
  55. urdf2any-0.1.0/tools/compare_mjcf.py +118 -0
  56. urdf2any-0.1.0/tools/compare_usd.py +239 -0
  57. urdf2any-0.1.0/uv.lock +500 -0
@@ -0,0 +1,12 @@
1
+ # Binary robot assets are stored via Git LFS to keep the repo small.
2
+ # (URDF/MJCF/JSON/OBJ stay as normal text so they remain diffable.)
3
+ *.stl filter=lfs diff=lfs merge=lfs -text
4
+ *.STL filter=lfs diff=lfs merge=lfs -text
5
+ *.dae filter=lfs diff=lfs merge=lfs -text
6
+ *.fbx filter=lfs diff=lfs merge=lfs -text
7
+ *.glb filter=lfs diff=lfs merge=lfs -text
8
+ *.ply filter=lfs diff=lfs merge=lfs -text
9
+ *.usdz filter=lfs diff=lfs merge=lfs -text
10
+ *.png filter=lfs diff=lfs merge=lfs -text
11
+ *.jpg filter=lfs diff=lfs merge=lfs -text
12
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,47 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.11", "3.12"]
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with:
17
+ lfs: true # parity test loads vendored LFS meshes (tests/assets/franka)
18
+ - name: Set up uv
19
+ uses: astral-sh/setup-uv@v5
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+ enable-cache: true
23
+ - name: Install dependencies
24
+ run: uv sync --locked
25
+ - name: Lint
26
+ run: uv run ruff check --output-format=github .
27
+ - name: Test
28
+ run: uv run pytest
29
+
30
+ build:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: Set up uv
35
+ uses: astral-sh/setup-uv@v5
36
+ with:
37
+ python-version: "3.12"
38
+ enable-cache: true
39
+ - name: Build wheel and sdist
40
+ run: uv build
41
+ - name: Check that the wheel is installable
42
+ run: uv run --no-project --with dist/*.whl python -c "import urdf2any; print(urdf2any.__name__)"
43
+ - name: Upload distributions
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: dist
47
+ path: dist/
@@ -0,0 +1,73 @@
1
+ name: Release
2
+
3
+ # Publish to PyPI on version tags (e.g. v0.1.0).
4
+ # Uses PyPI Trusted Publishing (OIDC) — no API token needed. Configure the
5
+ # trusted publisher on PyPI: project urdf2any, workflow release.yml, env pypi.
6
+ on:
7
+ push:
8
+ tags: ["v*"]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ persist-credentials: false
17
+ - name: Set up uv
18
+ uses: astral-sh/setup-uv@v5
19
+ with:
20
+ python-version: "3.12"
21
+ - name: Build wheel and sdist
22
+ run: uv build
23
+ - name: Upload distributions
24
+ uses: actions/upload-artifact@v4
25
+ with:
26
+ name: dist
27
+ path: dist/
28
+
29
+ publish-to-pypi:
30
+ needs: build
31
+ runs-on: ubuntu-latest
32
+ environment:
33
+ name: pypi
34
+ url: https://pypi.org/p/urdf2any
35
+ permissions:
36
+ id-token: write # mandatory for trusted publishing
37
+ steps:
38
+ - uses: actions/download-artifact@v4
39
+ with:
40
+ name: dist
41
+ path: dist/
42
+ - name: Publish to PyPI
43
+ uses: pypa/gh-action-pypi-publish@release/v1
44
+
45
+ github-release:
46
+ needs: publish-to-pypi
47
+ runs-on: ubuntu-latest
48
+ permissions:
49
+ contents: write # mandatory for creating the GitHub Release
50
+ id-token: write # mandatory for sigstore signing
51
+ steps:
52
+ - uses: actions/download-artifact@v4
53
+ with:
54
+ name: dist
55
+ path: dist/
56
+ - name: Sign distributions with Sigstore
57
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
58
+ with:
59
+ inputs: >-
60
+ ./dist/*.tar.gz
61
+ ./dist/*.whl
62
+ - name: Create GitHub Release
63
+ env:
64
+ GITHUB_TOKEN: ${{ github.token }}
65
+ run: >-
66
+ gh release create "$GITHUB_REF_NAME"
67
+ --repo "$GITHUB_REPOSITORY"
68
+ --title "$GITHUB_REF_NAME"
69
+ --notes ""
70
+ - name: Upload signed artifacts to the release
71
+ env:
72
+ GITHUB_TOKEN: ${{ github.token }}
73
+ run: gh release upload "$GITHUB_REF_NAME" dist/** --repo "$GITHUB_REPOSITORY"
@@ -0,0 +1,19 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+
8
+ # Build
9
+ dist/
10
+ build/
11
+ *.usd
12
+ *.usda
13
+ *.usdc
14
+
15
+ # Env
16
+ .venv/
17
+
18
+ # implementation memo
19
+ docs/
@@ -0,0 +1,27 @@
1
+ # urdf2any
2
+
3
+ A pure-Python tool that converts URDF to USD / MJCF, independent of Isaac Sim and Omniverse.
4
+
5
+ ## Architecture
6
+
7
+ URDF → parser (`src/urdf2any/urdf/parser.py`) → simulator-agnostic IR
8
+ (`src/urdf2any/ir.py`) → backends (`src/urdf2any/backends/usd.py`,
9
+ `src/urdf2any/backends/mjcf.py`). Generic IR preprocessing (fixed-joint merging,
10
+ drive injection, geometry exclusion) lives in `src/urdf2any/config.py`.
11
+
12
+ ## Rules
13
+
14
+ - The IR uses SI units and radians. Unit conversion is the backend's
15
+ responsibility (USD uses degrees).
16
+ - Keep robot-specific policy (link name literals, part removal, gain values) out
17
+ of the core; provide only generic, declarative mechanisms. Callers mutate the
18
+ IR via `parse_urdf` → `convert_robot`.
19
+ - Long-lived knowledge belongs in code, not documents: module docstrings state
20
+ conventions and known divergences; the parity suites encode verified behavior.
21
+ Do not add documentation files beyond the README.
22
+ - Compatibility claims must be backed by a parity test. After changing
23
+ conversion behavior, run `uv run pytest` — `tests/test_golden_parity.py`
24
+ compares against IsaacLab importer goldens (`tests/golden/`) and
25
+ `tests/test_mjcf_parity.py` compares live against MuJoCo's native URDF loader.
26
+ - Regenerating USD goldens requires an IsaacLab container:
27
+ `scripts/generate_reference.py` (see its docstring; the import needs no GPU).
@@ -0,0 +1 @@
1
+ AGENTS.md
urdf2any-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.4
2
+ Name: urdf2any
3
+ Version: 0.1.0
4
+ Summary: Convert URDF robot descriptions to USD and MJCF without Isaac Sim or Omniverse
5
+ Project-URL: Homepage, https://github.com/syundo0730/urdf2any
6
+ Project-URL: Repository, https://github.com/syundo0730/urdf2any
7
+ Project-URL: Issues, https://github.com/syundo0730/urdf2any/issues
8
+ Author: Shundo Kishi
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: mjcf,mujoco,openusd,robotics,simulation,urdf,usd
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Scientific/Engineering
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: numpy>=1.24
21
+ Requires-Dist: scipy>=1.10
22
+ Requires-Dist: trimesh>=4.0
23
+ Requires-Dist: usd-core>=24.5
24
+ Provides-Extra: mjcf-validate
25
+ Requires-Dist: mujoco>=3.0; extra == 'mjcf-validate'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # urdf2any
29
+
30
+ [![CI](https://github.com/syundo0730/urdf2any/actions/workflows/ci.yml/badge.svg)](https://github.com/syundo0730/urdf2any/actions/workflows/ci.yml)
31
+ [![PyPI](https://img.shields.io/pypi/v/urdf2any)](https://pypi.org/project/urdf2any/)
32
+ [![Python](https://img.shields.io/pypi/pyversions/urdf2any)](https://pypi.org/project/urdf2any/)
33
+ [![License](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)
34
+
35
+ Convert URDF robot descriptions to **USD** (OpenUSD / Isaac Sim) and **MJCF**
36
+ (MuJoCo) — in pure Python, with no Isaac Sim, Omniverse, or GPU required.
37
+
38
+ - **Self-contained** — runs anywhere `pip` works (`usd-core`, `trimesh`, `numpy`)
39
+ - **One source of truth** — a single simulator-agnostic intermediate
40
+ representation drives both backends, so USD and MJCF describe the same
41
+ physical robot
42
+ - **Verified** — output is checked in CI against the real reference
43
+ implementations: the IsaacLab URDF importer (golden comparison) and MuJoCo's
44
+ native URDF loader (live comparison)
45
+
46
+ ## Installation
47
+
48
+ ```bash
49
+ pip install urdf2any
50
+ ```
51
+
52
+ ## Quick start
53
+
54
+ The output format is inferred from the file extension:
55
+
56
+ ```bash
57
+ urdf2any robot.urdf -o robot.usd # USD (UsdPhysics articulation)
58
+ urdf2any robot.urdf -o robot.xml # MJCF (with actuators)
59
+ ```
60
+
61
+ Or from Python:
62
+
63
+ ```python
64
+ from urdf2any import convert, ConvertConfig, JointDriveCfg
65
+
66
+ convert(
67
+ "robot.urdf",
68
+ "robot.usd",
69
+ ConvertConfig(joint_drive=JointDriveCfg(stiffness=100.0, damping=1.0)),
70
+ )
71
+ ```
72
+
73
+ By default every URDF link becomes one body and no lossy transformation is
74
+ applied — the same config yields the same robot in both formats.
75
+
76
+ ## Compatibility presets
77
+
78
+ To reproduce the behavior of an existing converter, start from a preset;
79
+ individual flags still override it:
80
+
81
+ ```bash
82
+ urdf2any robot.urdf -o robot.usd --preset isaaclab # IsaacLab URDF importer defaults
83
+ urdf2any robot.urdf -o robot.xml --preset mujoco # MuJoCo native URDF conversion
84
+ ```
85
+
86
+ | Preset | Matches | Effect |
87
+ |---|---|---|
88
+ | `isaaclab` | IsaacLab `UrdfConverter` defaults | merges all fixed-joint links |
89
+ | `mujoco` | MuJoCo's built-in URDF loader | merges fixed-joint links and derives missing link masses from collision geometry (needs `pip install "urdf2any[mjcf-validate]"`) |
90
+
91
+ The same presets are available in Python as `ConvertConfig.isaaclab()` /
92
+ `ConvertConfig.mujoco()`, and their definitions are what the parity test suites
93
+ validate against the real implementations.
94
+
95
+ ## Feature support
96
+
97
+ | | |
98
+ |---|---|
99
+ | Joints | revolute, continuous, prismatic, fixed (optional merging with inertia composition) |
100
+ | Geometry | box, sphere, cylinder, capsule, mesh (STL / OBJ / DAE via trimesh) |
101
+ | Inertials | authored mass/inertia/COM; optional geometry-derived backfill via MuJoCo |
102
+ | Drives | position / velocity PD gains → USD DriveAPI / MJCF actuators |
103
+ | Materials | URDF colors → UsdPreviewSurface / MJCF materials |
104
+ | Not yet | mimic joints, sensors, `package://` ROS package resolution beyond a search root |
105
+
106
+ Robot-specific preprocessing (renaming links, removing parts) is deliberately
107
+ out of scope: parse with `parse_urdf`, mutate the IR, then emit with
108
+ `convert_robot`.
109
+
110
+ ## Development
111
+
112
+ ```bash
113
+ uv sync
114
+ uv run pytest # includes the parity suites (CPU only)
115
+ uv run ruff check .
116
+ ```
117
+
118
+ Releases are published to PyPI by pushing a `vX.Y.Z` tag
119
+ (Trusted Publishing via `.github/workflows/release.yml`).
120
+
121
+ ### Parity testing
122
+
123
+ - **USD vs IsaacLab importer** — `tests/test_golden_parity.py` diffs urdf2any's
124
+ output against committed golden summaries (`tests/golden/`) generated by the
125
+ real importer. Regenerate them inside an IsaacLab container with
126
+ `scripts/generate_reference.py` (the import itself needs no GPU).
127
+ - **MJCF vs MuJoCo** — `tests/test_mjcf_parity.py` compiles both urdf2any's MJCF
128
+ and the source URDF with MuJoCo and compares the resulting models live; no
129
+ golden files needed.
130
+
131
+ Sample robots under `tests/assets/` are vendored from
132
+ [IsaacLab](https://github.com/isaac-sim/IsaacLab) (BSD-3-Clause) and
133
+ [Isaac Sim](https://github.com/isaac-sim/IsaacSim) (Apache-2.0); see the
134
+ `NOTICE` file next to each.
135
+
136
+ ## License
137
+
138
+ [Apache-2.0](LICENSE)
@@ -0,0 +1,111 @@
1
+ # urdf2any
2
+
3
+ [![CI](https://github.com/syundo0730/urdf2any/actions/workflows/ci.yml/badge.svg)](https://github.com/syundo0730/urdf2any/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/urdf2any)](https://pypi.org/project/urdf2any/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/urdf2any)](https://pypi.org/project/urdf2any/)
6
+ [![License](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)
7
+
8
+ Convert URDF robot descriptions to **USD** (OpenUSD / Isaac Sim) and **MJCF**
9
+ (MuJoCo) — in pure Python, with no Isaac Sim, Omniverse, or GPU required.
10
+
11
+ - **Self-contained** — runs anywhere `pip` works (`usd-core`, `trimesh`, `numpy`)
12
+ - **One source of truth** — a single simulator-agnostic intermediate
13
+ representation drives both backends, so USD and MJCF describe the same
14
+ physical robot
15
+ - **Verified** — output is checked in CI against the real reference
16
+ implementations: the IsaacLab URDF importer (golden comparison) and MuJoCo's
17
+ native URDF loader (live comparison)
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ pip install urdf2any
23
+ ```
24
+
25
+ ## Quick start
26
+
27
+ The output format is inferred from the file extension:
28
+
29
+ ```bash
30
+ urdf2any robot.urdf -o robot.usd # USD (UsdPhysics articulation)
31
+ urdf2any robot.urdf -o robot.xml # MJCF (with actuators)
32
+ ```
33
+
34
+ Or from Python:
35
+
36
+ ```python
37
+ from urdf2any import convert, ConvertConfig, JointDriveCfg
38
+
39
+ convert(
40
+ "robot.urdf",
41
+ "robot.usd",
42
+ ConvertConfig(joint_drive=JointDriveCfg(stiffness=100.0, damping=1.0)),
43
+ )
44
+ ```
45
+
46
+ By default every URDF link becomes one body and no lossy transformation is
47
+ applied — the same config yields the same robot in both formats.
48
+
49
+ ## Compatibility presets
50
+
51
+ To reproduce the behavior of an existing converter, start from a preset;
52
+ individual flags still override it:
53
+
54
+ ```bash
55
+ urdf2any robot.urdf -o robot.usd --preset isaaclab # IsaacLab URDF importer defaults
56
+ urdf2any robot.urdf -o robot.xml --preset mujoco # MuJoCo native URDF conversion
57
+ ```
58
+
59
+ | Preset | Matches | Effect |
60
+ |---|---|---|
61
+ | `isaaclab` | IsaacLab `UrdfConverter` defaults | merges all fixed-joint links |
62
+ | `mujoco` | MuJoCo's built-in URDF loader | merges fixed-joint links and derives missing link masses from collision geometry (needs `pip install "urdf2any[mjcf-validate]"`) |
63
+
64
+ The same presets are available in Python as `ConvertConfig.isaaclab()` /
65
+ `ConvertConfig.mujoco()`, and their definitions are what the parity test suites
66
+ validate against the real implementations.
67
+
68
+ ## Feature support
69
+
70
+ | | |
71
+ |---|---|
72
+ | Joints | revolute, continuous, prismatic, fixed (optional merging with inertia composition) |
73
+ | Geometry | box, sphere, cylinder, capsule, mesh (STL / OBJ / DAE via trimesh) |
74
+ | Inertials | authored mass/inertia/COM; optional geometry-derived backfill via MuJoCo |
75
+ | Drives | position / velocity PD gains → USD DriveAPI / MJCF actuators |
76
+ | Materials | URDF colors → UsdPreviewSurface / MJCF materials |
77
+ | Not yet | mimic joints, sensors, `package://` ROS package resolution beyond a search root |
78
+
79
+ Robot-specific preprocessing (renaming links, removing parts) is deliberately
80
+ out of scope: parse with `parse_urdf`, mutate the IR, then emit with
81
+ `convert_robot`.
82
+
83
+ ## Development
84
+
85
+ ```bash
86
+ uv sync
87
+ uv run pytest # includes the parity suites (CPU only)
88
+ uv run ruff check .
89
+ ```
90
+
91
+ Releases are published to PyPI by pushing a `vX.Y.Z` tag
92
+ (Trusted Publishing via `.github/workflows/release.yml`).
93
+
94
+ ### Parity testing
95
+
96
+ - **USD vs IsaacLab importer** — `tests/test_golden_parity.py` diffs urdf2any's
97
+ output against committed golden summaries (`tests/golden/`) generated by the
98
+ real importer. Regenerate them inside an IsaacLab container with
99
+ `scripts/generate_reference.py` (the import itself needs no GPU).
100
+ - **MJCF vs MuJoCo** — `tests/test_mjcf_parity.py` compiles both urdf2any's MJCF
101
+ and the source URDF with MuJoCo and compares the resulting models live; no
102
+ golden files needed.
103
+
104
+ Sample robots under `tests/assets/` are vendored from
105
+ [IsaacLab](https://github.com/isaac-sim/IsaacLab) (BSD-3-Clause) and
106
+ [Isaac Sim](https://github.com/isaac-sim/IsaacSim) (Apache-2.0); see the
107
+ `NOTICE` file next to each.
108
+
109
+ ## License
110
+
111
+ [Apache-2.0](LICENSE)