├── .DS_Store
├── .gitignore
├── .idea
├── .gitignore
├── codeStyles
│ └── codeStyleConfig.xml
├── inspectionProfiles
│ └── profiles_settings.xml
├── modules.xml
├── vcs.xml
└── wiki-mjcf.iml
├── LICENSE
├── README.en.md
├── README.md
├── models
├── .DS_Store
└── N1
│ ├── meshes
│ ├── base_link.STL
│ ├── camera_link.STL
│ ├── imu_link.STL
│ ├── left_end_effector_link.STL
│ ├── left_foot_pitch_link.STL
│ ├── left_foot_roll_link.STL
│ ├── left_hand_yaw_link.STL
│ ├── left_lower_arm_pitch_link.STL
│ ├── left_shank_pitch_link.STL
│ ├── left_thigh_pitch_link.STL
│ ├── left_thigh_roll_link.STL
│ ├── left_thigh_yaw_link.STL
│ ├── left_upper_arm_pitch_link.STL
│ ├── left_upper_arm_roll_link.STL
│ ├── left_upper_arm_yaw_link.STL
│ ├── right_end_effector_link.STL
│ ├── right_foot_pitch_link.STL
│ ├── right_foot_roll_link.STL
│ ├── right_hand_yaw_link.STL
│ ├── right_lower_arm_pitch_link.STL
│ ├── right_shank_pitch_link.STL
│ ├── right_thigh_pitch_link.STL
│ ├── right_thigh_roll_link.STL
│ ├── right_thigh_yaw_link.STL
│ ├── right_upper_arm_pitch_link.STL
│ ├── right_upper_arm_roll_link.STL
│ ├── right_upper_arm_yaw_link.STL
│ ├── torso_link.STL
│ └── waist_yaw_link.STL
│ ├── mjcf
│ └── N1_raw.xml
│ ├── scene
│ ├── N1_raw_refine.xml
│ └── scene.xml
│ └── urdf
│ ├── N1_raw.urdf
│ └── N1_rotor.urdf
├── pictures
└── N1.png
├── scripts
└── urdf2mjcf
├── setup.py
└── src
└── urdf2mjcf
├── __init__.py
├── app.py
├── cli.py
├── core.py
├── default_elements
├── __init__.py
├── ground.py
└── lighting.py
└── utils.py
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/.DS_Store
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | share/python-wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 | MANIFEST
28 |
29 | # PyInstaller
30 | # Usually these files are written by a python script from a template
31 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
32 | *.manifest
33 | *.spec
34 |
35 | # Installer logs
36 | pip-log.txt
37 | pip-delete-this-directory.txt
38 |
39 | # Unit test / coverage reports
40 | htmlcov/
41 | .tox/
42 | .nox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *.cover
49 | *.py,cover
50 | .hypothesis/
51 | .pytest_cache/
52 | cover/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | .pybuilder/
76 | target/
77 |
78 | # Jupyter Notebook
79 | .ipynb_checkpoints
80 |
81 | # IPython
82 | profile_default/
83 | ipython_config.py
84 |
85 | # pyenv
86 | # For a library or package, you might want to ignore these files since the code is
87 | # intended to run in multiple environments; otherwise, check them in:
88 | # .python-version
89 |
90 | # pipenv
91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
94 | # install all needed dependencies.
95 | #Pipfile.lock
96 |
97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98 | __pypackages__/
99 |
100 | # Celery stuff
101 | celerybeat-schedule
102 | celerybeat.pid
103 |
104 | # SageMath parsed files
105 | *.sage.py
106 |
107 | # Environments
108 | .env
109 | .venv
110 | env/
111 | venv/
112 | ENV/
113 | env.bak/
114 | venv.bak/
115 |
116 | # Spyder project settings
117 | .spyderproject
118 | .spyproject
119 |
120 | # Rope project settings
121 | .ropeproject
122 |
123 | # mkdocs documentation
124 | /site
125 |
126 | # mypy
127 | .mypy_cache/
128 | .dmypy.json
129 | dmypy.json
130 |
131 | # Pyre type checker
132 | .pyre/
133 |
134 | # pytype static type analyzer
135 | .pytype/
136 |
137 | # Cython debug symbols
138 | cython_debug/
139 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/wiki-mjcf.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
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.
202 |
--------------------------------------------------------------------------------
/README.en.md:
--------------------------------------------------------------------------------
1 | [简体中文](README.md) | English
2 |
3 | # Wiki-GRx-MJCF
4 |
5 |
6 |
7 | This repository provides a tool to transfer from URDF file to MJCF. It is developed for converting the Fourier GRx robot URDF files to MJCF files.
8 | However, it can also be used for other URDF files.
9 |
10 | ## User Guide
11 |
12 | 1. Install the package using pip
13 |
14 | ```shell
15 | pip install -e .
16 | ```
17 |
18 | 2. Test the package installation
19 |
20 | ```shell
21 | urdf2mjcf --help
22 | ```
23 |
24 | ```
25 | usage: urdf2mjcf [-h] [-s SENSOR_CONFIG] [-m MUJOCO_NODE] [--ground] [--lighting] [--version] [-l] [urdf] [mjcf]
26 |
27 | Copyright (c) 2022 Fraunhofer IPA; use option '-l' to print license.
28 |
29 | Parse a URDF model into MJCF format
30 |
31 | positional arguments:
32 | urdf the URDF file to convert (default: <_io.TextIOWrapper name='' mode='r' encoding='utf-8'>)
33 | mjcf the converted MJCF file (default: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>)
34 |
35 | optional arguments:
36 | -h, --help show this help message and exit
37 | -s SENSOR_CONFIG the XML file of the sensor configuration (default: None)
38 | -m MUJOCO_NODE the XML file defining the global MuJoCo configuration (default: None)
39 | --ground whether to add the default ground plane to the MuJoCo model (default: False)
40 | --lighting whether to add the default lighting to the MuJoCo model (default: False)
41 | --version show program's version number and exit
42 | -l print license information (default: False)
43 | ```
44 |
45 | 3. Convert a URDF file to MJCF
46 |
47 | ```shell
48 | urdf2mjcf /path/to/models /path/to/mjcf
49 | ```
50 |
51 | ```shell
52 | # Convert N1 example
53 | urdf2mjcf ./models/N1/urdf/N1_raw.urdf ./models/N1/mjcf/N1_raw.xml
54 | ```
55 |
56 | 4. Change base height of the robot:
57 |
58 | ```
59 | # 编辑 MJCF 文件中的
60 |
61 | ```
62 |
63 | 5. Refine the MJCF file:
64 | - The MJCF file generated by the tool is a basic version. You can manually refine the MJCF file according to your requirements.
65 | - The refined MJCF file should be placed in the `./models/N1/scene/` directory.
66 |
67 | ## Verification
68 |
69 | 1. Start Mujoco Viewer
70 |
71 | ```
72 | python -m mujoco.viewer
73 | ```
74 |
75 | 2. Drag the generated MJCF file into the Mujoco Viewer window to check if the model is correct.
76 |
77 | ## Thanks
78 |
79 | - https://github.com/balandbal/urdf2mjcf
80 |
81 | ---
82 |
83 | Thank you for your interest in the Fourier Intelligence N1 robot project!
84 | We hope this resource will provide strong support for your robotics development!
85 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [English](README.en.md) | 简体中文
2 |
3 | # Wiki-GRx-MJCF
4 |
5 |
6 |
7 | 本代码仓库提供将 URDF 文件转换为 MJCF 格式的工具。该工具专为 Fourier GRx 系列机器人 URDF 文件转换而开发,同时也适用于其他 URDF 文件的转换。
8 |
9 | ## 安装指南
10 |
11 | 1. 安装依赖库
12 |
13 | ```shell
14 | pip install -e .
15 | ```
16 |
17 | 2. 测试工具包是否安装成功
18 |
19 | ```shell
20 | urdf2mjcf --help
21 | ```
22 |
23 | ```
24 | usage: urdf2mjcf [-h] [-s SENSOR_CONFIG] [-m MUJOCO_NODE] [--ground] [--lighting] [--version] [-l] [urdf] [mjcf]
25 |
26 | Copyright (c) 2022 Fraunhofer IPA; use option '-l' to print license.
27 |
28 | Parse a URDF model into MJCF format
29 |
30 | positional arguments:
31 | urdf the URDF file to convert (default: <_io.TextIOWrapper name='' mode='r' encoding='utf-8'>)
32 | mjcf the converted MJCF file (default: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>)
33 |
34 | optional arguments:
35 | -h, --help show this help message and exit
36 | -s SENSOR_CONFIG the XML file of the sensor configuration (default: None)
37 | -m MUJOCO_NODE the XML file defining the global MuJoCo configuration (default: None)
38 | --ground whether to add the default ground plane to the MuJoCo model (default: True)
39 | --lighting whether to add the default lighting to the MuJoCo model (default: True)
40 | --version show program's version number and exit
41 | -l print license information (default: False)
42 | ```
43 |
44 | 3. 转换 URDF 文件为 MJCF 格式
45 |
46 | ```shell
47 | urdf2mjcf /path/to/models /path/to/mjcf
48 | ```
49 |
50 | ```shell
51 | # 转换 N1 机器人示例
52 | urdf2mjcf ./models/N1/urdf/N1_raw.urdf ./models/N1/mjcf/N1_raw.xml
53 | ```
54 |
55 | 4. 调整机器人基座高度
56 |
57 | ```
58 | # 编辑 MJCF 文件中的
59 |
60 | ```
61 |
62 | 5. 优化 MJCF 文件:
63 | - 工具生成的 MJCF 文件为基础版本,您可以根据需求手动优化。
64 | - 优化完的 MJCF 文件放置于 `./models/N1/scene/` 目录下。
65 |
66 | ## 模型验证
67 |
68 | 1. 启动 Mujoco Viewer
69 |
70 | ```
71 | python -m mujoco.viewer
72 | ```
73 |
74 | 2. 把生成的 MJCF 文件拖到 Mujoco Viewer 窗口中,查看模型是否正确。
75 |
76 | ## 感谢
77 |
78 | - https://github.com/balandbal/urdf2mjcf
79 |
80 | ---
81 |
82 | 感谢您对傅利叶智能 N1 机器人项目的关注!
83 | 希望本资源能为您的机器人开发提供有力支持!
84 |
--------------------------------------------------------------------------------
/models/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/.DS_Store
--------------------------------------------------------------------------------
/models/N1/meshes/base_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/base_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/camera_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/camera_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/imu_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/imu_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_end_effector_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_end_effector_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_foot_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_foot_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_foot_roll_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_foot_roll_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_hand_yaw_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_hand_yaw_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_lower_arm_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_lower_arm_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_shank_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_shank_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_thigh_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_thigh_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_thigh_roll_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_thigh_roll_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_thigh_yaw_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_thigh_yaw_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_upper_arm_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_upper_arm_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_upper_arm_roll_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_upper_arm_roll_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/left_upper_arm_yaw_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/left_upper_arm_yaw_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_end_effector_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_end_effector_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_foot_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_foot_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_foot_roll_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_foot_roll_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_hand_yaw_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_hand_yaw_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_lower_arm_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_lower_arm_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_shank_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_shank_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_thigh_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_thigh_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_thigh_roll_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_thigh_roll_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_thigh_yaw_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_thigh_yaw_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_upper_arm_pitch_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_upper_arm_pitch_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_upper_arm_roll_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_upper_arm_roll_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/right_upper_arm_yaw_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/right_upper_arm_yaw_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/torso_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/torso_link.STL
--------------------------------------------------------------------------------
/models/N1/meshes/waist_yaw_link.STL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/models/N1/meshes/waist_yaw_link.STL
--------------------------------------------------------------------------------
/models/N1/mjcf/N1_raw.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/models/N1/scene/N1_raw_refine.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
--------------------------------------------------------------------------------
/models/N1/scene/scene.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/models/N1/urdf/N1_raw.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
9 |
10 |
13 |
15 |
22 |
23 |
24 |
27 |
28 |
30 |
31 |
33 |
35 |
36 |
37 |
38 |
41 |
42 |
43 |
44 |
45 |
46 |
48 |
49 |
52 |
54 |
61 |
62 |
63 |
66 |
67 |
69 |
70 |
72 |
74 |
75 |
76 |
85 |
86 |
89 |
92 |
94 |
96 |
98 |
103 |
104 |
106 |
107 |
110 |
112 |
119 |
120 |
121 |
124 |
125 |
127 |
128 |
130 |
132 |
133 |
134 |
135 |
138 |
139 |
140 |
141 |
142 |
143 |
146 |
149 |
151 |
153 |
155 |
160 |
161 |
163 |
164 |
167 |
169 |
176 |
177 |
178 |
181 |
182 |
184 |
185 |
187 |
189 |
190 |
191 |
192 |
195 |
196 |
197 |
198 |
199 |
200 |
203 |
206 |
208 |
210 |
212 |
217 |
218 |
220 |
221 |
224 |
226 |
233 |
234 |
235 |
238 |
239 |
241 |
242 |
244 |
246 |
247 |
248 |
249 |
252 |
253 |
254 |
255 |
256 |
257 |
260 |
263 |
265 |
267 |
269 |
274 |
275 |
277 |
278 |
281 |
283 |
290 |
291 |
292 |
295 |
296 |
298 |
299 |
301 |
303 |
304 |
305 |
314 |
315 |
318 |
321 |
323 |
325 |
327 |
332 |
333 |
335 |
336 |
339 |
341 |
348 |
349 |
350 |
353 |
354 |
356 |
357 |
359 |
361 |
362 |
363 |
364 |
367 |
368 |
370 |
371 |
372 |
373 |
376 |
379 |
381 |
383 |
385 |
390 |
391 |
393 |
394 |
397 |
399 |
406 |
407 |
408 |
411 |
412 |
414 |
415 |
417 |
419 |
420 |
421 |
430 |
431 |
434 |
437 |
439 |
441 |
443 |
448 |
449 |
451 |
452 |
455 |
457 |
464 |
465 |
466 |
469 |
470 |
472 |
473 |
475 |
477 |
478 |
479 |
480 |
483 |
484 |
485 |
486 |
487 |
488 |
491 |
494 |
496 |
498 |
500 |
505 |
506 |
508 |
509 |
512 |
514 |
521 |
522 |
523 |
526 |
527 |
529 |
530 |
532 |
534 |
535 |
536 |
537 |
540 |
541 |
542 |
543 |
544 |
545 |
548 |
551 |
553 |
555 |
557 |
562 |
563 |
565 |
566 |
569 |
571 |
578 |
579 |
580 |
583 |
584 |
586 |
587 |
589 |
591 |
592 |
593 |
594 |
597 |
598 |
599 |
600 |
601 |
602 |
605 |
608 |
610 |
612 |
614 |
619 |
620 |
622 |
623 |
626 |
628 |
635 |
636 |
637 |
640 |
641 |
643 |
644 |
646 |
648 |
649 |
650 |
659 |
660 |
663 |
666 |
668 |
670 |
672 |
677 |
678 |
680 |
681 |
684 |
686 |
693 |
694 |
695 |
698 |
699 |
701 |
702 |
704 |
706 |
707 |
708 |
709 |
712 |
713 |
715 |
716 |
717 |
718 |
721 |
724 |
726 |
728 |
730 |
735 |
736 |
738 |
739 |
742 |
744 |
751 |
752 |
753 |
756 |
757 |
759 |
760 |
762 |
764 |
765 |
766 |
775 |
776 |
779 |
782 |
784 |
786 |
788 |
789 |
791 |
792 |
795 |
797 |
804 |
805 |
806 |
809 |
810 |
812 |
813 |
815 |
817 |
818 |
819 |
820 |
823 |
824 |
825 |
826 |
827 |
828 |
831 |
834 |
836 |
838 |
840 |
845 |
846 |
848 |
849 |
852 |
854 |
861 |
862 |
863 |
866 |
867 |
869 |
870 |
872 |
874 |
875 |
876 |
877 |
880 |
881 |
882 |
883 |
884 |
885 |
888 |
889 |
890 |
891 |
892 |
893 |
896 |
899 |
901 |
903 |
905 |
906 |
908 |
909 |
912 |
914 |
921 |
922 |
923 |
926 |
927 |
929 |
930 |
932 |
934 |
935 |
936 |
945 |
946 |
949 |
952 |
954 |
956 |
958 |
959 |
961 |
962 |
965 |
967 |
974 |
975 |
976 |
979 |
980 |
982 |
983 |
985 |
987 |
988 |
989 |
998 |
999 |
1002 |
1005 |
1007 |
1009 |
1011 |
1016 |
1017 |
1019 |
1020 |
1023 |
1025 |
1032 |
1033 |
1034 |
1037 |
1038 |
1040 |
1041 |
1043 |
1045 |
1046 |
1047 |
1048 |
1051 |
1052 |
1053 |
1054 |
1055 |
1056 |
1059 |
1062 |
1064 |
1066 |
1068 |
1073 |
1074 |
1076 |
1077 |
1080 |
1082 |
1089 |
1090 |
1091 |
1094 |
1095 |
1097 |
1098 |
1100 |
1102 |
1103 |
1104 |
1105 |
1108 |
1109 |
1110 |
1111 |
1112 |
1113 |
1116 |
1119 |
1121 |
1123 |
1125 |
1130 |
1131 |
1133 |
1134 |
1137 |
1139 |
1146 |
1147 |
1148 |
1151 |
1152 |
1154 |
1155 |
1157 |
1159 |
1160 |
1161 |
1170 |
1171 |
1174 |
1177 |
1179 |
1181 |
1183 |
1188 |
1189 |
1191 |
1192 |
1195 |
1197 |
1204 |
1205 |
1206 |
1209 |
1210 |
1212 |
1213 |
1215 |
1217 |
1218 |
1219 |
1220 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1231 |
1234 |
1236 |
1238 |
1240 |
1245 |
1246 |
1248 |
1249 |
1252 |
1254 |
1261 |
1262 |
1263 |
1266 |
1267 |
1269 |
1270 |
1272 |
1274 |
1275 |
1276 |
1277 |
1280 |
1281 |
1282 |
1283 |
1284 |
1285 |
1288 |
1291 |
1293 |
1295 |
1297 |
1298 |
1300 |
1301 |
1304 |
1306 |
1313 |
1314 |
1315 |
1318 |
1319 |
1321 |
1322 |
1324 |
1326 |
1327 |
1328 |
1337 |
1338 |
1341 |
1344 |
1346 |
1348 |
1350 |
1355 |
1356 |
1358 |
1359 |
1362 |
1364 |
1371 |
1372 |
1373 |
1376 |
1377 |
1379 |
1380 |
1382 |
1384 |
1385 |
1386 |
1387 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1398 |
1401 |
1403 |
1405 |
1407 |
1412 |
1413 |
1415 |
1416 |
1419 |
1421 |
1428 |
1429 |
1430 |
1433 |
1434 |
1436 |
1437 |
1439 |
1441 |
1442 |
1443 |
1444 |
1447 |
1448 |
1449 |
1450 |
1451 |
1452 |
1455 |
1458 |
1460 |
1462 |
1464 |
1469 |
1470 |
1472 |
1473 |
1476 |
1478 |
1485 |
1486 |
1487 |
1490 |
1491 |
1493 |
1494 |
1496 |
1498 |
1499 |
1500 |
1509 |
1510 |
1513 |
1516 |
1518 |
1520 |
1522 |
1527 |
1528 |
1530 |
1531 |
1534 |
1536 |
1543 |
1544 |
1545 |
1548 |
1549 |
1551 |
1552 |
1554 |
1556 |
1557 |
1558 |
1559 |
1562 |
1563 |
1564 |
1565 |
1566 |
1567 |
1570 |
1573 |
1575 |
1577 |
1579 |
1584 |
1585 |
1587 |
1588 |
1591 |
1593 |
1600 |
1601 |
1602 |
1605 |
1606 |
1608 |
1609 |
1611 |
1613 |
1614 |
1615 |
1616 |
1619 |
1620 |
1621 |
1622 |
1623 |
1624 |
1627 |
1630 |
1632 |
1634 |
1636 |
1637 |
--------------------------------------------------------------------------------
/models/N1/urdf/N1_rotor.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
150 |
151 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
341 |
342 |
343 |
344 |
345 |
346 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
--------------------------------------------------------------------------------
/pictures/N1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/pictures/N1.png
--------------------------------------------------------------------------------
/scripts/urdf2mjcf:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | from sys import stdout
4 | from pathlib import Path
5 |
6 | from urdf2mjcf import __version__
7 | from urdf2mjcf.cli import cli
8 | from urdf2mjcf.app import full_pipeline
9 | from urdf2mjcf.core import parse_element as parse_stream, tostring
10 |
11 | from lxml import etree
12 |
13 |
14 | def xml_format(input_file, output_file):
15 | """
16 | Format the XML file using lxml
17 | """
18 | parser = etree.XMLParser(remove_blank_text=True)
19 | tree = etree.parse(input_file, parser)
20 |
21 | with open(output_file, 'wb') as f:
22 | tree.write(
23 | f,
24 | pretty_print=True,
25 | xml_declaration=True,
26 | encoding='UTF-8',
27 | )
28 |
29 |
30 | def app(args):
31 | """
32 | App for URDF-2-MJCF conversion
33 | """
34 |
35 | # Check if the URDF file exists
36 | urdf_abs_path = os.path.abspath(args.urdf.name)
37 | mjcf_abs_path = os.path.abspath(args.mjcf.name)
38 |
39 | if not os.path.exists(urdf_abs_path):
40 | raise FileNotFoundError(f"URDF file not found: {urdf_abs_path}")
41 |
42 | print(f"Input URDF file: {urdf_abs_path}")
43 | print(f"Output MJCF file: {mjcf_abs_path}")
44 |
45 | # Convert the URDF file to MJCF format
46 | result = full_pipeline(
47 | urdf_file_path=urdf_abs_path,
48 | urdf=parse_stream(args.urdf),
49 | sensor_config=parse_stream(args.sensor_config),
50 | mujoco_node=parse_stream(args.mujoco_node),
51 | default_ground=args.default_ground,
52 | default_lighting=args.default_lighting,
53 | )
54 |
55 | # Write the MJCF result to the specified output file
56 | args.mjcf.write(tostring(result, encoding="unicode"))
57 |
58 | # Close the input and output files
59 | args.urdf.close()
60 | args.mjcf.close()
61 |
62 | if args.mujoco_node is not None:
63 | args.mujoco_node.close()
64 |
65 | if args.sensor_config is not None:
66 | args.sensor_config.close()
67 |
68 | if args.mjcf != stdout:
69 | stdout.write(args.mjcf.name)
70 |
71 | # Format the MJCF file
72 | if args.default_format:
73 | xml_format(args.mjcf.name, args.mjcf.name)
74 |
75 |
76 | if __name__ == "__main__":
77 | # Get default arguments from environment variables
78 | parser = cli()
79 |
80 | parser.add_argument(
81 | "--version",
82 | action="version",
83 | version=__version__
84 | )
85 |
86 | args = parser.parse_args()
87 |
88 | app(args)
89 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import find_packages
2 | from distutils.core import setup
3 |
4 | setup(
5 | name="urdf2mjcf",
6 | version="1.0.0",
7 | description="Convert URDF to MJCF",
8 | author="Jason Chen",
9 | author_email="xin.chen@fftai.com",
10 | license="Apache-2.0",
11 | packages=find_packages(),
12 | package_dir={"": "src"},
13 | python_requires='>=3.7',
14 | scripts=[
15 | "scripts/urdf2mjcf"
16 | ],
17 | install_requires=[
18 | "mujoco>=3.0.0",
19 | "defusedxml==0.7.1",
20 |
21 | # 文件格式整理
22 | "lxml",
23 | ]
24 | )
25 |
--------------------------------------------------------------------------------
/src/urdf2mjcf/__init__.py:
--------------------------------------------------------------------------------
1 | __version__ = "1.0.0"
--------------------------------------------------------------------------------
/src/urdf2mjcf/app.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from .core import Element
4 | from .core import (
5 | resolve_uris,
6 | add_mujoco_node,
7 | pass_through_mujoco,
8 | populate_sensors,
9 | )
10 | from .default_elements.ground import add_ground
11 | from .default_elements.lighting import add_lighting
12 |
13 |
14 | def full_pipeline(
15 | urdf_file_path: str,
16 | urdf: Element,
17 |
18 | mujoco_node: Element = None,
19 |
20 | # 传感器配置
21 | sensor_config: Element = None,
22 |
23 | # 默认加入地面
24 | default_ground: bool = True,
25 |
26 | # 默认加入光源
27 | default_lighting: bool = True,
28 | ) -> Element:
29 | """
30 | Convert URDF object to MJCF
31 | """
32 |
33 | urdf_file_folder_abs_path = urdf_file_path.replace(os.path.basename(urdf_file_path), "")
34 |
35 | resolve_uris(urdf, base_path=urdf_file_folder_abs_path)
36 |
37 | # 把所有相对路径的文件名转换为绝对路径
38 | add_mujoco_node(urdf, mujoco_node)
39 |
40 | # URDF -> MUJOCO -> MJCF
41 | mjcf = pass_through_mujoco(urdf)
42 |
43 | if sensor_config is not None:
44 | populate_sensors(mjcf, sensor_config)
45 | mjcf = pass_through_mujoco(mjcf)
46 |
47 | if default_ground:
48 | add_ground(mjcf)
49 |
50 | if default_lighting:
51 | add_lighting(mjcf)
52 |
53 | return mjcf
54 |
--------------------------------------------------------------------------------
/src/urdf2mjcf/cli.py:
--------------------------------------------------------------------------------
1 | from sys import stdin, stdout
2 | from argparse import (
3 | ArgumentParser,
4 | ArgumentDefaultsHelpFormatter,
5 | RawDescriptionHelpFormatter,
6 | FileType,
7 | )
8 |
9 |
10 | class ArgFormatter(ArgumentDefaultsHelpFormatter, RawDescriptionHelpFormatter):
11 | pass
12 |
13 |
14 | def cli(parser: ArgumentParser = None):
15 | """CLI for URDF-2-MJCF conversion"""
16 | parser = (
17 | ArgumentParser(
18 | prog="urdf2mjcf",
19 | description="""
20 | Copyright (c) 2022 Fraunhofer IPA; use option '-l' to print license.
21 | Parse a URDF model into MJCF format
22 | """,
23 | formatter_class=ArgFormatter,
24 | )
25 | if parser is None else parser
26 | )
27 |
28 | parser.add_argument(
29 | "urdf",
30 | nargs="?",
31 | type=FileType("r"),
32 | default=stdin,
33 | help="the URDF file to convert",
34 | )
35 | parser.add_argument(
36 | "mjcf",
37 | nargs="?",
38 | type=FileType("w"),
39 | default=stdout,
40 | help="the converted MJCF file",
41 | )
42 |
43 | parser.add_argument(
44 | "--sensor_config",
45 | dest="sensor_config",
46 | type=FileType("r"),
47 | default=None,
48 | help="the XML file of the sensor configuration",
49 | )
50 | parser.add_argument(
51 | "--mujoco_node",
52 | dest="mujoco_node",
53 | type=FileType("r"),
54 | default=None,
55 | help="the XML file defining the global MuJoCo configuration",
56 | )
57 | parser.add_argument(
58 | "--ground",
59 | dest="default_ground",
60 | action="store_true",
61 | help="whether to add the default ground plane to the MuJoCo model",
62 | )
63 | parser.add_argument(
64 | "--lighting",
65 | dest="default_lighting",
66 | action="store_true",
67 | help="whether to add the default lighting to the MuJoCo model",
68 | )
69 | parser.add_argument(
70 | "--format",
71 | dest="default_format",
72 | action="store_false",
73 | help="format the MJCF file"
74 | )
75 |
76 | return parser
77 |
--------------------------------------------------------------------------------
/src/urdf2mjcf/core.py:
--------------------------------------------------------------------------------
1 | """ TODO: add module description """
2 |
3 | # Copyright (c) 2022 Fraunhofer IPA; see bottom of this file for full license
4 |
5 | from xml.etree.ElementTree import Element, tostring, SubElement
6 | from pathlib import Path
7 | from typing import Union, IO, AnyStr, Dict
8 | from os import fdopen, unlink
9 | from tempfile import mkstemp
10 | from urllib.parse import urlparse
11 |
12 | from defusedxml.ElementTree import parse
13 | from mujoco import MjModel, mj_saveLastXML
14 |
15 |
16 | def resolve_uris(urdf: Element, base_path: str = None) -> None:
17 | """
18 | Resolve all collision mesh URIs to absolute paths
19 | """
20 |
21 | for mesh_node in urdf.findall(".//collision/*/mesh[@filename]"):
22 | uri = mesh_node.get("filename", None)
23 | assert (
24 | uri is not None
25 | ), f"Mesh node without filename: '{mesh_node.tag}' : {mesh_node.attrib}"
26 |
27 | absolute_path = base_path + uri if base_path is not None else uri
28 |
29 | mesh_node.set("filename", str(absolute_path))
30 |
31 |
32 | def parse_element(source: Union[str, Path, IO[AnyStr], None], **kwargs) -> Element:
33 | """
34 | Parse source into a Python XML element object, safely
35 | """
36 |
37 | return None if source is None else parse(source, **kwargs).getroot() # type: ignore
38 |
39 |
40 | def pass_through_mujoco(model_xml: Element) -> Element:
41 | """
42 | Load and export XML element object through MuJoCo
43 | """
44 |
45 | parsed_model = MjModel.from_xml_string(tostring(model_xml, encoding="unicode"))
46 |
47 | tmp_file_descriptor, tmp_file_name = mkstemp(prefix="tmp_mjcf_", suffix=".xml")
48 | mj_saveLastXML(tmp_file_name, parsed_model)
49 |
50 | with fdopen(tmp_file_descriptor, "r") as tmp_file:
51 | backloaded_model_xml = parse_element(tmp_file)
52 |
53 | unlink(tmp_file_name)
54 |
55 | return backloaded_model_xml
56 |
57 |
58 | def add_mujoco_node(urdf: Element, mujoco_node: Element = None) -> None:
59 | """
60 | Add the mujoco node to a URDF object
61 | """
62 |
63 | mujoco_node = Element("mujoco") if mujoco_node is None else mujoco_node
64 | present_mujoco_node = urdf.find("./mujoco")
65 | if present_mujoco_node is None:
66 | present_mujoco_node = Element("mujoco")
67 | else:
68 | urdf.remove(present_mujoco_node)
69 |
70 | compiler_attrib = {
71 | "strippath": "false",
72 | "fusestatic": "false",
73 | "discardvisual": "true",
74 | }
75 | lengthrange_attrib: Dict[str, str] = {}
76 | option_attrib: Dict[str, str] = {}
77 | flag_attrib: Dict[str, str] = {}
78 | size_attrib: Dict[str, str] = {}
79 |
80 | attribs = [
81 | compiler_attrib,
82 | lengthrange_attrib,
83 | option_attrib,
84 | flag_attrib,
85 | size_attrib,
86 | ]
87 | mujoco_node_scheme = [
88 | "./compiler",
89 | "./compiler/lengthrange",
90 | "./option",
91 | "./option/flag",
92 | "./size",
93 | ]
94 |
95 | for node_attrib, xpath in zip(attribs, mujoco_node_scheme):
96 | for node in present_mujoco_node.findall(xpath):
97 | node_attrib.update(node.attrib)
98 | for node in mujoco_node.findall(xpath):
99 | node_attrib.update(node.attrib)
100 |
101 | new_mujoco_node = SubElement(urdf, "mujoco")
102 |
103 | compiler_node = SubElement(new_mujoco_node, "compiler", compiler_attrib)
104 | lengthrange_node = SubElement(compiler_node, "lengthrange", lengthrange_attrib)
105 |
106 | option_node = SubElement(new_mujoco_node, "option", option_attrib)
107 | flag_node = SubElement(option_node, "flag", flag_attrib)
108 |
109 | size_node = SubElement(new_mujoco_node, "size", size_attrib)
110 |
111 |
112 | def populate_sensors(mjcf: Element, sensor_config: Element) -> None:
113 | """
114 | Add sites and sensors to an MJCF object
115 | """
116 |
117 | for body_node in sensor_config.findall("./body"):
118 | body_name = body_node.get("name", None)
119 | assert (
120 | body_name is not None
121 | ), f"Bad sensor configuration; body node has no name ({body_node.attrib})"
122 |
123 | body_in_mjcf = mjcf.find(f".//body[@name='{body_name}']")
124 | assert body_in_mjcf is not None, f"No body in MJCF with name '{body_name}'"
125 |
126 | body_in_mjcf.extend(body_node.findall("./site"))
127 |
128 | mjcf.extend(sensor_config.findall("./sensor"))
129 |
130 | # Copyright (c) 2022 Fraunhofer IPA
131 | #
132 | # Redistribution and use in source and binary forms, with or without modification, are permitted
133 | # provided that the following conditions are met:
134 | #
135 | # 1. Redistributions of source code must retain the above copyright notice, this list of conditions
136 | # and the following disclaimer.
137 | #
138 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
139 | # and the following disclaimer in the documentation and/or other materials provided with the distribution.
140 | #
141 | # 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
142 | # or promote products derived from this software without specific prior written permission.
143 | #
144 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
145 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
146 | # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
147 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
148 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
149 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
150 | # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
151 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
152 |
--------------------------------------------------------------------------------
/src/urdf2mjcf/default_elements/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FFTAI/Wiki-GRx-MJCF/3079af890e8db4d243e5729abfa9860ecf7487f6/src/urdf2mjcf/default_elements/__init__.py
--------------------------------------------------------------------------------
/src/urdf2mjcf/default_elements/ground.py:
--------------------------------------------------------------------------------
1 | from typing import Dict
2 |
3 | from ..core import Element, SubElement
4 | from ..utils import _update_with_defaults
5 |
6 |
7 | DEFAULT_GROUND_TEXTURE = {
8 | "name": "texplane",
9 | "builtin": "checker",
10 | "height": "512",
11 | "width": "512",
12 | "rgb1": ".2 .3 .4",
13 | "rgb2": ".1 .15 .2",
14 | "type": "2d",
15 | }
16 | """TODO: docstring
17 | """
18 |
19 | DEFAULT_GROUND_MATERIAL = {
20 | "name": "MatPlane",
21 | "reflectance": "0.5",
22 | "shininess": "0.01",
23 | "specular": "0.1",
24 | "texrepeat": "1 1",
25 | "texture": "texplane",
26 | "texuniform": "true",
27 | }
28 | """TODO: docstring
29 | """
30 |
31 | DEFAULT_GROUND_GEOM = {
32 | "name": "ground_plane",
33 | "type": "plane",
34 | "size": "5 5 10",
35 | "material": "MatPlane",
36 | "rgba": "1 1 1 1",
37 | }
38 | """TODO: docstring
39 | """
40 |
41 |
42 | def add_ground(
43 | mjcf: Element,
44 | texture_attrib: Dict[str, str] = None,
45 | material_attrib: Dict[str, str] = None,
46 | geom_attrib: Dict[str, str] = None,
47 | ) -> None:
48 | """_summary_
49 |
50 | Parameters
51 | ----------
52 | mjcf : Element
53 | _description_
54 | texture_attrib : Dict[str, str], optional
55 | _description_, by default None
56 | material_attrib : Dict[str, str], optional
57 | _description_, by default None
58 | geom_attrib : Dict[str, str], optional
59 | _description_, by default None
60 | """ # TODO: docstring
61 | asset = SubElement(mjcf, "asset")
62 |
63 | texture_attrib = _update_with_defaults(DEFAULT_GROUND_TEXTURE, texture_attrib)
64 | SubElement(asset, "texture", texture_attrib)
65 |
66 | material_attrib = _update_with_defaults(DEFAULT_GROUND_MATERIAL, material_attrib)
67 | SubElement(asset, "material", material_attrib)
68 |
69 | worldbody = mjcf.find("./worldbody")
70 | worldbody = SubElement(mjcf, "worldbody") if worldbody is None else worldbody
71 |
72 | geom_attrib = _update_with_defaults(DEFAULT_GROUND_GEOM, geom_attrib)
73 | SubElement(worldbody, "geom", geom_attrib)
74 |
--------------------------------------------------------------------------------
/src/urdf2mjcf/default_elements/lighting.py:
--------------------------------------------------------------------------------
1 | from typing import Dict
2 |
3 | from ..core import Element, SubElement
4 | from ..utils import _update_with_defaults
5 |
6 | DEFAULT_LIGHT = {
7 | "pos": "0 0 1000",
8 | "castshadow": "true",
9 | }
10 | """TODO: docstring
11 | """
12 |
13 |
14 | def add_lighting(mjcf: Element, light_attrib: Dict[str, str] = None) -> None:
15 | """_summary_
16 |
17 | Parameters
18 | ----------
19 | mjcf : Element
20 | _description_
21 | light_attrib : Dict[str, str]
22 | _description_
23 | """ # TODO: docstring
24 | worldbody = mjcf.find("./worldbody")
25 | worldbody = SubElement(mjcf, "worldbody") if worldbody is None else worldbody
26 |
27 | light_attrib = _update_with_defaults(DEFAULT_LIGHT, light_attrib)
28 | SubElement(worldbody, "light", light_attrib)
29 |
--------------------------------------------------------------------------------
/src/urdf2mjcf/utils.py:
--------------------------------------------------------------------------------
1 | from typing import TypeVar, Dict
2 |
3 | K = TypeVar("K")
4 | V = TypeVar("V")
5 |
6 |
7 | def _update_with_defaults(
8 | dictionary: Dict[K, V] = None, defaults: Dict[K, V] = None
9 | ) -> Dict[K, V]:
10 | updated_dict = {} if defaults is None else dict(defaults.items())
11 | updated_dict.update(dictionary if dictionary is not None else {})
12 | return updated_dict
13 |
--------------------------------------------------------------------------------