├── .gitignore
├── LICENSE
├── README.md
├── assets
├── franka_description
│ ├── meshes
│ │ ├── collision
│ │ │ ├── finger.obj
│ │ │ ├── finger.stl
│ │ │ ├── hand.obj
│ │ │ ├── hand.stl
│ │ │ ├── link0.obj
│ │ │ ├── link0.stl
│ │ │ ├── link1.obj
│ │ │ ├── link1.stl
│ │ │ ├── link2.obj
│ │ │ ├── link2.stl
│ │ │ ├── link3.obj
│ │ │ ├── link3.stl
│ │ │ ├── link4.obj
│ │ │ ├── link4.stl
│ │ │ ├── link5.obj
│ │ │ ├── link5.stl
│ │ │ ├── link6.obj
│ │ │ ├── link6.stl
│ │ │ ├── link7.obj
│ │ │ ├── link7.stl
│ │ │ ├── stltoobj.bat
│ │ │ └── stltoobj.mlx
│ │ └── visual
│ │ │ ├── daetoobj.bat
│ │ │ ├── daetoobj.mlx
│ │ │ ├── finger.dae
│ │ │ ├── finger.mtl
│ │ │ ├── finger.obj
│ │ │ ├── hand.dae
│ │ │ ├── hand.mtl
│ │ │ ├── hand.obj
│ │ │ ├── link0.dae
│ │ │ ├── link0.mtl
│ │ │ ├── link0.obj
│ │ │ ├── link1.dae
│ │ │ ├── link1.mtl
│ │ │ ├── link1.obj
│ │ │ ├── link2.dae
│ │ │ ├── link2.mtl
│ │ │ ├── link2.obj
│ │ │ ├── link3.dae
│ │ │ ├── link3.mtl
│ │ │ ├── link3.obj
│ │ │ ├── link4.dae
│ │ │ ├── link4.mtl
│ │ │ ├── link4.obj
│ │ │ ├── link5.dae
│ │ │ ├── link5.mtl
│ │ │ ├── link5.obj
│ │ │ ├── link6.dae
│ │ │ ├── link6.mtl
│ │ │ ├── link6.obj
│ │ │ ├── link7.dae
│ │ │ ├── link7.mtl
│ │ │ └── link7.obj
│ └── robots
│ │ ├── franka_panda.urdf
│ │ └── franka_panda_dynamics.urdf
├── single_obj_urdf_template.urdf
└── ycb
│ ├── 010_potted_meat_can
│ ├── 010_potted_meat_can.urdf
│ ├── MI_010_potted_meat_can_MI_010_potted_meat_can_D.png
│ ├── collision.obj
│ ├── textured.mtl
│ └── textured.obj
│ ├── 011_banana
│ ├── 011_banana.urdf
│ ├── MI_011_banana_MI_011_banana_D.png
│ ├── collision.obj
│ ├── textured.mtl
│ └── textured.obj
│ ├── 025_mug
│ ├── 025_mug.urdf
│ ├── MI_025_mug_MI_025_mug_D.png
│ ├── mug_collision.obj
│ ├── mug_visual.obj
│ ├── textured.mtl
│ └── textured.obj
│ └── 061_foam_brick
│ ├── 061_foam_brick.urdf
│ ├── MI_061_foam_brick_MI_061_foam_brick_D.png
│ ├── textured.mtl
│ └── textured.obj
├── cfg
├── apply_force.yaml
├── franka.yaml
├── franka_impedance_control.yaml
├── franka_pick_block.yaml
├── franka_pick_block_ray.yaml
├── franka_pick_soft_obj.yaml
├── franka_point_cloud_fusion.yaml
├── franka_rl_stable_baselines.yaml
└── franka_rl_vec_env.yaml
├── examples
├── apply_force.py
├── franka.py
├── franka_impedance_control.py
├── franka_pick_block.py
├── franka_pick_block_ray.py
├── franka_pick_soft_obj.py
├── franka_point_cloud_fusion.py
├── franka_rl_stable_baselines.py
└── franka_rl_vec_env.py
├── isaacgym_utils
├── __init__.py
├── assets
│ ├── __init__.py
│ ├── assets.py
│ ├── franka.py
│ ├── franka_numerical_utils.cpython-36m-x86_64-linux-gnu.so
│ ├── franka_numerical_utils.cpython-37m-x86_64-linux-gnu.so
│ └── franka_numerical_utils_raw.py
├── camera.py
├── constants.py
├── ctrl_utils.py
├── draw.py
├── math_utils.py
├── policy.py
├── rl
│ ├── __init__.py
│ ├── franka_vec_env.py
│ ├── stable_baselines.py
│ └── vec_env.py
└── scene.py
├── scripts
└── mesh_to_urdf.py
└── setup.py
/.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 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
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 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
131 | *.swp
132 | *.swo
133 |
134 | outs/
135 | .vscode/
--------------------------------------------------------------------------------
/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.md:
--------------------------------------------------------------------------------
1 | # isaacgym-utils
2 | This repo contains wrappers and utilities for `isaacgym`
3 |
4 | Supported version of Isaac Gym: 1.0rc2
5 |
6 | Supported `up_axis` mode: `z` (`UP_AXIS_Z` in the Isaac Gym documentation)
7 |
8 | ## Installation
9 |
10 | ### Install IsaacGym
11 |
12 | Install IsaacGym from [Nvidia](https://developer.nvidia.com/isaac-gym)
13 |
14 | This library supports the latest IsaacGym version - `1.0.preview2`.
15 | It will not work with older versions.
16 |
17 | ### Install isaacgym-utils
18 |
19 | Install `isaacgym-utils`:
20 |
21 | ```bash
22 | git clone git@github.com:iamlab-cmu/isaacgym-utils.git
23 | pip install -e isaacgym-utils
24 | ```
25 |
26 | By default, only "core" dependencies are installed. To install dependencies needed for optional `isaagym-utils` capabilities, modify the above `pip install` command to indicate the desired optional capability. The following commands will also install the core dependencies.
27 |
28 | Reinforcement learning (RL):
29 | ```
30 | pip install -e isaacgym-utils[rl]
31 | ```
32 |
33 | Parallel IsaacGym instances via Ray:
34 | ```
35 | pip install -e isaacgym-utils[ray]
36 | ```
37 |
38 | Multiple capabilities can be specified:
39 | ```
40 | pip install -e isaacgym-utils[ray,rl]
41 | ```
42 |
43 | Or, install all capabilities:
44 | ```
45 | pip install -e isaacgym-utils[all]
46 | ```
47 |
48 | ## Running examples
49 |
50 | Examples scripts can be found in `isaacgym-utils/examples/`.
51 | These scripts need to be run at the root level of `isaacgym-utils`:
52 |
53 | ```bash
54 | cd isaacgym-utils
55 | python examples/run_franka.py
56 | ```
57 |
58 | Each example script has a corresponding config file in `cfg/` that can be used to change object properties like friction.
59 |
60 | ### Running with Ray
61 |
62 | [Ray](https://github.com/ray-project/ray) is a fast and simple framework for building and running distributed applications.
63 |
64 | Requires the `[ray]` or `[all]` installation of `isaacgym-utils`.
65 |
66 | See `isaacgym_utils/examples/franka_pick_block_ray.py` for an example of running multiple `isaacgym` instances in parallel using Ray.
67 |
68 | ### RL environment
69 |
70 | Requires the `[rl]` or `[all]` installation of `isaacgym-utils`.
71 |
72 | See `isaacgym_utils/rl/vec_env.py` for the abstract Vec Env base class that is used for RL.
73 | It contains definitions of methods that are expected to be overwritten by a child class for a specific RL environment.
74 |
75 | See `isaacgym_utils/rl/franka_vec_env.py` for an example of an RL env with a Franka robot using joint control, variable impedance control, and hybrid force-position control.
76 |
77 | See `examples/run_franka_rl_vec_env.py` for an example of running the RL environment, and refer to the corresponding config for changing various aspects of the environment (e.g. in the YAML config, the fields under `franka.action` determine what type of action space is used).
78 |
79 | For new tasks and control schemes, you can make a new class that inherits `GymVecEnv` (or `GymFrankaVecEnv` if using the Franka) and overwrite the appropriate methods.
80 |
81 | ## Loading external objects
82 | To load external meshes, the meshes need to be wrapped in an URDF file.
83 | See `assets/ycb` for some examples.
84 | The script `scripts/mesh_to_urdf.py` can help make these URDFs, but using it is not necessary.
85 | Then, they can be loaded via `GymURDFAsset`.
86 | See `GymFrankaBlockVecEnv._setup_single_env_gen` in `isaacgym_utils/rl/franka_vec_env.py` for an example.
87 |
88 | ## Tensor API
89 |
90 | To use IsaacGym's Tensor API, set `scene->gym->use_gpu_pipeline: True` in the yaml configs.
91 |
92 | This switches `isaacgym-utils`' API to use the Tensor API backend, and you can access the tensors directly using `scene.tensors`.
93 |
94 | To directly write values into writable tensors (see IsaacGym docs for more details), instead of relying on `isaacgym-utils`' internal implementations, you should:
95 | 1. Write to a tensor in `scene.tensors`
96 | 2. Call `scene.register_actor_tensor_to_update` to ensure that the writes are committed during the next simulation step.
97 |
98 | ## Things to Note
99 |
100 | * Attractors can't be used if `use_gpu_pipeline: True`
101 | * If using `physx` and not controlling the an actor with joint PD control, you must set `dof_props->stiffness` to have all `0`'s, otherwise IsaacGym's internal PD control is still in effect, even if you're sending torque commands or using attractors. This is not a problem when using the `flex` backend.
102 | * We only support `scene->gym->up_axis: z` - setting the `up_axis` to `x` or `y` will give unexpected behaviors for camera rendering. This is a bug internal to IsaacGym.
103 | * `flex` w/ backend supports getting point-wise contacts. `physx` backend w/ `use_gpu_pipeline: True` and `use_gpu: True` only supports getting body-wise contacts (summing up all point-wise contacts). Other `physx` configurations do not support getting any contact forces.
104 | * `flex` does not support `use_gpu_pipeline: True`
105 |
106 | ## Citation
107 |
108 | If you use `isaacgym-utils` in a publication, please consider citing the repo:
109 |
110 | ```
111 | @misc{isaacgym-utils,
112 | title = {IsaacGym Utilities},
113 | year = {2021},
114 | note = {Developed by the CMU Intelligent Autonomous Manipulation Lab},
115 | url={https://github.com/iamlab-cmu/isaacgym-utils},
116 | author = {Liang, Jacky},
117 | }
118 | ```
119 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/finger.obj:
--------------------------------------------------------------------------------
1 | ####
2 | #
3 | # OBJ File Generated by Meshlab
4 | #
5 | ####
6 | # Object finger.obj
7 | #
8 | # Vertices: 52
9 | # Faces: 32
10 | #
11 | ####
12 | vn 0.999991 0.003723 -0.001919
13 | v 0.010360 0.026403 0.000155
14 | vn 0.019341 -0.997893 -0.061925
15 | v 0.010449 0.002583 0.000147
16 | vn -0.999568 -0.025962 0.013789
17 | v -0.010387 0.002534 0.000132
18 | vn -0.999606 -0.009503 0.026403
19 | v -0.010479 0.016102 0.018988
20 | vn -0.000579 0.001464 -0.999999
21 | v -0.010401 0.026309 0.000167
22 | vn -0.044737 0.976483 0.210900
23 | v -0.010389 0.025220 0.019188
24 | vn -0.871286 -0.490748 0.005227
25 | v -0.008730 -0.000024 0.036165
26 | vn 0.999861 0.006488 0.015354
27 | v 0.010400 0.025253 0.019037
28 | vn 0.377718 0.867563 0.323518
29 | v 0.005840 0.014274 0.053803
30 | vn 0.736099 -0.021564 0.676530
31 | v 0.008616 0.013989 0.051328
32 | vn 0.999373 -0.008600 0.034345
33 | v 0.010495 0.015103 0.018436
34 | vn 0.013041 -0.999896 -0.006124
35 | v 0.008693 -0.000133 0.050166
36 | vn -0.998603 -0.032800 0.041418
37 | v -0.008623 -0.000057 0.050953
38 | vn -0.588468 -0.017705 0.808327
39 | v -0.005481 -0.000091 0.053725
40 | vn 0.004085 -0.008700 0.999954
41 | v -0.005278 0.014293 0.053849
42 | vn -0.691057 -0.012018 0.722700
43 | v -0.007778 0.014218 0.052366
44 | vn -0.665951 0.690851 0.281486
45 | v -0.008841 0.013918 0.050589
46 | vn 0.736099 -0.021564 0.676530
47 | v 0.006138 -0.000021 0.053578
48 | vn -0.002818 0.998255 0.058981
49 | v 0.010360 0.026403 0.000155
50 | vn 0.000073 0.000898 -1.000000
51 | v 0.010360 0.026403 0.000155
52 | vn 0.999898 -0.012431 0.007036
53 | v 0.010449 0.002583 0.000147
54 | vn 0.000724 0.000331 -1.000000
55 | v 0.010449 0.002583 0.000147
56 | vn -0.871286 -0.490748 0.005227
57 | v -0.010387 0.002534 0.000132
58 | vn 0.002403 -0.997480 -0.070914
59 | v -0.010387 0.002534 0.000132
60 | vn 0.000073 0.000898 -1.000000
61 | v -0.010387 0.002534 0.000132
62 | vn -0.004486 0.998354 0.057168
63 | v -0.010401 0.026309 0.000167
64 | vn -0.999988 0.004662 -0.001626
65 | v -0.010401 0.026309 0.000167
66 | vn -0.665951 0.690851 0.281486
67 | v -0.010389 0.025220 0.019188
68 | vn -0.999597 0.009346 0.026807
69 | v -0.010389 0.025220 0.019188
70 | vn 0.006493 -0.999457 -0.032313
71 | v -0.008730 -0.000024 0.036165
72 | vn 0.377718 0.867563 0.323518
73 | v 0.010400 0.025253 0.019037
74 | vn -0.000242 0.983230 0.182372
75 | v 0.010400 0.025253 0.019037
76 | vn 0.665647 0.002096 0.746264
77 | v 0.005840 0.014274 0.053803
78 | vn 0.008418 -0.012115 0.999891
79 | v 0.005840 0.014274 0.053803
80 | vn 0.001757 0.953702 0.300749
81 | v 0.005840 0.014274 0.053803
82 | vn 0.377718 0.867563 0.323518
83 | v 0.008616 0.013989 0.051328
84 | vn 0.998361 0.003310 0.057136
85 | v 0.008616 0.013989 0.051328
86 | vn 0.798906 -0.045001 0.599770
87 | v 0.008693 -0.000133 0.050166
88 | vn 0.998687 -0.025065 0.044683
89 | v 0.008693 -0.000133 0.050166
90 | vn -0.769031 -0.017753 0.638965
91 | v -0.008623 -0.000057 0.050953
92 | vn -0.008996 -0.999957 -0.002185
93 | v -0.008623 -0.000057 0.050953
94 | vn -0.871286 -0.490748 0.005227
95 | v -0.008623 -0.000057 0.050953
96 | vn 0.008418 -0.012115 0.999891
97 | v -0.005481 -0.000091 0.053725
98 | vn -0.002059 -0.999940 0.010793
99 | v -0.005481 -0.000091 0.053725
100 | vn -0.510143 -0.000217 0.860089
101 | v -0.005278 0.014293 0.053849
102 | vn -0.108731 0.943365 0.313433
103 | v -0.005278 0.014293 0.053849
104 | vn -0.665951 0.690851 0.281486
105 | v -0.007778 0.014218 0.052366
106 | vn -0.218924 0.920873 0.322590
107 | v -0.007778 0.014218 0.052366
108 | vn -0.858159 -0.000049 0.513385
109 | v -0.008841 0.013918 0.050589
110 | vn -0.998665 -0.002749 0.051583
111 | v -0.008841 0.013918 0.050589
112 | vn 0.006542 -0.999267 0.037718
113 | v 0.006138 -0.000021 0.053578
114 | vn 0.012751 -0.015529 0.999798
115 | v 0.006138 -0.000021 0.053578
116 | # 52 vertices, 0 vertices normals
117 |
118 | f 20//20 22//22 25//25
119 | f 3//3 4//4 27//27
120 | f 27//27 4//4 29//29
121 | f 2//2 30//30 24//24
122 | f 32//32 6//6 35//35
123 | f 25//25 5//5 20//20
124 | f 37//37 11//11 8//8
125 | f 11//11 39//39 21//21
126 | f 37//37 39//39 11//11
127 | f 42//42 23//23 7//7
128 | f 2//2 12//12 30//30
129 | f 12//12 44//44 30//30
130 | f 8//8 11//11 21//21
131 | f 8//8 21//21 1//1
132 | f 32//32 19//19 6//6
133 | f 6//6 46//46 35//35
134 | f 48//48 46//46 6//6
135 | f 40//40 14//14 16//16
136 | f 3//3 13//13 4//4
137 | f 31//31 9//9 36//36
138 | f 19//19 26//26 6//6
139 | f 4//4 50//50 29//29
140 | f 17//17 47//47 28//28
141 | f 34//34 43//43 52//52
142 | f 15//15 43//43 34//34
143 | f 12//12 51//51 44//44
144 | f 18//18 38//38 10//10
145 | f 44//44 41//41 30//30
146 | f 16//16 14//14 45//45
147 | f 13//13 50//50 4//4
148 | f 18//18 10//10 33//33
149 | f 16//16 49//49 40//40
150 | # 32 faces, 0 coords texture
151 |
152 | # End of File
153 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/finger.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/finger.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/hand.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/hand.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link0.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link0.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link1.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link1.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link2.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link2.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link3.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link3.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link4.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link4.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link5.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link5.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link6.obj:
--------------------------------------------------------------------------------
1 | ####
2 | #
3 | # OBJ File Generated by Meshlab
4 | #
5 | ####
6 | # Object link6.obj
7 | #
8 | # Vertices: 143
9 | # Faces: 200
10 | #
11 | ####
12 | vn -0.760825 -0.313437 0.568245
13 | v -0.044623 -0.016425 0.028378
14 | vn -0.227174 -0.024276 -0.973551
15 | v -0.048005 -0.003164 -0.014747
16 | vn -0.250817 -0.113303 -0.961381
17 | v -0.043919 -0.019759 -0.014745
18 | vn -0.041341 -0.994369 -0.097580
19 | v 0.082446 -0.051388 -0.043985
20 | vn -0.195639 -0.979522 -0.047568
21 | v -0.010917 -0.047107 -0.014281
22 | vn -0.276602 -0.353944 -0.893429
23 | v -0.024988 -0.041242 -0.014744
24 | vn -0.829417 0.191909 0.524631
25 | v -0.046709 0.007900 0.028003
26 | vn -0.216872 0.039632 -0.975395
27 | v -0.046934 0.010732 -0.014834
28 | vn -0.119085 0.060683 -0.991028
29 | v 0.083335 0.020392 -0.043403
30 | vn -0.263959 -0.893837 0.362466
31 | v -0.014513 -0.042906 0.031953
32 | vn -0.075488 -0.989980 0.119336
33 | v 0.052828 -0.051189 0.031754
34 | vn -0.119869 -0.687952 0.715788
35 | v 0.084025 -0.051216 0.044034
36 | vn -0.790281 0.004006 0.612732
37 | v -0.046951 -0.001408 0.029664
38 | vn -0.728890 -0.684184 0.024747
39 | v -0.035119 -0.033151 -0.014812
40 | vn 0.129546 0.093020 0.987201
41 | v 0.040446 0.018833 0.055529
42 | vn 0.292048 0.158849 0.943120
43 | v 0.099598 0.048589 0.039292
44 | vn 0.231240 0.829489 0.508405
45 | v 0.090083 0.071522 0.036134
46 | vn -0.000859 -0.999981 -0.006132
47 | v 0.096210 -0.051223 0.043315
48 | vn 0.145610 -0.049981 0.988079
49 | v 0.043446 -0.017819 0.055119
50 | vn -0.084144 -0.578348 0.811439
51 | v 0.015562 -0.024034 0.056309
52 | vn 0.586421 0.059774 0.807798
53 | v 0.113921 0.019367 0.035382
54 | vn 0.340553 0.037708 0.939469
55 | v 0.103877 0.012659 0.041045
56 | vn -0.000029 -0.999996 -0.002717
57 | v 0.112193 -0.051199 0.037192
58 | vn -0.403518 -0.909660 0.098445
59 | v -0.020125 -0.043108 0.021211
60 | vn -0.578769 -0.761934 0.290661
61 | v -0.029993 -0.035958 0.029048
62 | vn -0.762049 0.395550 0.512660
63 | v -0.043011 0.020195 0.027855
64 | vn -0.230617 0.149398 -0.961507
65 | v -0.040367 0.026331 -0.014752
66 | vn 0.193475 0.038003 -0.980369
67 | v 0.096678 0.014294 -0.043244
68 | vn 0.006958 -0.999945 -0.007882
69 | v 0.097130 -0.051200 -0.043143
70 | vn -0.202763 -0.970889 0.127524
71 | v -0.009168 -0.046587 0.021677
72 | vn -0.679115 -0.506270 0.531500
73 | v -0.037619 -0.028323 0.028484
74 | vn 0.000691 -1.000000 0.000464
75 | v 0.123994 -0.051197 0.025458
76 | vn 0.765772 0.046628 0.641420
77 | v 0.121453 0.018448 0.028662
78 | vn 0.369273 0.928776 -0.031822
79 | v 0.108684 0.074084 -0.011412
80 | vn 0.094464 0.979820 0.176149
81 | v 0.078251 0.079509 0.024287
82 | vn 0.315937 0.899248 0.302552
83 | v 0.100013 0.075251 0.024123
84 | vn 0.676166 0.733916 0.064549
85 | v 0.118023 0.068405 0.008846
86 | vn 0.893725 0.448572 -0.006256
87 | v 0.126265 0.058419 -0.000245
88 | vn 0.697384 0.714265 -0.058994
89 | v 0.120245 0.066297 -0.006879
90 | vn -0.216668 0.948192 -0.232349
91 | v 0.059885 0.080214 -0.015544
92 | vn -0.275853 0.961199 0.001081
93 | v 0.057760 0.081278 0.000354
94 | vn 0.029229 0.998825 -0.038654
95 | v 0.067158 0.081681 -0.007441
96 | vn 0.088749 0.982223 -0.165412
97 | v 0.077314 0.079608 -0.023509
98 | vn 0.944639 0.003023 0.328099
99 | v 0.129336 -0.051197 0.015630
100 | vn -0.584560 0.528005 0.616036
101 | v -0.031455 0.029034 0.035793
102 | vn -0.204236 0.001661 0.978920
103 | v -0.015126 0.020082 0.052653
104 | vn -0.371836 0.633636 0.678412
105 | v -0.018070 0.034711 0.040549
106 | vn 0.899475 0.038563 0.435268
107 | v 0.127329 0.017965 0.019311
108 | vn -0.223776 0.567845 0.792134
109 | v -0.005128 0.024063 0.054418
110 | vn -0.108490 -0.640484 0.760270
111 | v -0.007400 -0.023724 0.054148
112 | vn -0.040454 -0.997641 -0.055465
113 | v 0.053597 -0.051187 -0.031059
114 | vn 0.003620 0.140361 -0.990094
115 | v 0.086062 0.049497 -0.040907
116 | vn 0.097521 0.837176 -0.538168
117 | v 0.082371 0.072672 -0.036209
118 | vn -0.377555 0.802609 -0.461812
119 | v -0.028926 0.038945 -0.014661
120 | vn -0.000017 -1.000000 -0.000020
121 | v 0.109158 -0.051199 -0.038847
122 | vn 0.639044 0.046158 -0.767784
123 | v 0.117111 0.020645 -0.032890
124 | vn -0.000231 -1.000000 0.000161
125 | v 0.122347 -0.051200 -0.027866
126 | vn 0.528221 0.825788 0.197631
127 | v 0.111398 0.072297 0.015605
128 | vn -0.084140 0.986822 0.138216
129 | v 0.065655 0.081334 0.013335
130 | vn 0.575960 0.785888 -0.225053
131 | v 0.113856 0.070434 -0.016021
132 | vn 0.577630 0.624668 -0.525484
133 | v 0.109980 0.068092 -0.027204
134 | vn 0.332492 0.896521 -0.292744
135 | v 0.100100 0.075228 -0.023901
136 | vn 0.335839 0.761350 -0.554579
137 | v 0.095384 0.070337 -0.035672
138 | vn -0.019071 0.244517 0.969457
139 | v 0.015051 0.024085 0.056206
140 | vn 0.372468 0.788062 0.490128
141 | v 0.102437 0.068088 0.033798
142 | vn -0.112523 0.747069 0.655153
143 | v 0.074318 0.074768 0.033919
144 | vn 0.943473 0.000131 -0.331448
145 | v 0.129874 -0.051199 -0.014322
146 | vn 0.999933 0.000150 0.011574
147 | v 0.132208 -0.051199 0.001350
148 | vn -0.216552 0.901407 0.374928
149 | v 0.062339 0.077814 0.024078
150 | vn -0.711251 -0.175616 0.680647
151 | v -0.039733 -0.010686 0.037406
152 | vn -0.658279 0.072234 0.749301
153 | v -0.035869 0.005669 0.042117
154 | vn -0.742200 0.259003 0.618108
155 | v -0.040368 0.014930 0.035457
156 | vn -0.571258 0.327410 0.752640
157 | v -0.027616 0.021411 0.043835
158 | vn -0.575558 -0.190487 0.795266
159 | v -0.022397 -0.011884 0.051059
160 | vn -0.597403 -0.453957 0.661085
161 | v -0.031783 -0.025374 0.038750
162 | vn -0.508926 0.855348 0.096825
163 | v -0.025173 0.040277 0.022046
164 | vn 0.881901 0.051748 -0.468585
165 | v 0.125861 0.020175 -0.022236
166 | vn 0.359524 0.125867 -0.924608
167 | v 0.103422 0.042110 -0.038909
168 | vn 0.898568 0.144266 0.414444
169 | v 0.124764 0.043403 0.019519
170 | vn 0.823244 0.473270 0.313505
171 | v 0.121380 0.063099 0.015205
172 | vn 0.720224 0.216675 0.659037
173 | v 0.118857 0.052366 0.026578
174 | vn 0.135918 0.889040 -0.437190
175 | v 0.086831 0.076754 -0.029051
176 | vn -0.324712 0.927365 0.185892
177 | v 0.055642 0.079453 0.012235
178 | vn -0.438879 0.789914 0.428277
179 | v -0.023225 0.039427 0.031264
180 | vn 0.160038 0.893116 0.420394
181 | v 0.088525 0.076758 0.027981
182 | vn 0.986362 0.058782 0.153737
183 | v 0.131421 0.021853 0.006249
184 | vn -0.337778 -0.682845 0.647787
185 | v -0.017132 -0.035457 0.040683
186 | vn -0.701258 0.678143 0.219906
187 | v -0.034979 0.031425 0.028510
188 | vn 0.766557 0.137252 -0.627337
189 | v 0.120110 0.042625 -0.027355
190 | vn 0.503743 0.314034 -0.804752
191 | v 0.103585 0.065560 -0.033878
192 | vn -0.234030 0.004748 0.972218
193 | v -0.023699 0.007574 0.050651
194 | vn 0.983354 0.031088 -0.179021
195 | v 0.131348 0.009396 -0.007998
196 | vn 0.970570 0.163231 -0.177056
197 | v 0.129079 0.045296 -0.006632
198 | vn 0.887125 0.190674 -0.420301
199 | v 0.124368 0.048727 -0.018195
200 | vn 0.688872 0.355725 0.631598
201 | v 0.110567 0.067759 0.026951
202 | vn 0.963881 0.206525 0.168170
203 | v 0.128215 0.049971 0.005706
204 | vn 0.826527 0.473910 -0.303748
205 | v 0.121277 0.063276 -0.015132
206 | vn -0.280584 0.356576 -0.891138
207 | v 0.070077 0.076146 -0.030948
208 | vn 0.456633 0.037334 -0.888872
209 | v 0.109491 0.010677 -0.038422
210 | vn 0.499147 0.142382 0.854740
211 | v 0.109808 0.046044 0.035077
212 | vn 0.579021 0.165195 -0.798402
213 | v 0.112939 0.045550 -0.033175
214 | vn 0.728346 0.299922 -0.616083
215 | v 0.117625 0.059065 -0.024898
216 | vn -0.952315 -0.304503 0.019368
217 | v -0.044623 -0.016425 0.028378
218 | vn -0.997230 -0.072544 0.016407
219 | v -0.048005 -0.003164 -0.014747
220 | vn -0.899520 -0.436662 0.013745
221 | v -0.043919 -0.019759 -0.014745
222 | vn -0.164880 -0.080273 -0.983042
223 | v 0.082446 -0.051388 -0.043985
224 | vn -0.254002 -0.664782 -0.702530
225 | v 0.082446 -0.051388 -0.043985
226 | vn -0.254002 -0.664782 -0.702530
227 | v -0.010917 -0.047107 -0.014281
228 | vn -0.529491 -0.848066 0.020563
229 | v -0.024988 -0.041242 -0.014744
230 | vn -0.254002 -0.664782 -0.702530
231 | v -0.024988 -0.041242 -0.014744
232 | vn -0.990987 0.132592 0.019101
233 | v -0.046709 0.007900 0.028003
234 | vn -0.967319 0.253318 0.011129
235 | v -0.046934 0.010732 -0.014834
236 | vn 0.056179 -0.289941 0.955394
237 | v 0.084025 -0.051216 0.044034
238 | vn -0.016650 -0.999011 0.041228
239 | v 0.084025 -0.051216 0.044034
240 | vn -0.997667 -0.063048 0.026167
241 | v -0.046951 -0.001408 0.029664
242 | vn -0.270505 -0.261861 -0.926421
243 | v -0.035119 -0.033151 -0.014812
244 | vn 0.114237 0.288790 0.950553
245 | v 0.090083 0.071522 0.036134
246 | vn 0.183975 -0.126464 0.974762
247 | v 0.096210 -0.051223 0.043315
248 | vn 0.005584 -0.084356 0.996420
249 | v 0.015562 -0.024034 0.056309
250 | vn 0.561574 -0.000840 0.827426
251 | v 0.112193 -0.051199 0.037192
252 | vn -0.906059 0.422734 0.018777
253 | v -0.043011 0.020195 0.027855
254 | vn -0.833651 0.552085 0.015107
255 | v -0.040367 0.026331 -0.014752
256 | vn 0.198828 -0.000126 -0.980034
257 | v 0.097130 -0.051200 -0.043143
258 | vn -0.806661 -0.590467 0.025425
259 | v -0.037619 -0.028323 0.028484
260 | vn 0.816513 -0.000128 0.577327
261 | v 0.123994 -0.051197 0.025458
262 | vn 0.000170 -1.000000 0.000139
263 | v 0.129336 -0.051197 0.015630
264 | vn -0.459215 0.462636 0.758347
265 | v -0.015126 0.020082 0.052653
266 | vn -0.119042 0.000919 0.992889
267 | v -0.005128 0.024063 0.054418
268 | vn -0.456658 -0.444356 0.770721
269 | v -0.007400 -0.023724 0.054148
270 | vn -0.157574 -0.000315 0.987507
271 | v -0.007400 -0.023724 0.054148
272 | vn -0.173326 0.243748 -0.954225
273 | v 0.082371 0.072672 -0.036209
274 | vn -0.573214 0.819303 -0.012984
275 | v -0.028926 0.038945 -0.014661
276 | vn -0.267514 0.297194 -0.916576
277 | v -0.028926 0.038945 -0.014661
278 | vn 0.484605 0.000186 -0.874733
279 | v 0.109158 -0.051199 -0.038847
280 | vn 0.771079 0.000055 -0.636740
281 | v 0.122347 -0.051200 -0.027866
282 | vn 0.193139 0.190850 -0.962431
283 | v 0.095384 0.070337 -0.035672
284 | vn 0.469405 0.247244 0.847661
285 | v 0.102437 0.068088 0.033798
286 | vn 0.001588 -0.999998 -0.000793
287 | v 0.129874 -0.051199 -0.014322
288 | vn -0.000574 -1.000000 0.000084
289 | v 0.132208 -0.051199 0.001350
290 | vn -0.218849 0.001118 0.975758
291 | v -0.022397 -0.011884 0.051059
292 | vn -0.569867 0.148437 0.808219
293 | v -0.023699 0.007574 0.050651
294 | vn 0.520243 0.762142 0.385339
295 | v 0.110567 0.067759 0.026951
296 | vn -0.114543 0.890817 -0.439688
297 | v 0.070077 0.076146 -0.030948
298 | # 143 vertices, 0 vertices normals
299 |
300 | f 103//103 104//104 105//105
301 | f 107//107 108//108 110//110
302 | f 111//111 112//112 104//104
303 | f 2//2 106//106 3//3
304 | f 8//8 106//106 2//2
305 | f 9//9 106//106 8//8
306 | f 10//10 11//11 114//114
307 | f 115//115 104//104 103//103
308 | f 106//106 6//6 116//116
309 | f 106//106 116//116 3//3
310 | f 15//15 16//16 117//117
311 | f 118//118 19//19 119//119
312 | f 21//21 22//22 120//120
313 | f 5//5 24//24 109//109
314 | f 14//14 109//109 25//25
315 | f 112//112 121//121 122//122
316 | f 111//111 104//104 115//115
317 | f 106//106 28//28 123//123
318 | f 30//30 5//5 11//11
319 | f 14//14 124//124 105//105
320 | f 125//125 33//33 120//120
321 | f 34//34 35//35 36//36
322 | f 37//37 38//38 39//39
323 | f 40//40 41//41 42//42
324 | f 34//34 43//43 35//35
325 | f 113//113 118//118 119//119
326 | f 18//18 114//114 23//23
327 | f 32//32 23//23 114//114
328 | f 32//32 114//114 126//126
329 | f 45//45 127//127 47//47
330 | f 10//10 30//30 11//11
331 | f 118//118 120//120 22//22
332 | f 48//48 125//125 44//44
333 | f 128//128 130//130 119//119
334 | f 30//30 24//24 5//5
335 | f 24//24 30//30 10//10
336 | f 51//51 11//11 5//5
337 | f 51//51 5//5 4//4
338 | f 52//52 9//9 27//27
339 | f 8//8 27//27 9//9
340 | f 131//131 27//27 133//133
341 | f 134//134 56//56 135//135
342 | f 106//106 9//9 28//28
343 | f 36//36 58//58 34//34
344 | f 41//41 59//59 42//42
345 | f 60//60 61//61 62//62
346 | f 52//52 131//131 136//136
347 | f 43//43 42//42 35//35
348 | f 35//35 42//42 59//59
349 | f 119//119 15//15 64//64
350 | f 19//19 15//15 119//119
351 | f 16//16 137//137 117//117
352 | f 66//66 64//64 117//117
353 | f 55//55 138//138 29//29
354 | f 126//126 138//138 139//139
355 | f 114//114 138//138 126//126
356 | f 138//138 4//4 29//29
357 | f 69//69 35//35 59//59
358 | f 70//70 71//71 13//13
359 | f 72//72 71//71 73//73
360 | f 22//22 19//19 118//118
361 | f 33//33 21//21 120//120
362 | f 130//130 46//46 140//140
363 | f 128//128 119//119 64//64
364 | f 66//66 49//49 64//64
365 | f 12//12 20//20 50//50
366 | f 75//75 31//31 25//25
367 | f 24//24 25//25 109//109
368 | f 52//52 27//27 131//131
369 | f 45//45 72//72 73//73
370 | f 76//76 41//41 132//132
371 | f 57//57 138//138 55//55
372 | f 56//56 77//77 135//135
373 | f 28//28 134//134 123//123
374 | f 28//28 52//52 78//78
375 | f 124//124 103//103 105//105
376 | f 70//70 1//1 75//75
377 | f 125//125 48//48 33//33
378 | f 79//79 80//80 81//81
379 | f 60//60 34//34 39//39
380 | f 34//34 37//37 39//39
381 | f 58//58 37//37 34//34
382 | f 34//34 62//62 43//43
383 | f 82//82 43//43 62//62
384 | f 15//15 117//117 64//64
385 | f 138//138 51//51 4//4
386 | f 69//69 83//83 84//84
387 | f 127//127 45//45 73//73
388 | f 35//35 85//85 36//36
389 | f 19//19 22//22 15//15
390 | f 22//22 16//16 15//15
391 | f 68//68 86//86 44//44
392 | f 129//129 74//74 75//75
393 | f 46//46 130//130 128//128
394 | f 12//12 50//50 87//87
395 | f 124//124 14//14 25//25
396 | f 112//112 111//111 121//121
397 | f 122//122 88//88 132//132
398 | f 89//89 77//77 56//56
399 | f 61//61 90//90 63//63
400 | f 52//52 28//28 9//9
401 | f 71//71 72//72 13//13
402 | f 141//141 71//71 74//74
403 | f 1//1 31//31 75//75
404 | f 92//92 68//68 67//67
405 | f 86//86 92//92 93//93
406 | f 94//94 93//93 77//77
407 | f 65//65 142//142 36//36
408 | f 80//80 79//79 96//96
409 | f 80//80 95//95 81//81
410 | f 39//39 97//97 60//60
411 | f 97//97 61//61 60//60
412 | f 62//62 63//63 82//82
413 | f 43//43 82//82 143//143
414 | f 53//53 143//143 82//82
415 | f 54//54 40//40 143//143
416 | f 59//59 41//41 83//83
417 | f 84//84 47//47 66//66
418 | f 74//74 71//71 70//70
419 | f 35//35 66//66 85//85
420 | f 85//85 66//66 17//17
421 | f 44//44 86//86 48//48
422 | f 79//79 86//86 96//96
423 | f 86//86 79//79 48//48
424 | f 70//70 75//75 74//74
425 | f 87//87 10//10 12//12
426 | f 127//127 49//49 47//47
427 | f 131//131 133//133 98//98
428 | f 132//132 88//88 76//76
429 | f 76//76 83//83 41//41
430 | f 77//77 67//67 135//135
431 | f 78//78 99//99 28//28
432 | f 134//134 99//99 56//56
433 | f 72//72 7//7 13//13
434 | f 13//13 1//1 70//70
435 | f 24//24 10//10 25//25
436 | f 87//87 25//25 10//10
437 | f 75//75 25//25 87//87
438 | f 92//92 86//86 68//68
439 | f 81//81 21//21 33//33
440 | f 77//77 92//92 67//67
441 | f 94//94 97//97 93//93
442 | f 38//38 96//96 93//93
443 | f 80//80 58//58 142//142
444 | f 137//137 81//81 95//95
445 | f 100//100 137//137 16//16
446 | f 39//39 38//38 97//97
447 | f 38//38 80//80 96//96
448 | f 37//37 58//58 80//80
449 | f 90//90 78//78 136//136
450 | f 132//132 41//41 40//40
451 | f 35//35 69//69 66//66
452 | f 82//82 63//63 53//53
453 | f 43//43 143//143 40//40
454 | f 40//40 42//42 43//43
455 | f 49//49 66//66 47//47
456 | f 87//87 129//129 75//75
457 | f 46//46 91//91 140//140
458 | f 121//121 88//88 122//122
459 | f 26//26 7//7 72//72
460 | f 45//45 88//88 26//26
461 | f 84//84 45//45 47//47
462 | f 45//45 26//26 72//72
463 | f 28//28 99//99 134//134
464 | f 78//78 101//101 56//56
465 | f 102//102 90//90 61//61
466 | f 78//78 56//56 99//99
467 | f 33//33 79//79 81//81
468 | f 79//79 33//33 48//48
469 | f 102//102 97//97 94//94
470 | f 93//93 92//92 77//77
471 | f 58//58 36//36 142//142
472 | f 93//93 97//97 38//38
473 | f 37//37 80//80 38//38
474 | f 34//34 60//60 62//62
475 | f 61//61 63//63 62//62
476 | f 97//97 102//102 61//61
477 | f 136//136 78//78 52//52
478 | f 90//90 101//101 78//78
479 | f 66//66 69//69 84//84
480 | f 83//83 69//69 59//59
481 | f 17//17 65//65 36//36
482 | f 16//16 22//22 100//100
483 | f 100//100 22//22 21//21
484 | f 81//81 100//100 21//21
485 | f 71//71 141//141 73//73
486 | f 83//83 76//76 84//84
487 | f 84//84 88//88 45//45
488 | f 76//76 88//88 84//84
489 | f 56//56 101//101 89//89
490 | f 77//77 89//89 94//94
491 | f 102//102 94//94 89//89
492 | f 96//96 86//86 93//93
493 | f 81//81 137//137 100//100
494 | f 85//85 17//17 36//36
495 | f 141//141 127//127 73//73
496 | f 90//90 102//102 101//101
497 | f 101//101 102//102 89//89
498 | f 138//138 114//114 51//51
499 | f 114//114 11//11 51//51
500 | # 200 faces, 0 coords texture
501 |
502 | # End of File
503 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link6.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link6.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/link7.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/franka_description/meshes/collision/link7.stl
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/stltoobj.bat:
--------------------------------------------------------------------------------
1 | REM SET PATH=%PATH%;C:/Tools/Assimp/bin/x64/
2 | REM forfiles /m *.dae /c "cmd /c assimp export @file @fname.obj --verbose --show-log -ptv"
3 |
4 | SET PATH=%PATH%;C:/Program Files/VCG/MeshLab/
5 | forfiles /m *.stl /c "cmd /c meshlabserver -i @file -o @fname.obj -m vn -s stltoobj.mlx"
--------------------------------------------------------------------------------
/assets/franka_description/meshes/collision/stltoobj.mlx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/daetoobj.bat:
--------------------------------------------------------------------------------
1 | SET PATH=%PATH%;C:/Tools/Assimp/bin/x64/
2 | forfiles /m *.dae /c "cmd /c assimp export @file @fname.obj --verbose --show-log -ptv"
3 |
4 | REM SET PATH=%PATH%;C:/Program Files/VCG/MeshLab/
5 | REM forfiles /m *.dae /c "cmd /c meshlabserver -i @file -o @fname.obj -m vn vt
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/daetoobj.mlx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/finger.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 2
3 |
4 | newmtl Part__Feature001_006
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.901961 0.921569 0.929412
8 | Ks 0.250000 0.250000 0.250000
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Part__Feature_007
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 0.250980 0.250980 0.250980
18 | Ks 0.250000 0.250000 0.250000
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/hand.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 5
3 |
4 | newmtl Part__Feature001_008_005
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.250980 0.250980 0.250980
8 | Ks 0.007812 0.007812 0.007812
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Part__Feature002_005_005
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 0.901961 0.921569 0.929412
18 | Ks 0.015625 0.015625 0.015625
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
24 | newmtl Part__Feature005_001_005
25 | Ns -1.960784
26 | Ka 1.000000 1.000000 1.000000
27 | Kd 1.000000 1.000000 1.000000
28 | Ks 0.015625 0.015625 0.015625
29 | Ke 0.000000 0.000000 0.000000
30 | Ni 1.000000
31 | d 1.000000
32 | illum 2
33 |
34 | newmtl Part__Feature005_001_005_001
35 | Ns -1.960784
36 | Ka 1.000000 1.000000 1.000000
37 | Kd 0.901961 0.921569 0.929412
38 | Ks 0.015625 0.015625 0.015625
39 | Ke 0.000000 0.000000 0.000000
40 | Ni 1.000000
41 | d 1.000000
42 | illum 2
43 |
44 | newmtl Part__Feature_009_005
45 | Ns -1.960784
46 | Ka 1.000000 1.000000 1.000000
47 | Kd 0.250980 0.250980 0.250980
48 | Ks 0.015625 0.015625 0.015625
49 | Ke 0.000000 0.000000 0.000000
50 | Ni 1.000000
51 | d 1.000000
52 | illum 2
53 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link0.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 12
3 |
4 | newmtl Face636_001
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.901961 0.921569 0.929412
8 | Ks 0.125000 0.125000 0.125000
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Part__Feature017_001
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 1.000000 1.000000 1.000000
18 | Ks 0.500000 0.500000 0.500000
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
24 | newmtl Part__Feature018_001
25 | Ns -1.960784
26 | Ka 1.000000 1.000000 1.000000
27 | Kd 1.000000 1.000000 1.000000
28 | Ks 0.500000 0.500000 0.500000
29 | Ke 0.000000 0.000000 0.000000
30 | Ni 1.000000
31 | d 1.000000
32 | illum 2
33 |
34 | newmtl Part__Feature019_001
35 | Ns -1.960784
36 | Ka 1.000000 1.000000 1.000000
37 | Kd 1.000000 1.000000 1.000000
38 | Ks 0.125000 0.125000 0.125000
39 | Ke 0.000000 0.000000 0.000000
40 | Ni 1.000000
41 | d 1.000000
42 | illum 2
43 |
44 | newmtl Part__Feature022_001
45 | Ns -1.960784
46 | Ka 1.000000 1.000000 1.000000
47 | Kd 0.901961 0.921569 0.929412
48 | Ks 0.125000 0.125000 0.125000
49 | Ke 0.000000 0.000000 0.000000
50 | Ni 1.000000
51 | d 1.000000
52 | illum 2
53 |
54 | newmtl Part__Feature023_001
55 | Ns -1.960784
56 | Ka 1.000000 1.000000 1.000000
57 | Kd 0.250980 0.250980 0.250980
58 | Ks 0.125000 0.125000 0.125000
59 | Ke 0.000000 0.000000 0.000000
60 | Ni 1.000000
61 | d 1.000000
62 | illum 2
63 |
64 | newmtl Shell001_001
65 | Ns -1.960784
66 | Ka 1.000000 1.000000 1.000000
67 | Kd 0.250980 0.250980 0.250980
68 | Ks 0.125000 0.125000 0.125000
69 | Ke 0.000000 0.000000 0.000000
70 | Ni 1.000000
71 | d 1.000000
72 | illum 2
73 |
74 | newmtl Shell002_001
75 | Ns -1.960784
76 | Ka 1.000000 1.000000 1.000000
77 | Kd 0.901961 0.921569 0.929412
78 | Ks 0.125000 0.125000 0.125000
79 | Ke 0.000000 0.000000 0.000000
80 | Ni 1.000000
81 | d 1.000000
82 | illum 2
83 |
84 | newmtl Shell003_001
85 | Ns -1.960784
86 | Ka 1.000000 1.000000 1.000000
87 | Kd 0.901961 0.921569 0.929412
88 | Ks 0.125000 0.125000 0.125000
89 | Ke 0.000000 0.000000 0.000000
90 | Ni 1.000000
91 | d 1.000000
92 | illum 2
93 |
94 | newmtl Shell009_001
95 | Ns -1.960784
96 | Ka 1.000000 1.000000 1.000000
97 | Kd 0.250980 0.250980 0.250980
98 | Ks 0.125000 0.125000 0.125000
99 | Ke 0.000000 0.000000 0.000000
100 | Ni 1.000000
101 | d 1.000000
102 | illum 2
103 |
104 | newmtl Shell010_001
105 | Ns -1.960784
106 | Ka 1.000000 1.000000 1.000000
107 | Kd 0.901961 0.921569 0.929412
108 | Ks 0.125000 0.125000 0.125000
109 | Ke 0.000000 0.000000 0.000000
110 | Ni 1.000000
111 | d 1.000000
112 | illum 2
113 |
114 | newmtl Shell_001
115 | Ns -1.960784
116 | Ka 1.000000 1.000000 1.000000
117 | Kd 0.250980 0.250980 0.250980
118 | Ks 0.125000 0.125000 0.125000
119 | Ke 0.000000 0.000000 0.000000
120 | Ni 1.000000
121 | d 1.000000
122 | illum 2
123 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link1.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 1
3 |
4 | newmtl Part__Feature_001
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 1.000000 1.000000 1.000000
8 | Ks 0.062500 0.062500 0.062500
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link2.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 1
3 |
4 | newmtl Part__Feature024
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 1.000000 1.000000 1.000000
8 | Ks 0.125000 0.125000 0.125000
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link3.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 4
3 |
4 | newmtl Part__Feature001_010_001_002.001
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 1.000000 1.000000 1.000000
8 | Ks 0.007812 0.007812 0.007812
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Part__Feature002_007_001_002.001
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 1.000000 1.000000 1.000000
18 | Ks 0.007812 0.007812 0.007812
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
24 | newmtl Part__Feature003_004_001_002.001
25 | Ns -1.960784
26 | Ka 1.000000 1.000000 1.000000
27 | Kd 1.000000 1.000000 1.000000
28 | Ks 0.007812 0.007812 0.007812
29 | Ke 0.000000 0.000000 0.000000
30 | Ni 1.000000
31 | d 1.000000
32 | illum 2
33 |
34 | newmtl Part__Feature_001_001_001_002.001
35 | Ns -1.960784
36 | Ka 1.000000 1.000000 1.000000
37 | Kd 0.250980 0.250980 0.250980
38 | Ks 0.007812 0.007812 0.007812
39 | Ke 0.000000 0.000000 0.000000
40 | Ni 1.000000
41 | d 1.000000
42 | illum 2
43 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link4.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 4
3 |
4 | newmtl Part__Feature001_001_003_001
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 1.000000 1.000000 1.000000
8 | Ks 0.007812 0.007812 0.007812
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Part__Feature002_001_003_001
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 0.250980 0.250980 0.250980
18 | Ks 0.007812 0.007812 0.007812
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
24 | newmtl Part__Feature003_001_003_001
25 | Ns -1.960784
26 | Ka 1.000000 1.000000 1.000000
27 | Kd 1.000000 1.000000 1.000000
28 | Ks 0.007812 0.007812 0.007812
29 | Ke 0.000000 0.000000 0.000000
30 | Ni 1.000000
31 | d 1.000000
32 | illum 2
33 |
34 | newmtl Part__Feature_002_003_001
35 | Ns -1.960784
36 | Ka 1.000000 1.000000 1.000000
37 | Kd 1.000000 1.000000 1.000000
38 | Ks 0.007812 0.007812 0.007812
39 | Ke 0.000000 0.000000 0.000000
40 | Ni 1.000000
41 | d 1.000000
42 | illum 2
43 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link5.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 3
3 |
4 | newmtl Part__Feature_002_004_003
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 1.000000 1.000000 1.000000
8 | Ks 0.015625 0.015625 0.015625
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Shell001_001_001_003
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 0.250000 0.250000 0.250000
18 | Ks 0.015625 0.015625 0.015625
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
24 | newmtl Shell_001_001_003
25 | Ns -1.960784
26 | Ka 1.000000 1.000000 1.000000
27 | Kd 1.000000 1.000000 1.000000
28 | Ks 0.015625 0.015625 0.015625
29 | Ke 0.000000 0.000000 0.000000
30 | Ni 1.000000
31 | d 1.000000
32 | illum 2
33 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link6.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 17
3 |
4 | newmtl Face064_002_001_002_001
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 1.000000 0.000000 0.000000
8 | Ks 0.003906 0.003906 0.003906
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Face065_002_001_002_001
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 0.000000 1.000000 0.000000
18 | Ks 0.003906 0.003906 0.003906
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
24 | newmtl Face374_002_001_002_001
25 | Ns -1.960784
26 | Ka 1.000000 1.000000 1.000000
27 | Kd 1.000000 1.000000 1.000000
28 | Ks 0.003906 0.003906 0.003906
29 | Ke 0.000000 0.000000 0.000000
30 | Ni 1.000000
31 | d 1.000000
32 | illum 2
33 |
34 | newmtl Face539_002_001_002_001
35 | Ns -1.960784
36 | Ka 1.000000 1.000000 1.000000
37 | Kd 0.250980 0.250980 0.250980
38 | Ks 0.003906 0.003906 0.003906
39 | Ke 0.000000 0.000000 0.000000
40 | Ni 1.000000
41 | d 1.000000
42 | illum 2
43 |
44 | newmtl Part__Feature001_009_001_002_001
45 | Ns -1.960784
46 | Ka 1.000000 1.000000 1.000000
47 | Kd 0.250980 0.250980 0.250980
48 | Ks 0.003906 0.003906 0.003906
49 | Ke 0.000000 0.000000 0.000000
50 | Ni 1.000000
51 | d 1.000000
52 | illum 2
53 |
54 | newmtl Part__Feature002_006_001_002_001
55 | Ns -1.960784
56 | Ka 1.000000 1.000000 1.000000
57 | Kd 0.250980 0.250980 0.250980
58 | Ks 0.003906 0.003906 0.003906
59 | Ke 0.000000 0.000000 0.000000
60 | Ni 1.000000
61 | d 1.000000
62 | illum 2
63 |
64 | newmtl Shell002_002_001_002_001
65 | Ns -1.960784
66 | Ka 1.000000 1.000000 1.000000
67 | Kd 1.000000 1.000000 1.000000
68 | Ks 0.003906 0.003906 0.003906
69 | Ke 0.000000 0.000000 0.000000
70 | Ni 1.000000
71 | d 1.000000
72 | illum 2
73 |
74 | newmtl Shell003_002_001_002_001
75 | Ns -1.960784
76 | Ka 1.000000 1.000000 1.000000
77 | Kd 1.000000 1.000000 1.000000
78 | Ks 0.003906 0.003906 0.003906
79 | Ke 0.000000 0.000000 0.000000
80 | Ni 1.000000
81 | d 1.000000
82 | illum 2
83 |
84 | newmtl Shell004_001_001_002_001
85 | Ns -1.960784
86 | Ka 1.000000 1.000000 1.000000
87 | Kd 1.000000 1.000000 1.000000
88 | Ks 0.003906 0.003906 0.003906
89 | Ke 0.000000 0.000000 0.000000
90 | Ni 1.000000
91 | d 1.000000
92 | illum 2
93 |
94 | newmtl Shell005_001_001_002_001
95 | Ns -1.960784
96 | Ka 1.000000 1.000000 1.000000
97 | Kd 1.000000 1.000000 1.000000
98 | Ks 0.003906 0.003906 0.003906
99 | Ke 0.000000 0.000000 0.000000
100 | Ni 1.000000
101 | d 1.000000
102 | illum 2
103 |
104 | newmtl Shell006_003_002_001
105 | Ns -1.960784
106 | Ka 1.000000 1.000000 1.000000
107 | Kd 0.901961 0.921569 0.929412
108 | Ks 0.015625 0.015625 0.015625
109 | Ke 0.000000 0.000000 0.000000
110 | Ni 1.000000
111 | d 1.000000
112 | illum 2
113 |
114 | newmtl Shell007_002_002_001
115 | Ns -1.960784
116 | Ka 1.000000 1.000000 1.000000
117 | Kd 0.250000 0.250000 0.250000
118 | Ks 0.003906 0.003906 0.003906
119 | Ke 0.000000 0.000000 0.000000
120 | Ni 1.000000
121 | d 1.000000
122 | illum 2
123 |
124 | newmtl Shell011_002_002_001
125 | Ns -1.960784
126 | Ka 1.000000 1.000000 1.000000
127 | Kd 1.000000 1.000000 1.000000
128 | Ks 0.003906 0.003906 0.003906
129 | Ke 0.000000 0.000000 0.000000
130 | Ni 1.000000
131 | d 1.000000
132 | illum 2
133 |
134 | newmtl Shell012_002_002_001
135 | Ns -1.960784
136 | Ka 1.000000 1.000000 1.000000
137 | Kd 1.000000 1.000000 1.000000
138 | Ks 0.003906 0.003906 0.003906
139 | Ke 0.000000 0.000000 0.000000
140 | Ni 1.000000
141 | d 1.000000
142 | illum 2
143 |
144 | newmtl Shell_003_001_002_001
145 | Ns -1.960784
146 | Ka 1.000000 1.000000 1.000000
147 | Kd 0.250980 0.250980 0.250980
148 | Ks 0.003906 0.003906 0.003906
149 | Ke 0.000000 0.000000 0.000000
150 | Ni 1.000000
151 | d 1.000000
152 | illum 2
153 |
154 | newmtl Union001_001_001_002_001
155 | Ns -1.960784
156 | Ka 1.000000 1.000000 1.000000
157 | Kd 0.039216 0.541176 0.780392
158 | Ks 0.003906 0.003906 0.003906
159 | Ke 0.000000 0.000000 0.000000
160 | Ni 1.000000
161 | d 1.000000
162 | illum 2
163 |
164 | newmtl Union_001_001_002_001
165 | Ns -1.960784
166 | Ka 1.000000 1.000000 1.000000
167 | Kd 0.039216 0.541176 0.780392
168 | Ks 0.003906 0.003906 0.003906
169 | Ke 0.000000 0.000000 0.000000
170 | Ni 1.000000
171 | d 1.000000
172 | illum 2
173 |
--------------------------------------------------------------------------------
/assets/franka_description/meshes/visual/link7.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 8
3 |
4 | newmtl Part__Mirroring001_004_002
5 | Ns -1.960784
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.250980 0.250980 0.250980
8 | Ks 0.015625 0.015625 0.015625
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.000000
11 | d 1.000000
12 | illum 2
13 |
14 | newmtl Part__Mirroring002_004_001
15 | Ns -1.960784
16 | Ka 1.000000 1.000000 1.000000
17 | Kd 0.250980 0.250980 0.250980
18 | Ks 0.031250 0.031250 0.031250
19 | Ke 0.000000 0.000000 0.000000
20 | Ni 1.000000
21 | d 1.000000
22 | illum 2
23 |
24 | newmtl Part__Mirroring003_004_001
25 | Ns -1.960784
26 | Ka 1.000000 1.000000 1.000000
27 | Kd 0.250980 0.250980 0.250980
28 | Ks 0.031250 0.031250 0.031250
29 | Ke 0.000000 0.000000 0.000000
30 | Ni 1.000000
31 | d 1.000000
32 | illum 2
33 |
34 | newmtl Part__Mirroring004_004_002
35 | Ns -1.960784
36 | Ka 1.000000 1.000000 1.000000
37 | Kd 1.000000 1.000000 1.000000
38 | Ks 0.031250 0.031250 0.031250
39 | Ke 0.000000 0.000000 0.000000
40 | Ni 1.000000
41 | d 1.000000
42 | illum 2
43 |
44 | newmtl Part__Mirroring005_004_001
45 | Ns -1.960784
46 | Ka 1.000000 1.000000 1.000000
47 | Kd 0.250980 0.250980 0.250980
48 | Ks 0.031250 0.031250 0.031250
49 | Ke 0.000000 0.000000 0.000000
50 | Ni 1.000000
51 | d 1.000000
52 | illum 2
53 |
54 | newmtl Part__Mirroring006_004_001
55 | Ns -1.960784
56 | Ka 1.000000 1.000000 1.000000
57 | Kd 0.250980 0.250980 0.250980
58 | Ks 0.031250 0.031250 0.031250
59 | Ke 0.000000 0.000000 0.000000
60 | Ni 1.000000
61 | d 1.000000
62 | illum 2
63 |
64 | newmtl Part__Mirroring007_004_001
65 | Ns -1.960784
66 | Ka 1.000000 1.000000 1.000000
67 | Kd 0.250980 0.250980 0.250980
68 | Ks 0.031250 0.031250 0.031250
69 | Ke 0.000000 0.000000 0.000000
70 | Ni 1.000000
71 | d 1.000000
72 | illum 2
73 |
74 | newmtl Part__Mirroring_004_001
75 | Ns -1.960784
76 | Ka 1.000000 1.000000 1.000000
77 | Kd 0.898039 0.917647 0.929412
78 | Ks 0.031250 0.031250 0.031250
79 | Ke 0.000000 0.000000 0.000000
80 | Ni 1.000000
81 | d 1.000000
82 | illum 2
83 |
--------------------------------------------------------------------------------
/assets/franka_description/robots/franka_panda.urdf:
--------------------------------------------------------------------------------
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 |
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 |
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 |
183 |
184 |
187 |
188 |
189 |
190 |
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 |
--------------------------------------------------------------------------------
/assets/franka_description/robots/franka_panda_dynamics.urdf:
--------------------------------------------------------------------------------
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 |
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 |
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 |
218 |
219 |
222 |
223 |
224 |
225 |
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 |
--------------------------------------------------------------------------------
/assets/single_obj_urdf_template.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/assets/ycb/010_potted_meat_can/010_potted_meat_can.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/assets/ycb/010_potted_meat_can/MI_010_potted_meat_can_MI_010_potted_meat_can_D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/ycb/010_potted_meat_can/MI_010_potted_meat_can_MI_010_potted_meat_can_D.png
--------------------------------------------------------------------------------
/assets/ycb/010_potted_meat_can/collision.obj:
--------------------------------------------------------------------------------
1 | ####
2 | #
3 | # OBJ File Generated by Meshlab
4 | #
5 | ####
6 | # Object collision.obj
7 | #
8 | # Vertices: 52
9 | # Faces: 100
10 | #
11 | ####
12 | v -3.802714 -3.028801 3.358800
13 | v 3.396672 -2.447000 -4.970000
14 | v 4.566000 0.186400 -4.970000
15 | v 4.565958 0.187295 2.647084
16 | v -3.879100 2.369400 -4.970000
17 | v 3.155601 2.699000 2.647200
18 | v -4.969500 -1.947400 -4.970000
19 | v -5.127298 1.419374 2.647242
20 | v -4.207239 -2.553109 -4.970000
21 | v 4.157177 -2.381951 3.358800
22 | v -4.401140 -2.782960 3.358800
23 | v 3.942689 -2.171274 2.647208
24 | v -4.207277 -2.553087 2.647195
25 | v -4.152020 2.231490 -4.970000
26 | v -4.152000 2.231500 2.647200
27 | v 3.725099 2.475421 -4.970000
28 | v 3.725062 2.475451 2.647220
29 | v -5.155987 -2.116075 3.032603
30 | v -3.638001 -2.776600 2.647154
31 | v -3.768496 -3.027201 3.032699
32 | v 4.117407 -2.383910 3.032697
33 | v 4.673605 2.038493 3.032639
34 | v 4.846320 -1.647535 3.032693
35 | v 3.286121 2.949603 3.032689
36 | v -4.599731 2.306351 3.032675
37 | v -4.361322 -2.781164 3.032651
38 | v 4.720394 2.040701 3.358800
39 | v 3.878984 2.703564 3.032681
40 | v 3.918710 2.705372 3.358800
41 | v -4.639596 2.304304 3.358800
42 | v 3.155605 2.698998 -4.970000
43 | v -3.638000 -2.776600 -4.970000
44 | v 3.584300 -2.682800 3.358800
45 | v 3.320294 2.951200 3.358800
46 | v -4.066600 2.605200 3.358800
47 | v 3.396703 -2.446999 2.647200
48 | v 4.644900 -1.497000 -4.970000
49 | v 4.487201 1.869774 -4.970000
50 | v 4.487202 1.869763 2.647202
51 | v 4.644900 -1.497000 2.647201
52 | v -3.879103 2.369399 2.647188
53 | v -5.127295 1.419315 -4.970000
54 | v -4.969500 -1.947400 2.647200
55 | v 3.942645 -2.171328 -4.970000
56 | v -4.425000 2.093700 -4.970000
57 | v 4.893135 -1.645296 3.358800
58 | v -5.375522 1.567647 3.358800
59 | v -5.202800 -2.118300 3.358800
60 | v -4.425001 2.093699 2.647200
61 | v 3.549962 -2.684401 3.032656
62 | v -4.032379 2.606801 3.032662
63 | v -5.328721 1.569870 3.032646
64 | # 52 vertices, 0 vertices normals
65 |
66 | f 3 39 4
67 | f 5 41 31
68 | f 3 44 2
69 | f 14 9 7
70 | f 46 29 10
71 | f 11 30 47
72 | f 7 9 13
73 | f 49 15 14
74 | f 6 17 16
75 | f 36 50 19
76 | f 33 50 10
77 | f 21 23 46
78 | f 10 21 46
79 | f 23 27 46
80 | f 22 28 29
81 | f 24 34 28
82 | f 30 25 47
83 | f 31 2 32
84 | f 32 5 31
85 | f 33 34 35
86 | f 35 1 33
87 | f 2 36 19
88 | f 19 32 2
89 | f 37 3 4
90 | f 3 38 39
91 | f 4 40 37
92 | f 31 41 6
93 | f 43 8 7
94 | f 7 8 42
95 | f 38 3 2
96 | f 3 37 44
97 | f 2 16 38
98 | f 7 42 45
99 | f 45 14 7
100 | f 46 27 29
101 | f 47 48 11
102 | f 37 40 12
103 | f 12 44 37
104 | f 43 7 13
105 | f 42 8 49
106 | f 49 45 42
107 | f 39 38 16
108 | f 16 17 39
109 | f 2 31 16
110 | f 9 14 5
111 | f 5 32 9
112 | f 34 33 29
113 | f 29 33 10
114 | f 30 11 1
115 | f 1 35 30
116 | f 36 2 12
117 | f 12 2 44
118 | f 13 9 32
119 | f 32 19 13
120 | f 45 49 14
121 | f 14 15 41
122 | f 41 5 14
123 | f 31 6 16
124 | f 43 13 26
125 | f 26 18 43
126 | f 13 19 20
127 | f 20 26 13
128 | f 50 20 19
129 | f 36 12 21
130 | f 21 50 36
131 | f 12 40 23
132 | f 23 21 12
133 | f 4 39 22
134 | f 22 23 4
135 | f 4 23 40
136 | f 39 17 28
137 | f 28 22 39
138 | f 17 6 24
139 | f 24 28 17
140 | f 6 41 51
141 | f 51 24 6
142 | f 41 15 25
143 | f 15 49 25
144 | f 25 51 41
145 | f 49 8 52
146 | f 52 25 49
147 | f 8 43 18
148 | f 18 52 8
149 | f 18 26 11
150 | f 11 48 18
151 | f 26 20 1
152 | f 1 11 26
153 | f 20 50 33
154 | f 33 1 20
155 | f 50 21 10
156 | f 23 22 27
157 | f 29 27 22
158 | f 34 29 28
159 | f 24 51 35
160 | f 35 34 24
161 | f 51 25 30
162 | f 30 35 51
163 | f 25 52 47
164 | f 52 18 48
165 | f 48 47 52
166 | # 100 faces, 0 coords texture
167 |
168 | # End of File
169 |
--------------------------------------------------------------------------------
/assets/ycb/010_potted_meat_can/textured.mtl:
--------------------------------------------------------------------------------
1 | #
2 | # Wavefront material file
3 | # Converted by Meshlab Group
4 | #
5 |
6 | newmtl material_0
7 | Ka 0.200000 0.200000 0.200000
8 | Kd 0.752941 0.752941 0.752941
9 | Ks 1.000000 1.000000 1.000000
10 | Tr 1.000000
11 | illum 2
12 | Ns 0.000000
13 | map_Kd MI_010_potted_meat_can_MI_010_potted_meat_can_D.png
14 |
15 |
--------------------------------------------------------------------------------
/assets/ycb/011_banana/011_banana.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/assets/ycb/011_banana/MI_011_banana_MI_011_banana_D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/ycb/011_banana/MI_011_banana_MI_011_banana_D.png
--------------------------------------------------------------------------------
/assets/ycb/011_banana/collision.obj:
--------------------------------------------------------------------------------
1 | v -3.489367029208955 -4.593850113870038 0.3420128040217412
2 | v -3.152295304664408 -4.412521288191765 -0.9511216728314373
3 | v -2.930735753491543 -2.358024103521148 1.463391939656041
4 | v -3.301086277784086 -6.348885715938714 0.03144217051068825
5 | v -2.65092139371712 -0.2274231738395613 -0.8932839226493062
6 | v -3.120781651279799 -0.2671562914528565 0.2716868555166476
7 | v -2.792592776528049 -5.746611713031514 1.269196793626972
8 | v -2.308388823570644 -8.250574734892092 -1.030894491510098
9 | v -2.981603634027741 -7.469739922325796 0.220711954402371
10 | v -2.428559817803952 1.168365004146324 1.11008084890814
11 | v -2.331710679216893 -2.415119739831399 -1.612432894672396
12 | v -2.280098008557887 -6.184012173770437 -1.601939491678627
13 | v -2.012109037620591 2.882646128324722 -0.1201206557019736
14 | v -2.42125353207483 -8.741243965093396 0.06389984498673433
15 | v -2.123787214554586 -7.451918836905298 1.134016038224267
16 | v -1.555793701625957 0.9658247753681873 1.844913827842845
17 | v -1.221873332533526 -6.385637891508133 1.45862511675044
18 | v -1.446989962083973 -9.166949231486775 0.6926633951821226
19 | v -1.883922299951809 -9.768899417743269 -0.2256488871469705
20 | v -1.482593836056729 1.445851499885872 -1.535318796124564
21 | v -1.779319581085273 2.747988651742468 1.186087247464259
22 | v -0.6767514819538838 -0.6493890488298608 -1.422117927826119
23 | v -1.526192636752273 -9.819584608966164 -0.9168324245973867
24 | v -1.297775560484142 -8.250483211522297 -1.429005004556215
25 | v -1.697892774268219 -0.6686520057820937 1.866563606365114
26 | v -1.229382279953893 -9.254922113785822 -1.270144812188846
27 | v -1.287467205757585 -10.10620913670089 0.02340693312965218
28 | v -0.6704627031381099 2.90826740398763 1.87055204768071
29 | v -0.8351568046647661 4.207054096741336 -0.842747650094829
30 | v -0.6519195250102231 -8.495512362555679 0.7851799740152977
31 | v -0.8996678640831628 -2.023713212756475 1.856384866223058
32 | v -0.5592800022711543 -4.542568096178713 -1.290015408415691
33 | v -0.3486114137494164 -7.74144123949899 -1.173843312363649
34 | v -0.3766764942776951 3.238088165283302 -1.606947487784044
35 | v -0.4916505386417588 -9.553520748641587 0.2639273727496541
36 | v -0.4636821093208424 -9.733639173624601 -0.7888582492231716
37 | v -0.8568141342208871 4.501251220393574 1.125963335532417
38 | v -0.2532113957971593 4.340705162219273 1.746130406975266
39 | v -0.5852895641433687 5.301635930091654 0.09494525121654293
40 | v -0.2830156023165637 -6.334586055654619 0.8628748936064286
41 | v 0.8832153345897487 2.526086883259895 1.853754818471917
42 | v -0.0255194970127445 -2.527030138728217 -0.8231780974063029
43 | v -0.008452658072773633 -3.397581923355219 0.8058410515729217
44 | v 0.1826522449140578 5.655456807132585 1.294061882742412
45 | v 0.5916278279859637 -0.04000411097912969 1.051638324519468
46 | v -0.05183122136023561 -8.681454461395827 -0.1932091966798416
47 | v 0.4414784728497138 0.4204735513441117 -1.02148543392443
48 | v -0.0001128609314984021 -4.984582285841284 -0.2754422460621979
49 | v 0.05556010779148 -7.481215756956907 0.08040475240218684
50 | v 0.7309754235759448 5.094325191450975 -1.564052033815161
51 | v 0.4000440400703863 -1.453102050761113 0.1165185187974944
52 | v 2.068226618715761 3.295661549576909 -0.9773484937751774
53 | v 1.019166445383634 4.834765032309708 1.840531449425921
54 | v 1.043424871738817 6.691383180416143 0.7074340285925678
55 | v 1.419471414448946 6.754570555274254 -0.6548016116661362
56 | v 1.874363161750689 6.570501604917832 1.45300036405429
57 | v 1.395929358307362 1.783970193958261 -0.3598165817603945
58 | v 2.127225434729935 5.920297689446097 -1.645221012238493
59 | v 2.477999099481542 4.843786288580742 -1.49727723631656
60 | v 2.970434354616536 5.191783915951691 1.440149511510284
61 | v 2.145706637447254 7.32137319077265 0.5431109598961743
62 | v 2.981222745603898 6.966645709568452 -1.34128568611619
63 | v 3.058348437752001 7.49113274920547 0.7301321650565075
64 | v 3.033316800595916 7.633842558443553 -0.366095841422386
65 | v 3.475338109592501 7.009639783620956 1.019432009450642
66 | v 3.912014439763264 6.246697826118969 -1.568921232879077
67 | v 5.048286388152991 7.192335302251899 -1.275179105051252
68 | v 5.516434632342991 6.375606598007291 -1.194150885393676
69 | v 4.38608993537356 7.531207644923075 -0.1267252912263195
70 | v 4.524273261080494 6.386175148017489 0.5761001732460752
71 | v 5.684386061398492 6.898122720730221 -0.2708389318761191
72 | v 5.915902686613972 7.510264082643521 -0.8260858705643269
73 | v 6.55325767131314 6.625659946093209 -0.9326133706066136
74 | v 6.240622821407078 7.288171591260042 -1.486623259920882
75 | v 6.634468505902167 7.540059149410554 -0.7564415021894342
76 | v 7.277187600548435 7.049432174645867 -0.7290782822355779
77 | v 6.998516423944108 6.795219286082913 -1.617778678737311
78 | v 7.119897791620566 7.627788356832947 -1.239171652615567
79 | v -3.51519744784604 -2.813283617999035 0.4927337682483915
80 | v -3.06419033608775 -3.849449459720798 1.068161226716387
81 | v -3.048638837713754 -2.804142991483945 -0.762426342195158
82 | v -2.728709513265615 -0.3541111123413271 1.307529080331945
83 | v -1.917845381425392 -0.6058396729826944 -1.589785777724171
84 | v -3.136233689841363 -1.345534231502379 -0.5072025725222099
85 | v -2.546908645075696 1.377082881463468 0.1378868344862134
86 | v -1.262173725307992 -1.746342775257057 -1.54101006907852
87 | v -2.471716275459477 -3.849449459720798 1.519375606313602
88 | v -0.7000462546983213 0.6070891799941202 1.957324687619226
89 | v -0.5771210249300278 -0.5454277800763481 1.897876707978669
90 | v -1.13715583130532 -3.292653418866262 -1.510669167475597
91 | v 0.8379939479747478 3.836849726633872 -1.596309264032869
92 | v -1.295213163186697 4.331133918810485 0.1684196658603138
93 | v -0.04815739397656013 1.404684693880597 1.948661592081537
94 | v 1.822345887805648 2.42238934970032 1.094075125252217
95 | v 0.9747573163641546 0.780152413050049 -0.2477474357586281
96 | v -0.07383715118902683 0.129203514374909 1.7936296433682
97 | v 0.6807549459487288 1.148573387057477 1.5173289387041
98 | v 0.7772193668490905 2.021522532801039 -1.184992152379913
99 | v 2.03425056241601 4.342448598851274 1.725294478875091
100 | v 3.330373695488631 4.415587283741631 -1.1001221545586
101 | v 3.56054977345927 4.567931591818496 -0.04966904917860825
102 | v 3.746865821975 7.508044705379916 -0.9012272622174671
103 | v 4.905619937115169 5.831101671025632 -1.085055958538678
104 | v 4.668838783539016 5.505078743194852 -0.1276179453160713
105 | v -0.394139302287781 -6.569040694590623 -1.39365586414711
106 | v 2.400735135589523 3.489838191296277 0.9378956377014083
107 | v -2.842289098933501 -6.320660462295205 -0.8670593012882273
108 | v -2.066138756265468 -4.357137141566154 -1.676138646024585
109 | v -0.4310812534343215 -8.831774842830303 -1.071367527744056
110 | v 0.7314607683769286 -0.06177679651188117 -0.03230704826393704
111 | v 1.088451024785488 0.8266662082505071 0.5091330141526716
112 | v 0.1758795806715053 -1.015358488713293 -0.8914733591616455
113 | v -0.2090230734473254 -1.121120606981673 1.466916320695416
114 | v 4.128557589228302 7.168075319393639 -1.310090146253162
115 | v 0.04668145515257002 1.597029583472543 -1.459164659316576
116 | v 2.152203593194595 2.791894269963893 0.1479914946726678
117 | v -1.416332287254806 -5.358620165172388 1.593447733087888
118 | v -0.03356653493156896 -4.878495380627528 0.5845675279579349
119 | v -0.3349534879055608 0.8676760578189653 -1.648790308536602
120 | f 81 79 84
121 | f 11 81 84
122 | f 19 18 14
123 | f 2 4 1
124 | f 29 34 20
125 | f 4 7 1
126 | f 12 107 2
127 | f 88 25 89
128 | f 98 47 115
129 | f 4 9 7
130 | f 14 9 8
131 | f 9 4 8
132 | f 26 23 8
133 | f 23 19 8
134 | f 19 14 8
135 | f 14 15 9
136 | f 107 4 2
137 | f 26 8 24
138 | f 30 17 15
139 | f 19 27 18
140 | f 27 35 18
141 | f 35 46 30
142 | f 35 30 18
143 | f 26 36 23
144 | f 27 23 36
145 | f 23 27 19
146 | f 35 27 36
147 | f 36 46 35
148 | f 41 38 28
149 | f 46 49 30
150 | f 49 46 33
151 | f 38 44 37
152 | f 44 39 37
153 | f 92 39 29
154 | f 53 44 38
155 | f 41 53 38
156 | f 39 50 29
157 | f 54 39 44
158 | f 113 51 45
159 | f 57 47 98
160 | f 58 59 50
161 | f 55 58 50
162 | f 39 55 50
163 | f 55 39 54
164 | f 56 61 54
165 | f 62 58 55
166 | f 61 64 55
167 | f 64 62 55
168 | f 63 61 56
169 | f 60 65 56
170 | f 65 63 56
171 | f 41 97 94
172 | f 63 64 61
173 | f 69 64 63
174 | f 65 69 63
175 | f 70 69 65
176 | f 67 68 66
177 | f 66 62 114
178 | f 74 68 67
179 | f 72 74 67
180 | f 71 72 69
181 | f 69 72 67
182 | f 71 104 68
183 | f 73 71 68
184 | f 70 71 69
185 | f 104 71 70
186 | f 75 72 71
187 | f 75 74 72
188 | f 75 78 74
189 | f 77 74 78
190 | f 76 78 75
191 | f 77 78 76
192 | f 77 76 73
193 | f 2 81 11
194 | f 79 2 1
195 | f 7 80 1
196 | f 31 25 3
197 | f 83 11 5
198 | f 17 117 7
199 | f 13 85 10
200 | f 82 16 10
201 | f 16 21 10
202 | f 86 90 11
203 | f 14 18 15
204 | f 30 40 17
205 | f 48 105 32
206 | f 32 105 12
207 | f 108 32 12
208 | f 20 34 115
209 | f 42 86 22
210 | f 12 33 24
211 | f 91 34 50
212 | f 50 34 29
213 | f 43 113 31
214 | f 42 48 32
215 | f 43 48 42
216 | f 117 118 43
217 | f 51 110 45
218 | f 59 91 50
219 | f 116 57 52
220 | f 99 60 53
221 | f 54 61 55
222 | f 66 59 58
223 | f 64 102 62
224 | f 77 73 68
225 | f 74 77 68
226 | f 76 75 71
227 | f 73 76 71
228 | f 6 5 84
229 | f 10 6 82
230 | f 108 11 90
231 | f 28 16 88
232 | f 20 115 119
233 | f 13 29 20
234 | f 89 31 113
235 | f 31 89 25
236 | f 25 88 16
237 | f 32 108 90
238 | f 34 91 98
239 | f 88 93 28
240 | f 113 45 96
241 | f 57 95 47
242 | f 91 52 98
243 | f 60 70 65
244 | f 104 70 60
245 | f 6 3 82
246 | f 40 48 118
247 | f 117 40 118
248 | f 88 96 93
249 | f 47 119 115
250 | f 80 3 79
251 | f 2 79 81
252 | f 1 80 79
253 | f 107 12 8
254 | f 87 3 80
255 | f 107 8 4
256 | f 15 17 7
257 | f 15 7 9
258 | f 6 10 85
259 | f 2 11 108
260 | f 11 83 86
261 | f 117 43 31
262 | f 31 3 87
263 | f 15 18 30
264 | f 25 16 82
265 | f 12 2 108
266 | f 22 20 119
267 | f 13 10 21
268 | f 13 21 37
269 | f 20 22 83
270 | f 20 83 5
271 | f 12 24 8
272 | f 3 25 82
273 | f 33 12 105
274 | f 28 38 37
275 | f 37 39 92
276 | f 29 13 92
277 | f 13 37 92
278 | f 41 28 93
279 | f 97 41 93
280 | f 118 48 43
281 | f 95 110 47
282 | f 111 110 95
283 | f 110 111 45
284 | f 45 97 96
285 | f 47 51 112
286 | f 22 47 112
287 | f 51 47 110
288 | f 51 42 112
289 | f 42 22 112
290 | f 51 43 42
291 | f 43 51 113
292 | f 52 57 98
293 | f 59 100 52
294 | f 52 100 101
295 | f 59 52 91
296 | f 52 101 116
297 | f 53 41 99
298 | f 56 54 44
299 | f 53 56 44
300 | f 60 56 53
301 | f 66 58 62
302 | f 103 101 100
303 | f 59 103 100
304 | f 101 60 106
305 | f 60 99 106
306 | f 62 102 114
307 | f 64 69 102
308 | f 67 66 114
309 | f 104 101 103
310 | f 103 66 68
311 | f 104 103 68
312 | f 69 67 114
313 | f 102 69 114
314 | f 101 104 60
315 | f 6 84 79
316 | f 6 79 3
317 | f 7 117 87
318 | f 117 31 87
319 | f 6 85 5
320 | f 83 22 86
321 | f 42 32 90
322 | f 86 42 90
323 | f 96 88 89
324 | f 113 96 89
325 | f 47 22 119
326 | f 96 97 93
327 | f 34 98 115
328 | f 101 106 116
329 | f 106 99 41
330 | f 106 41 94
331 | f 84 5 11
332 | f 20 85 13
333 | f 49 40 30
334 | f 16 28 21
335 | f 21 28 37
336 | f 24 109 26
337 | f 109 46 36
338 | f 109 36 26
339 | f 24 33 109
340 | f 33 46 109
341 | f 33 105 49
342 | f 97 45 111
343 | f 94 97 111
344 | f 57 94 111
345 | f 111 95 57
346 | f 94 57 116
347 | f 106 94 116
348 | f 87 80 7
349 | f 20 5 85
350 | f 48 40 49
351 | f 48 49 105
352 | f 117 17 40
353 | f 66 103 59
354 |
--------------------------------------------------------------------------------
/assets/ycb/011_banana/textured.mtl:
--------------------------------------------------------------------------------
1 | #
2 | # Wavefront material file
3 | # Converted by Meshlab Group
4 | #
5 |
6 | newmtl material_0
7 | Ka 0.200000 0.200000 0.200000
8 | Kd 0.752941 0.752941 0.752941
9 | Ks 1.000000 1.000000 1.000000
10 | Tr 1.000000
11 | illum 2
12 | Ns 0.000000
13 | map_Kd MI_011_banana_MI_011_banana_D.png
14 |
15 |
--------------------------------------------------------------------------------
/assets/ycb/025_mug/025_mug.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/assets/ycb/025_mug/MI_025_mug_MI_025_mug_D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/ycb/025_mug/MI_025_mug_MI_025_mug_D.png
--------------------------------------------------------------------------------
/assets/ycb/025_mug/textured.mtl:
--------------------------------------------------------------------------------
1 | #
2 | # Wavefront material file
3 | # Converted by Meshlab Group
4 | #
5 |
6 | newmtl material_0
7 | Ka 0.200000 0.200000 0.200000
8 | Kd 0.752941 0.752941 0.752941
9 | Ks 1.000000 1.000000 1.000000
10 | Tr 1.000000
11 | illum 2
12 | Ns 0.000000
13 | map_Kd MI_025_mug_MI_025_mug_D.png
14 |
15 |
--------------------------------------------------------------------------------
/assets/ycb/061_foam_brick/061_foam_brick.urdf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/assets/ycb/061_foam_brick/MI_061_foam_brick_MI_061_foam_brick_D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/assets/ycb/061_foam_brick/MI_061_foam_brick_MI_061_foam_brick_D.png
--------------------------------------------------------------------------------
/assets/ycb/061_foam_brick/textured.mtl:
--------------------------------------------------------------------------------
1 | #
2 | # Wavefront material file
3 | # Converted by Meshlab Group
4 | #
5 |
6 | newmtl material_0
7 | Ka 0.200000 0.200000 0.200000
8 | Kd 0.752941 0.752941 0.752941
9 | Ks 1.000000 1.000000 1.000000
10 | Tr 1.000000
11 | illum 2
12 | Ns 0.000000
13 | map_Kd MI_061_foam_brick_MI_061_foam_brick_D.png
14 |
15 |
--------------------------------------------------------------------------------
/cfg/apply_force.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 20
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [0.7, 0, 0.2]
7 | look_at: [0, 0, 0]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | type: physx
13 | use_gpu_pipeline: True
14 | physx:
15 | solver_type: 1
16 | num_position_iterations: 8
17 | num_velocity_iterations: 1
18 | rest_offset: 0.0
19 | contact_offset: 0.001
20 | friction_offset_threshold: 0.001
21 | friction_correlation_distance: 0.0005
22 | use_gpu: True
23 | device:
24 | compute: 0
25 | graphics: 0
26 | plane:
27 | dynamic_friction: 0
28 | static_friction: 0
29 | restitution: 0
30 |
31 | block:
32 | dims:
33 | sx: 0.1
34 | sy: 0.1
35 | sz: 0.1
36 | shape_props:
37 | friction: 0
38 | rolling_friction: 0
39 | torsion_friction: 0
40 | thickness: 2e-3
41 |
--------------------------------------------------------------------------------
/cfg/franka.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 10
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | type: physx
13 | use_gpu_pipeline: True
14 | physx:
15 | solver_type: 1
16 | num_position_iterations: 8
17 | num_velocity_iterations: 1
18 | rest_offset: 0.0
19 | contact_offset: 0.001
20 | friction_offset_threshold: 0.001
21 | friction_correlation_distance: 0.0005
22 | use_gpu: True
23 | device:
24 | compute: 0
25 | graphics: 0
26 | plane:
27 | dynamic_friction: 1
28 | static_friction: 1
29 | restitution: 0
30 |
31 | franka:
32 | attractor_props:
33 | stiffness: 1e3
34 | damping: 2.5e2
35 | asset_options:
36 | fix_base_link: True
37 | flip_visual_attachments: True
38 | armature: 0.01
39 | max_linear_velocity: 100.0
40 | max_angular_velocity: 40.0
41 | disable_gravity: True
42 | attractor_props:
43 | stiffness: 1e3
44 | damping: 2e2
45 | shape_props:
46 | thickness: 1e-3
47 | dof_props:
48 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
49 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
50 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
51 |
52 | table:
53 | dims:
54 | sx: 1
55 | sy: 1
56 | sz: 0.5
57 | shape_props:
58 | friction: 0.1
59 | rolling_friction: 0
60 | torsion_friction: 0
61 | thickness: 2e-3
62 | asset_options:
63 | fix_base_link: True
64 |
--------------------------------------------------------------------------------
/cfg/franka_impedance_control.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 1
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | use_gpu_pipeline: False
13 | flex:
14 | solver_type: 5
15 | num_outer_iterations: 4
16 | num_inner_iterations: 30
17 | relaxation: 1
18 | warm_start: 0.8
19 | shape_collision_margin: 1e-3
20 | contact_regularization: 1e-7
21 | deterministic_mode: True
22 | device:
23 | compute: 0
24 | graphics: 0
25 |
26 | franka:
27 | attractor_props:
28 | stiffness: 1e3
29 | damping: 2.5e2
30 | asset_options:
31 | fix_base_link: True
32 | flip_visual_attachments: True
33 | armature: 0.01
34 | max_linear_velocity: 100.0
35 | max_angular_velocity: 40.0
36 | disable_gravity: True
37 | attractor_props:
38 | stiffness: 1e3
39 | damping: 2e2
40 | shape_props:
41 | thickness: 1e-3
42 | dof_props:
43 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
44 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
45 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
46 |
--------------------------------------------------------------------------------
/cfg/franka_pick_block.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 10
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | flex:
13 | solver_type: 5
14 | num_outer_iterations: 4
15 | num_inner_iterations: 30
16 | relaxation: 0.75
17 | warm_start: 0.8
18 | shape_collision_margin: 1e-3
19 | contact_regularization: 1e-7
20 | deterministic_mode: True
21 | device:
22 | compute: 0
23 | graphics: 0
24 |
25 | franka:
26 | asset_options:
27 | fix_base_link: True
28 | flip_visual_attachments: True
29 | armature: 0.01
30 | max_linear_velocity: 100.0
31 | max_angular_velocity: 40.0
32 | disable_gravity: True
33 | attractor_props:
34 | stiffness: 1e3
35 | damping: 2.5e2
36 | shape_props:
37 | thickness: 1e-3
38 | dof_props:
39 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
40 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
41 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
42 |
43 | table:
44 | dims:
45 | sx: 1
46 | sy: 1
47 | sz: 0.5
48 | shape_props:
49 | friction: 0.1
50 | rolling_friction: 0
51 | torsion_friction: 0
52 | thickness: 2e-3
53 | asset_options:
54 | fix_base_link: True
55 |
56 | block:
57 | dims:
58 | sx: 0.05
59 | sy: 0.05
60 | sz: 0.05
61 | shape_props:
62 | friction: 0.2
63 | rolling_friction: 0.01
64 | torsion_friction: 0.01
65 | thickness: 2e-3
66 | rb_props:
67 | flags: none # can be none, no_sim, no_gravity
68 | color: [0.2, 0.7, 0.2]
69 | asset_options:
70 | density: 1000
71 |
72 | camera:
73 | width: 320
74 | height: 240
75 |
--------------------------------------------------------------------------------
/cfg/franka_pick_block_ray.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 10
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | flex:
13 | solver_type: 5
14 | num_outer_iterations: 4
15 | num_inner_iterations: 30
16 | relaxation: 0.75
17 | warm_start: 0.8
18 | shape_collision_margin: 1e-3
19 | contact_regularization: 1e-7
20 | deterministic_mode: True
21 | device:
22 | compute: 0
23 | graphics: 0
24 |
25 | franka:
26 | asset_options:
27 | fix_base_link: True
28 | flip_visual_attachments: True
29 | armature: 0.01
30 | max_linear_velocity: 100.0
31 | max_angular_velocity: 40.0
32 | disable_gravity: True
33 | attractor_props:
34 | stiffness: 1e3
35 | damping: 2.5e2
36 | shape_props:
37 | thickness: 1e-3
38 | dof_props:
39 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
40 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
41 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
42 |
43 | table:
44 | dims:
45 | sx: 1
46 | sy: 1
47 | sz: 0.5
48 | shape_props:
49 | friction: 0.1
50 | rolling_friction: 0
51 | torsion_friction: 0
52 | thickness: 2e-3
53 | asset_options:
54 | fix_base_link: True
55 |
56 | block:
57 | dims:
58 | sx: 0.05
59 | sy: 0.05
60 | sz: 0.05
61 | shape_props:
62 | friction: 0.2
63 | rolling_friction: 0.01
64 | torsion_friction: 0.01
65 | thickness: 2e-3
66 | rb_props:
67 | flags: none # can be none, no_sim, no_gravity
68 | color: [0.2, 0.7, 0.2]
69 | asset_options:
70 | density: 1000
71 |
72 | camera:
73 | width: 320
74 | height: 240
75 |
76 | ray:
77 | num_cpus: 4
78 | num_gpus: 1
79 | num_cpus_per_fn: 1
80 | # Share a gpu with multiple workers
81 | num_gpus_per_fn: 0.25
82 |
--------------------------------------------------------------------------------
/cfg/franka_pick_soft_obj.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 1
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | flex:
13 | solver_type: 5
14 | num_outer_iterations: 4
15 | num_inner_iterations: 30
16 | relaxation: 0.75
17 | warm_start: 0.8
18 | shape_collision_margin: 1e-3
19 | contact_regularization: 1e-7
20 | deterministic_mode: True
21 | device:
22 | compute: 0
23 | graphics: 0
24 |
25 | franka:
26 | attractor_props:
27 | stiffness: 1e3
28 | damping: 2.5e2
29 | asset_options:
30 | fix_base_link: True
31 | flip_visual_attachments: True
32 | armature: 0.01
33 | max_linear_velocity: 100.0
34 | max_angular_velocity: 40.0
35 | disable_gravity: True
36 | attractor_props:
37 | stiffness: 1e3
38 | damping: 2e2
39 | shape_props:
40 | thickness: 1e-3
41 | friction: 1
42 | dof_props:
43 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
44 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
45 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
46 |
47 | table:
48 | dims:
49 | sx: 1
50 | sy: 1
51 | sz: 0.5
52 | shape_props:
53 | friction: 0.1
54 | rolling_friction: 0
55 | torsion_friction: 0
56 | thickness: 2e-3
57 | asset_options:
58 | fix_base_link: True
59 |
60 | softbody:
61 | shape_props:
62 | friction: 1
63 | rolling_friction: 0
64 | torsion_friction: 0
65 | thickness: 2e-3
66 | soft_material_props:
67 | youngs: 1e4
68 | poissons: 0.25
69 | damping: 0.0
70 | dims:
71 | dimx: 10
72 | dimy: 10
73 | dimz: 10
74 | spacingx: 0.02
75 | spacingy: 0.005
76 | spacingz: 0.005
77 | density: 100
78 | asset_options:
79 | thickness: 0.1
80 |
81 |
--------------------------------------------------------------------------------
/cfg/franka_point_cloud_fusion.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 1
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | flex:
13 | solver_type: 5
14 | num_outer_iterations: 4
15 | num_inner_iterations: 30
16 | relaxation: 0.75
17 | warm_start: 0.8
18 | shape_collision_margin: 1e-3
19 | contact_regularization: 1e-7
20 | deterministic_mode: True
21 | device:
22 | compute: 0
23 | graphics: 0
24 |
25 | franka:
26 | asset_options:
27 | fix_base_link: True
28 | flip_visual_attachments: True
29 | armature: 0.01
30 | max_linear_velocity: 100.0
31 | max_angular_velocity: 40.0
32 | disable_gravity: True
33 | attractor_props:
34 | stiffness: 1e3
35 | damping: 2.5e2
36 | shape_props:
37 | thickness: 1e-3
38 | dof_props:
39 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
40 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
41 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
42 |
43 | table:
44 | dims:
45 | sx: 1
46 | sy: 1
47 | sz: 0.5
48 | shape_props:
49 | friction: 0.1
50 | rolling_friction: 0
51 | torsion_friction: 0
52 | thickness: 2e-3
53 | asset_options:
54 | fix_base_link: True
55 |
56 | camera:
57 | width: 320
58 | height: 240
59 |
--------------------------------------------------------------------------------
/cfg/franka_rl_stable_baselines.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 20
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | flex:
13 | solver_type: 5
14 | num_outer_iterations: 4
15 | num_inner_iterations: 30
16 | relaxation: 0.75
17 | warm_start: 0.8
18 | shape_collision_margin: 1e-3
19 | contact_regularization: 1e-7
20 | deterministic_mode: True
21 | device:
22 | compute: 0
23 | graphics: 0
24 |
25 | franka:
26 | asset_options:
27 | fix_base_link: True
28 | flip_visual_attachments: True
29 | armature: 0.01
30 | max_linear_velocity: 100.0
31 | max_angular_velocity: 40.0
32 | disable_gravity: True
33 | attractor_props:
34 | stiffness: 1e3
35 | damping: 2.5e2
36 | shape_props:
37 | thickness: 1e-3
38 | dof_props:
39 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
40 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
41 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
42 | action:
43 | mode: hfpc_cartesian_gains # vic, joints, hfpc, hfpc_cartesian_gains
44 | joints:
45 | max_rot_delta: 30 # deg
46 | vic:
47 | max_tra_delta: 0.01 # m
48 | max_rot_delta: 5 # deg
49 | min_stiffness: 1e2
50 | max_stiffness: 1e4
51 | hfpc:
52 | max_tra_delta: 0.01 # m
53 | max_rot_delta: 5 # deg
54 | max_force_delta: 5 # N
55 | min_pos_kp: 1
56 | max_pos_kp: 100
57 | min_force_kp: 0.01
58 | max_force_kp: 10
59 | hfpc_cartesian_gains:
60 | max_tra_delta: 0.01 # m
61 | max_rot_delta: 5 # deg
62 | max_force_delta: 5 # N
63 | min_pos_kp: 1
64 | max_pos_kp: 100
65 | min_force_kp: 0.01
66 | max_force_kp: 10
67 |
68 | table:
69 | dims:
70 | sx: 1
71 | sy: 1
72 | sz: 0.5
73 | shape_props:
74 | friction: 0.1
75 | rolling_friction: 0
76 | torsion_friction: 0
77 | thickness: 2e-3
78 | asset_options:
79 | fix_base_link: True
80 |
81 | block:
82 | dims:
83 | sx: 0.05
84 | sy: 0.05
85 | sz: 0.05
86 | shape_props:
87 | friction: 0.2
88 | rolling_friction: 0.01
89 | torsion_friction: 0.01
90 | thickness: 2e-3
91 | rb_props:
92 | color: [0, 0.7, 0]
93 | asset_options:
94 | density: 200
95 |
96 | banana:
97 | urdf_path: ycb/011_banana/011_banana.urdf
98 | shape_props:
99 | friction: 0.2
100 | rolling_friction: 0.01
101 | torsion_friction: 0.01
102 | thickness: 2e-3
103 | rb_props:
104 | texture: ycb/011_banana/MI_011_banana_MI_011_banana_D.png
105 | asset_options:
106 | density: 500
107 |
108 | rl:
109 | total_timesteps: 1000000
110 | ppo:
111 | n_steps: 128
112 | gamma: 0.99
113 | n_steps: 128
114 | ent_coef: 0.01
115 | learning_rate: 2.5e-4
116 | vf_coef: 0.5
117 | max_grad_norm: 0.5
118 | gae_lambda: 0.95
119 | batch_size: 32
120 | n_epochs: 10
121 | clip_range: 0.2
122 |
--------------------------------------------------------------------------------
/cfg/franka_rl_vec_env.yaml:
--------------------------------------------------------------------------------
1 | scene:
2 | n_envs: 20
3 | es: 1
4 | gui: 1
5 | cam:
6 | cam_pos: [1.2, 0, 1.2]
7 | look_at: [0.5, 0, 1]
8 | gym:
9 | dt: 0.01
10 | substeps: 2
11 | up_axis: z
12 | flex:
13 | solver_type: 5
14 | num_outer_iterations: 4
15 | num_inner_iterations: 30
16 | relaxation: 0.75
17 | warm_start: 0.8
18 | shape_collision_margin: 1e-3
19 | contact_regularization: 1e-7
20 | deterministic_mode: True
21 | device:
22 | compute: 0
23 | graphics: 0
24 |
25 | franka:
26 | asset_options:
27 | fix_base_link: True
28 | flip_visual_attachments: True
29 | armature: 0.01
30 | max_linear_velocity: 100.0
31 | max_angular_velocity: 40.0
32 | disable_gravity: True
33 | attractor_props:
34 | stiffness: 1e3
35 | damping: 2.5e2
36 | shape_props:
37 | thickness: 1e-3
38 | dof_props:
39 | stiffness: [2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 2e3, 1e2, 1e2]
40 | damping: [2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 2e2, 5, 5]
41 | effort: [87, 87, 87, 87, 12, 12, 12, 100, 100]
42 | action:
43 | mode: hfpc_cartesian_gains # vic, joints, hfpc, hfpc_cartesian_gains
44 | joints:
45 | max_rot_delta: 30 # deg
46 | vic:
47 | max_tra_delta: 0.01 # m
48 | max_rot_delta: 5 # deg
49 | min_stiffness: 1e2
50 | max_stiffness: 1e4
51 | hfpc:
52 | max_tra_delta: 0.01 # m
53 | max_rot_delta: 5 # deg
54 | max_force_delta: 5 # N
55 | min_pos_kp: 1
56 | max_pos_kp: 100
57 | min_force_kp: 0.01
58 | max_force_kp: 10
59 | hfpc_cartesian_gains:
60 | max_tra_delta: 0.01 # m
61 | max_rot_delta: 5 # deg
62 | max_force_delta: 5 # N
63 | min_pos_kp: 1
64 | max_pos_kp: 100
65 | min_force_kp: 0.01
66 | max_force_kp: 10
67 |
68 | table:
69 | dims:
70 | sx: 1
71 | sy: 1
72 | sz: 0.5
73 | shape_props:
74 | friction: 0.1
75 | rolling_friction: 0
76 | torsion_friction: 0
77 | thickness: 2e-3
78 | asset_options:
79 | fix_base_link: True
80 |
81 | block:
82 | dims:
83 | sx: 0.05
84 | sy: 0.05
85 | sz: 0.05
86 | shape_props:
87 | friction: 0.2
88 | rolling_friction: 0.01
89 | torsion_friction: 0.01
90 | thickness: 2e-3
91 | rb_props:
92 | color: [0, 0.7, 0]
93 | asset_options:
94 | density: 200
95 |
96 | banana:
97 | urdf_path: ycb/011_banana/011_banana.urdf
98 | shape_props:
99 | friction: 0.2
100 | rolling_friction: 0.01
101 | torsion_friction: 0.01
102 | thickness: 2e-3
103 | rb_props:
104 | texture: ycb/011_banana/MI_011_banana_MI_011_banana_D.png
105 | asset_options:
106 | density: 500
107 |
--------------------------------------------------------------------------------
/examples/apply_force.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | import numpy as np
4 | from autolab_core import YamlConfig
5 |
6 | from isaacgym import gymapi
7 | from isaacgym_utils.scene import GymScene
8 | from isaacgym_utils.assets import GymBoxAsset
9 | from isaacgym_utils.draw import draw_transforms, draw_contacts
10 | from isaacgym_utils.math_utils import np_to_vec3
11 |
12 |
13 | if __name__ == "__main__":
14 | parser = argparse.ArgumentParser()
15 | parser.add_argument('--cfg', '-c', type=str, default='cfg/apply_force.yaml')
16 | args = parser.parse_args()
17 | cfg = YamlConfig(args.cfg)
18 |
19 | scene = GymScene(cfg['scene'])
20 | block = GymBoxAsset(scene, **cfg['block']['dims'], shape_props=cfg['block']['shape_props'])
21 | block_name = 'block'
22 |
23 | def setup(scene, _):
24 | scene.add_asset(block_name, block, gymapi.Transform(p=gymapi.Vec3(0, 0, cfg['block']['dims']['sz']/2)))
25 | scene.setup_all_envs(setup)
26 |
27 | def custom_draws(scene):
28 | for env_idx in scene.env_idxs:
29 | block_transform = block.get_rb_transforms(env_idx, block_name)[0]
30 | draw_transforms(scene, [env_idx], [block_transform], length=0.1)
31 | draw_contacts(scene, scene.env_idxs)
32 |
33 | def policy(scene, env_idx, t_step, t_sim):
34 | force = np_to_vec3([-np.sin(t_sim), 0, 0])
35 |
36 | block_transform = block.get_rb_transforms(env_idx, block_name)[0]
37 | loc = block_transform.p
38 |
39 | block.apply_force(env_idx, block_name, 'box', force, loc)
40 |
41 | scene.run(policy=policy, custom_draws=custom_draws)
42 |
--------------------------------------------------------------------------------
/examples/franka.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | from autolab_core import YamlConfig
4 |
5 | from isaacgym import gymapi
6 | from isaacgym_utils.scene import GymScene
7 | from isaacgym_utils.assets import GymFranka, GymBoxAsset
8 | from isaacgym_utils.policy import RandomDeltaJointPolicy
9 | from isaacgym_utils.draw import draw_transforms
10 |
11 |
12 | if __name__ == "__main__":
13 | parser = argparse.ArgumentParser()
14 | parser.add_argument('--cfg', '-c', type=str, default='cfg/franka.yaml')
15 | args = parser.parse_args()
16 | cfg = YamlConfig(args.cfg)
17 |
18 | scene = GymScene(cfg['scene'])
19 |
20 | table = GymBoxAsset(scene, **cfg['table']['dims'],
21 | shape_props=cfg['table']['shape_props'],
22 | asset_options=cfg['table']['asset_options']
23 | )
24 | franka = GymFranka(cfg['franka'], scene)
25 |
26 | table_transform = gymapi.Transform(p=gymapi.Vec3(cfg['table']['dims']['sx']/3, 0, cfg['table']['dims']['sz']/2))
27 | franka_transform = gymapi.Transform(p=gymapi.Vec3(0, 0, cfg['table']['dims']['sz'] + 0.01))
28 |
29 | def setup(scene, _):
30 | scene.add_asset('table', table, table_transform)
31 | scene.add_asset('franka', franka, franka_transform, collision_filter=1) # avoid self-collision
32 | scene.setup_all_envs(setup)
33 |
34 | def custom_draws(scene):
35 | for env_idx in scene.env_idxs:
36 | transforms = [
37 | franka.get_base_transform(env_idx, 'franka'),
38 | franka.get_ee_transform(env_idx, 'franka'),
39 | ]
40 | transforms.extend(franka.get_finger_transforms(env_idx, 'franka'))
41 | transforms.extend(franka.get_links_transforms(env_idx, 'franka'))
42 | draw_transforms(scene, [env_idx], transforms, length=0.1)
43 |
44 | policy = RandomDeltaJointPolicy(franka, 'franka')
45 | scene.run(policy=policy, custom_draws=custom_draws)
46 |
--------------------------------------------------------------------------------
/examples/franka_impedance_control.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | from autolab_core import YamlConfig
4 |
5 | from isaacgym import gymapi
6 | from isaacgym_utils.scene import GymScene
7 | from isaacgym_utils.assets import GymFranka
8 | from isaacgym_utils.policy import EEImpedanceWaypointPolicy
9 | from isaacgym_utils.draw import draw_transforms
10 |
11 |
12 | if __name__ == "__main__":
13 | parser = argparse.ArgumentParser()
14 | parser.add_argument('--cfg', '-c', type=str, default='cfg/franka_impedance_control.yaml')
15 | args = parser.parse_args()
16 | cfg = YamlConfig(args.cfg)
17 |
18 | scene = GymScene(cfg['scene'])
19 | franka = GymFranka(cfg['franka'], scene, actuation_mode='torques')
20 | franka_transform = gymapi.Transform(p=gymapi.Vec3(0, 0, 0.01))
21 | franka_name = 'franka'
22 |
23 | def setup(scene, _):
24 | scene.add_asset(franka_name, franka, franka_transform, collision_filter=1) # avoid self-collision
25 | scene.setup_all_envs(setup)
26 |
27 | def custom_draws(scene):
28 | for env_idx in scene.env_idxs:
29 | transforms = [franka_transform, franka.get_ee_transform(env_idx, franka_name),
30 | franka.get_links_transforms(env_idx, franka_name)[3]]
31 | draw_transforms(scene, [env_idx], transforms, length=0.2)
32 |
33 | init_ee_transform = franka.get_ee_transform(0, franka_name)
34 | goal_ee_transform = gymapi.Transform(
35 | p=init_ee_transform.p + gymapi.Vec3(0.2, 0.2, -0.4),
36 | r=init_ee_transform.r
37 | )
38 | policy = EEImpedanceWaypointPolicy(franka, franka_name, init_ee_transform, goal_ee_transform)
39 |
40 | scene.run(policy=policy, custom_draws=custom_draws)
41 |
--------------------------------------------------------------------------------
/examples/franka_pick_block.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | import numpy as np
4 | from autolab_core import YamlConfig, RigidTransform
5 |
6 | from isaacgym import gymapi
7 | from isaacgym_utils.scene import GymScene
8 | from isaacgym_utils.assets import GymFranka, GymBoxAsset
9 | from isaacgym_utils.camera import GymCamera
10 | from isaacgym_utils.math_utils import RigidTransform_to_transform
11 | from isaacgym_utils.policy import GraspBlockPolicy
12 | from isaacgym_utils.draw import draw_transforms, draw_contacts, draw_camera
13 |
14 |
15 | if __name__ == "__main__":
16 | parser = argparse.ArgumentParser()
17 | parser.add_argument('--cfg', '-c', type=str, default='cfg/franka_pick_block.yaml')
18 | args = parser.parse_args()
19 | cfg = YamlConfig(args.cfg)
20 |
21 | scene = GymScene(cfg['scene'])
22 |
23 | table = GymBoxAsset(scene, **cfg['table']['dims'],
24 | shape_props=cfg['table']['shape_props'],
25 | asset_options=cfg['table']['asset_options']
26 | )
27 | franka = GymFranka(cfg['franka'], scene, actuation_mode='torques')
28 | block = GymBoxAsset(scene, **cfg['block']['dims'],
29 | shape_props=cfg['block']['shape_props'],
30 | rb_props=cfg['block']['rb_props'],
31 | asset_options=cfg['block']['asset_options']
32 | )
33 |
34 | table_transform = gymapi.Transform(p=gymapi.Vec3(cfg['table']['dims']['sx']/3, 0, cfg['table']['dims']['sz']/2))
35 | franka_transform = gymapi.Transform(p=gymapi.Vec3(0, 0, cfg['table']['dims']['sz'] + 0.01))
36 |
37 | table_name, franka_name, block_name = 'table', 'franka', 'block'
38 |
39 | cam = GymCamera(scene, cam_props=cfg['camera'])
40 | cam_offset_transform = RigidTransform_to_transform(RigidTransform(
41 | rotation=RigidTransform.z_axis_rotation(np.deg2rad(90)) @ RigidTransform.x_axis_rotation(np.deg2rad(1)),
42 | translation=np.array([-0.083270, -0.046490, 0])
43 | ))
44 | cam_name = 'hand_cam0'
45 |
46 | def setup(scene, _):
47 | scene.add_asset(table_name, table, table_transform)
48 | scene.add_asset(franka_name, franka, franka_transform, collision_filter=1) # avoid self-collisions
49 | scene.add_asset(block_name, block, gymapi.Transform()) # we'll sample block poses later
50 | scene.attach_camera(cam_name, cam, franka_name, 'panda_hand', offset_transform=cam_offset_transform)
51 | scene.setup_all_envs(setup)
52 |
53 | def custom_draws(scene):
54 | for env_idx in scene.env_idxs:
55 | ee_transform = franka.get_ee_transform(env_idx, franka_name)
56 | # desired_ee_transform = franka.get_desired_ee_transform(env_idx, franka_name)
57 | transforms = [ee_transform]
58 | draw_transforms(scene, [env_idx], transforms)
59 | cam_transform = cam.get_transform(env_idx, cam_name)
60 | draw_camera(scene, [env_idx], cam_transform, length=0.04)
61 | draw_contacts(scene, scene.env_idxs)
62 |
63 | policy = GraspBlockPolicy(franka, franka_name, block, block_name)
64 |
65 | while True:
66 | # sample block poses
67 | block_transforms = [gymapi.Transform(p=gymapi.Vec3(
68 | (np.random.rand()*2 - 1) * 0.1 + 0.5,
69 | (np.random.rand()*2 - 1) * 0.2,
70 | cfg['table']['dims']['sz'] + cfg['block']['dims']['sz'] / 2 + 0.1
71 | )) for _ in range(scene.n_envs)]
72 |
73 | # set block poses
74 | for env_idx in scene.env_idxs:
75 | block.set_rb_transforms(env_idx, block_name, [block_transforms[env_idx]])
76 |
77 | policy.reset()
78 | scene.run(time_horizon=policy.time_horizon, policy=policy, custom_draws=custom_draws)
79 |
--------------------------------------------------------------------------------
/examples/franka_pick_block_ray.py:
--------------------------------------------------------------------------------
1 | import logging
2 | import argparse
3 | from time import sleep
4 |
5 | import numpy as np
6 | import ray
7 | from autolab_core import RigidTransform, YamlConfig
8 |
9 | from isaacgym import gymapi
10 | from isaacgym_utils.assets import GymBoxAsset, GymFranka
11 | from isaacgym_utils.draw import draw_transforms
12 | from isaacgym_utils.policy import GraspBlockPolicy
13 | from isaacgym_utils.scene import GymScene
14 |
15 |
16 | def construct_gym_scene():
17 | scene = GymScene(cfg['scene'])
18 |
19 | table = GymBoxAsset(
20 | scene.gym,
21 | scene.sim,
22 | **cfg['table']['dims'],
23 | shape_props=cfg['table']['shape_props'],
24 | asset_options=cfg['table']['asset_options']
25 | )
26 | franka = GymFranka(cfg['franka'], scene, actuation_mode='attractors')
27 | block = GymBoxAsset(
28 | scene.gym,
29 | scene.sim,
30 | **cfg['block']['dims'],
31 | shape_props=cfg['block']['shape_props'],
32 | rb_props=cfg['block']['rb_props'],
33 | asset_options=cfg['block']['asset_options']
34 | )
35 |
36 | table_transform = gymapi.Transform(p=gymapi.Vec3(cfg['table']['dims']['sx']/3, 0, cfg['table']['dims']['sz']/2))
37 | franka_transform = gymapi.Transform(p=gymapi.Vec3(0, 0, cfg['table']['dims']['sz'] + 0.01))
38 |
39 | def setup(scene, _):
40 | scene.add_asset('table', table, table_transform)
41 | scene.add_asset('franka', franka, franka_transform, collision_filter=1)
42 | scene.add_asset('block', block, gymapi.Transform())
43 | scene.setup_all_envs(setup)
44 |
45 | return scene, table, franka, block
46 |
47 |
48 | def run_grasp_block_policy(block_poses):
49 | scene, table, franka, block = construct_gym_scene()
50 |
51 | def custom_draws(scene):
52 | for env_idx in scene.env_idxs:
53 | ee_transform = franka.get_ee_transform(env_idx , 'franka')
54 | desired_ee_transform = franka.get_desired_ee_transform(env_idx, 'franka')
55 |
56 | transforms = [ee_transform, desired_ee_transform]
57 |
58 | draw_transforms(scene, [env_idx], transforms)
59 |
60 | policy = GraspBlockPolicy(franka, 'franka', block, 'block')
61 |
62 | # set block poses
63 | for env_idx in scene.env_idxs:
64 | block.set_rb_rigid_transforms(env_idx, 'block', [block_poses[env_idx]])
65 |
66 | policy.reset()
67 | scene.run(time_horizon=policy.time_horizon, policy=policy, custom_draws=custom_draws)
68 |
69 |
70 | if __name__ == '__main__':
71 | logging.getLogger().setLevel(logging.INFO)
72 | parser = argparse.ArgumentParser()
73 | parser.add_argument(
74 | '--cfg', '-c', type=str, default='cfg/franka_pick_block_ray.yaml'
75 | )
76 | args = parser.parse_args()
77 | cfg = YamlConfig(args.cfg)
78 |
79 | # Specify the maximum number of cpus and gpus available to ray.
80 | ray.init(num_cpus=cfg['ray']['num_cpus'], num_gpus=cfg['ray']['num_gpus'])
81 |
82 | # Wait a little for workers to start.
83 | sleep(2)
84 |
85 | '''
86 | ray.remote is a decorator.
87 | Use it with every function you want to parallelize.
88 | Specify here the resources available to each function call.
89 | '''
90 | fn_decorator = ray.remote(
91 | num_cpus=cfg['ray']['num_cpus_per_fn'],
92 | num_gpus=cfg['ray']['num_gpus_per_fn'],
93 | max_calls=1,
94 | )
95 |
96 | results = []
97 | logging.info('Starting parallel execution of 4 scenes.')
98 | for i in range(cfg['ray']['num_cpus']):
99 | # sample block poses
100 | block_poses = [
101 | RigidTransform(
102 | translation=[
103 | (np.random.rand() * 2 - 1) * 0.1 + 0.5,
104 | (np.random.rand() * 2 - 1) * 0.2,
105 | cfg['table']['dims']['sz']+ cfg['block']['dims']['sz'] / 2 + 0.1,
106 | ]
107 | )
108 | for _ in range(cfg['scene']['n_envs'])
109 | ]
110 |
111 | '''
112 | Call the decorated function with the remote method.
113 | This immediately returns an ObjectID and executes the task in the background.
114 | '''
115 | results.append(fn_decorator(run_grasp_block_policy).remote(block_poses))
116 |
117 | # Get the result of all tasks.
118 | ray.get(results)
119 |
120 | logging.info('Parallel execution of scenes finished.')
121 |
--------------------------------------------------------------------------------
/examples/franka_pick_soft_obj.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | from autolab_core import YamlConfig
4 |
5 | from isaacgym import gymapi
6 | from isaacgym_utils.scene import GymScene
7 | from isaacgym_utils.assets import GymFranka, GymBoxAsset, GymTetGridAsset
8 | from isaacgym_utils.policy import GraspPointPolicy
9 | from isaacgym_utils.draw import draw_transforms
10 |
11 |
12 | if __name__ == "__main__":
13 | parser = argparse.ArgumentParser()
14 | parser.add_argument('--cfg', '-c', type=str, default='cfg/franka_pick_soft_obj.yaml')
15 | args = parser.parse_args()
16 | cfg = YamlConfig(args.cfg)
17 |
18 | scene = GymScene(cfg['scene'])
19 |
20 | table = GymBoxAsset(scene, **cfg['table']['dims'],
21 | shape_props=cfg['table']['shape_props'],
22 | asset_options=cfg['table']['asset_options']
23 | )
24 | franka = GymFranka(cfg['franka'], scene, actuation_mode='attractors')
25 | softgrid = GymTetGridAsset(scene, **cfg['softbody']['dims'],
26 | soft_material_props=cfg['softbody']['soft_material_props'],
27 | asset_options=cfg['softbody']['asset_options'],
28 | shape_props=cfg['softbody']['shape_props']
29 | )
30 |
31 | table_transform = gymapi.Transform(p=gymapi.Vec3(cfg['table']['dims']['sx']/3, 0, cfg['table']['dims']['sz']/2))
32 | franka_transform = gymapi.Transform(p=gymapi.Vec3(0, 0, cfg['table']['dims']['sz'] + 0.01))
33 | softgrid_pose = gymapi.Transform(p=gymapi.Vec3(0.3, -0.025, 0.52))
34 |
35 | def custom_draws(scene):
36 | for env_idx in scene.env_idxs:
37 | ee_transform = franka.get_ee_transform(env_idx, 'franka')
38 | desired_ee_transform = franka.get_desired_ee_transform(env_idx, 'franka')
39 |
40 | draw_transforms(scene, [env_idx], [ee_transform, desired_ee_transform])
41 |
42 | def setup(scene, _):
43 | scene.add_asset('table', table, table_transform)
44 | scene.add_asset('franka', franka, franka_transform, collision_filter=1) # avoid self-collision
45 | scene.add_asset('softgrid', softgrid, softgrid_pose)
46 | scene.setup_all_envs(setup)
47 |
48 | ee_pose = franka.get_ee_transform(0, 'franka')
49 | softgrid_grasp_pose = gymapi.Transform(p=softgrid_pose.p, r=ee_pose.r)
50 | softgrid_grasp_pose.p.y = 0
51 | softgrid_grasp_pose.p.x = 0.35
52 |
53 | policy = GraspPointPolicy(franka, 'franka', softgrid_grasp_pose)
54 | scene.run(policy=policy, custom_draws=custom_draws)
55 |
--------------------------------------------------------------------------------
/examples/franka_point_cloud_fusion.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | import numpy as np
4 | import matplotlib.pyplot as plt
5 | from matplotlib import cm
6 | from autolab_core import YamlConfig, RigidTransform, PointCloud
7 |
8 | from isaacgym import gymapi
9 | from isaacgym_utils.scene import GymScene
10 | from isaacgym_utils.camera import GymCamera
11 | from isaacgym_utils.assets import GymFranka, GymBoxAsset
12 | from isaacgym_utils.math_utils import RigidTransform_to_transform
13 |
14 | from visualization.visualizer3d import Visualizer3D as vis3d
15 |
16 |
17 | def vis_cam_images(image_list):
18 | for i in range(0, len(image_list)):
19 | plt.figure()
20 | im = image_list[i].data
21 | # for showing normal map
22 | if im.min() < 0:
23 | im = im / 2 + 0.5
24 | plt.imshow(im)
25 | plt.show()
26 |
27 |
28 | def subsample(pts, rate):
29 | n = int(rate * len(pts))
30 | idxs = np.arange(len(pts))
31 | np.random.shuffle(idxs)
32 | return pts[idxs[:n]]
33 |
34 |
35 | if __name__ == "__main__":
36 | parser = argparse.ArgumentParser()
37 | parser.add_argument('--cfg', '-c', type=str, default='cfg/franka_point_cloud_fusion.yaml')
38 | args = parser.parse_args()
39 | cfg = YamlConfig(args.cfg)
40 |
41 | # Make scene
42 | scene = GymScene(cfg['scene'])
43 |
44 | table = GymBoxAsset(scene, **cfg['table']['dims'],
45 | shape_props=cfg['table']['shape_props'],
46 | asset_options=cfg['table']['asset_options']
47 | )
48 | franka = GymFranka(cfg['franka'], scene,actuation_mode='attractors')
49 | table_transform = gymapi.Transform(p=gymapi.Vec3(cfg['table']['dims']['sx']/3, 0, cfg['table']['dims']['sz']/2))
50 | franka_transform = gymapi.Transform(p=gymapi.Vec3(0, 0, cfg['table']['dims']['sz'] + 0.01))
51 |
52 | # Add cameras
53 | cam = GymCamera(scene, cam_props=cfg['camera'])
54 | cam_names = [f'cam{i}' for i in range(3)]
55 | cam_transforms = [
56 | # front
57 | RigidTransform_to_transform(
58 | RigidTransform(
59 | translation=[1.38, 0, 1],
60 | rotation=np.array([
61 | [0, 0, -1],
62 | [1, 0, 0],
63 | [0, -1, 0]
64 | ]) @ RigidTransform.x_axis_rotation(np.deg2rad(-45))
65 | )),
66 | # left
67 | RigidTransform_to_transform(
68 | RigidTransform(
69 | translation=[0.5, -0.8, 1],
70 | rotation=np.array([
71 | [1, 0, 0],
72 | [0, 0, 1],
73 | [0, -1, 0]
74 | ]) @ RigidTransform.x_axis_rotation(np.deg2rad(-45))
75 | )),
76 | # right
77 | RigidTransform_to_transform(
78 | RigidTransform(
79 | translation=[0.5, 0.8, 1],
80 | rotation=np.array([
81 | [-1, 0, 0],
82 | [0, 0, -1],
83 | [0, -1, 0]
84 | ]) @ RigidTransform.x_axis_rotation(np.deg2rad(-45))
85 | ))
86 | ]
87 |
88 | def setup(scene, _):
89 | scene.add_asset('table', table, table_transform)
90 | scene.add_asset('franka', franka, franka_transform, collision_filter=1) # avoid self-collision
91 |
92 | scene.add_standalone_camera(cam_names[0], cam, cam_transforms[0])
93 | scene.add_standalone_camera(cam_names[1], cam, cam_transforms[1])
94 | scene.add_standalone_camera(cam_names[2], cam, cam_transforms[2])
95 | scene.setup_all_envs(setup)
96 |
97 | # Render images
98 | scene.render_cameras()
99 | color_list, depth_list, seg_list, normal_list = [], [], [], []
100 | env_idx = 0
101 | for cam_name in cam_names:
102 | # get images of cameras in first env
103 | frames = cam.frames(env_idx, cam_name)
104 | color_list.append(frames['color'])
105 | depth_list.append(frames['depth'])
106 | seg_list.append(frames['seg'])
107 | normal_list.append(frames['normal'])
108 |
109 | # Plot color and depth images
110 | vis_cam_images(color_list)
111 | vis_cam_images(depth_list)
112 | vis_cam_images(seg_list)
113 | vis_cam_images(normal_list)
114 |
115 | # Get camera intrinsics
116 | intrs = [cam.get_intrinsics(cam_name) for cam_name in cam_names]
117 |
118 | # Deproject to point clouds
119 | pcs_cam = []
120 | for i, depth in enumerate(depth_list):
121 | pc_raw = intrs[i].deproject(depth)
122 | points_filtered = pc_raw.data[:, np.logical_not(np.any(pc_raw.data > 5, axis=0))]
123 | pcs_cam.append(PointCloud(points_filtered, pc_raw.frame))
124 |
125 | # Get camera poses
126 | camera_poses = [
127 | cam.get_extrinsics(env_idx, cam_name)
128 | for cam_name in cam_names
129 | ]
130 |
131 | # Transform point clouds from camera frame into world frame
132 | pcs_world = [camera_poses[i] * pc for i, pc in enumerate(pcs_cam)]
133 |
134 | # Visualize origin pose, camera poses, and point clouds in world frame
135 | vis3d.figure()
136 | vis3d.pose(RigidTransform())
137 | for camera_pose in camera_poses:
138 | vis3d.pose(camera_pose)
139 | for i, pc in enumerate(pcs_world):
140 | vis3d.points(
141 | subsample(pc.data.T, 0.1),
142 | color=cm.tab10.colors[i],
143 | scale=0.005
144 | )
145 | vis3d.show()
146 |
--------------------------------------------------------------------------------
/examples/franka_rl_stable_baselines.py:
--------------------------------------------------------------------------------
1 | '''
2 | This script doesn't learn any useful policies.
3 | It's an example of how to interface with stable baselines.
4 | '''
5 | import argparse
6 | from autolab_core import YamlConfig
7 |
8 | from isaacgym_utils.rl.stable_baselines import GymFrankaBlockVecEnvStableBaselines
9 | from isaacgym_utils.draw import draw_transforms
10 |
11 | from stable_baselines3 import PPO
12 |
13 |
14 | if __name__ == "__main__":
15 | parser = argparse.ArgumentParser()
16 | parser.add_argument('--cfg', '-c', type=str, default='cfg/franka_rl_stable_baselines.yaml')
17 | parser.add_argument('--logdir', '-l', type=str, default='outs/tb')
18 | args = parser.parse_args()
19 | cfg = YamlConfig(args.cfg)
20 |
21 | vec_env = GymFrankaBlockVecEnvStableBaselines(cfg)
22 |
23 | def custom_draws(scene):
24 | franka = scene.get_asset('franka')
25 | for env_idx in scene.env_idxs:
26 | ee_transform = franka.get_ee_transform(env_idx, 'franka')
27 | draw_transforms(scene, [env_idx], [ee_transform])
28 |
29 | def learn_cb(local_vars, global_vars):
30 | vec_env.render(custom_draws=custom_draws)
31 |
32 | model = PPO('MlpPolicy', env=vec_env, verbose=1, tensorboard_log=args.logdir, **cfg['rl']['ppo'])
33 | model.learn(total_timesteps=cfg['rl']['total_timesteps'], callback=learn_cb, reset_num_timesteps=False)
34 |
--------------------------------------------------------------------------------
/examples/franka_rl_vec_env.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | import numpy as np
4 | from autolab_core import YamlConfig
5 |
6 | from isaacgym_utils.rl import GymFrankaBlockVecEnv
7 | from isaacgym_utils.draw import draw_transforms
8 |
9 |
10 | if __name__ == "__main__":
11 | parser = argparse.ArgumentParser()
12 | parser.add_argument('--cfg', '-c', type=str, default='cfg/franka_rl_vec_env.yaml')
13 | args = parser.parse_args()
14 | cfg = YamlConfig(args.cfg)
15 |
16 | vec_env = GymFrankaBlockVecEnv(cfg)
17 |
18 | def custom_draws(scene):
19 | franka = scene.get_asset('franka')
20 | for env_idx in scene.env_idxs:
21 | ee_transform = franka.get_ee_transform(env_idx, 'franka')
22 | draw_transforms(scene, [env_idx], [ee_transform])
23 |
24 | all_obs = vec_env.reset()
25 | t = 0
26 | while True:
27 | all_actions = np.array([vec_env.action_space.sample() for _ in range(vec_env.n_envs)])
28 | all_obs, all_rews, all_dones, all_infos = vec_env.step(all_actions)
29 | vec_env.render(custom_draws=custom_draws)
30 |
31 | t += 1
32 | if t == 100:
33 | vec_env.reset()
34 | t = 0
35 |
--------------------------------------------------------------------------------
/isaacgym_utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/isaacgym_utils/__init__.py
--------------------------------------------------------------------------------
/isaacgym_utils/assets/__init__.py:
--------------------------------------------------------------------------------
1 | from .assets import GymURDFAsset, GymBoxAsset, GymTetGridAsset, GymCapsuleAsset, GymSphereAsset
2 | from .franka import GymFranka
--------------------------------------------------------------------------------
/isaacgym_utils/assets/franka.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from pathlib import Path
3 |
4 | from isaacgym import gymapi
5 | from isaacgym_utils.constants import isaacgym_utils_ASSETS_PATH
6 | from isaacgym_utils.math_utils import transform_to_RigidTransform, vec3_to_np, quat_to_rot, np_to_vec3
7 |
8 | from .assets import GymURDFAsset
9 | from .franka_numerical_utils import get_franka_mass_matrix
10 |
11 |
12 | class GymFranka(GymURDFAsset):
13 |
14 | INIT_JOINTS = np.array([0, -np.pi / 4, 0, -3 * np.pi / 4, 0, np.pi / 2, np.pi / 4, 0.04, 0.04])
15 | _LOWER_LIMITS = None
16 | _UPPER_LIMITS = None
17 | _VEL_LIMITS = None
18 |
19 | _URDF_PATH = 'franka_description/robots/franka_panda.urdf'
20 | _URDF_PATH_WITH_DYNAMICS = 'franka_description/robots/franka_panda_dynamics.urdf'
21 |
22 | @staticmethod
23 | def _key(env_idx, name):
24 | return (env_idx, name)
25 |
26 | def __init__(self, cfg, *args, actuation_mode='joints'):
27 | if 'urdf' in cfg:
28 | urdf_path = cfg['urdf']
29 | assets_root = Path(cfg['assets_root'])
30 | else:
31 | urdf_path = GymFranka._URDF_PATH_WITH_DYNAMICS
32 | assets_root = isaacgym_utils_ASSETS_PATH
33 | super().__init__(urdf_path, *args,
34 | shape_props=cfg['shape_props'],
35 | dof_props=cfg['dof_props'],
36 | asset_options=cfg['asset_options'],
37 | assets_root=assets_root
38 | )
39 |
40 | self._use_custom_ee = False
41 | if 'custom_ee_rb_name' in cfg:
42 | self._use_custom_ee = True
43 | self._custom_ee_rb_name = cfg['custom_ee_rb_name']
44 |
45 | self._left_finger_rb_name = cfg.get('custom_left_finger_rb_name', 'panda_leftfinger')
46 | self._right_finger_rb_name = cfg.get('custom_right_finger_rb_name', 'panda_rightfinger')
47 |
48 | self._ee_tool_offset = gymapi.Transform()
49 | if 'custom_ee_offset' in cfg:
50 | self._ee_tool_offset = gymapi.Transform((np_to_vec3(cfg['custom_ee_offset'])))
51 |
52 | self._gripper_offset = gymapi.Transform(gymapi.Vec3(0, 0, 0.1034))
53 | self._finger_offset = gymapi.Transform(gymapi.Vec3(0, 0, 0.045))
54 |
55 | self._actuation_mode = actuation_mode
56 | self._attractor_handles_map = {}
57 | self._attractor_transforms_map = {}
58 |
59 | if actuation_mode == 'attractors':
60 | self._attractor_stiffness = cfg['attractor_props']['stiffness']
61 | self._attractor_damping = cfg['attractor_props']['damping']
62 |
63 | def set_gripper_width_target(self, env_idx, name, width):
64 | joints_targets = self.get_joints_targets(env_idx, name)
65 | joints_targets[-2:] = width
66 | self.set_joints_targets(env_idx, name, joints_targets)
67 |
68 | def open_grippers(self, env_idx, name):
69 | self.set_gripper_width_target(env_idx, name, 0.04)
70 |
71 | def close_grippers(self, env_idx, name):
72 | self.set_gripper_width_target(env_idx, name, 0)
73 |
74 | def set_gripper_width(self, env_idx, name, width):
75 | width = np.clip(width, self._LOWER_LIMITS[-1], self._UPPER_LIMITS[-1])
76 | self.set_gripper_width_target(env_idx, name, width)
77 |
78 | joints = self.get_joints(env_idx, name)
79 | joints[-2] = width
80 | self.set_joints(env_idx, name, joints)
81 |
82 | def get_gripper_width(self, env_idx, name):
83 | return self.get_joints(env_idx, name)[-1]
84 |
85 | def get_base_transform(self, env_idx, name):
86 | return self.get_rb_transform(env_idx, name, 'panda_link0')
87 |
88 | def get_ee_transform(self, env_idx, name, offset=True):
89 | ee_transform = self.get_rb_transform(env_idx, name, 'panda_hand')
90 | if offset:
91 | ee_transform = ee_transform * self._gripper_offset * self._ee_tool_offset
92 | return ee_transform
93 |
94 | def get_ee_rigid_transform(self, env_idx, name, offset=True):
95 | return transform_to_RigidTransform(self.get_ee_transform(env_idx, name, offset=offset),
96 | from_frame='panda_ee', to_frame='panda_link0')
97 |
98 | def get_finger_transforms(self, env_idx, name, offset=True):
99 | lf_transform = self.get_rb_transform(env_idx, name, self._left_finger_rb_name)
100 | rf_transform = self.get_rb_transform(env_idx, name, self._right_finger_rb_name)
101 |
102 | if offset:
103 | lf_transform = lf_transform * self._finger_offset
104 | rf_transform = rf_transform * self._finger_offset
105 |
106 | return lf_transform, rf_transform
107 |
108 | def get_desired_ee_transform(self, env_idx, name):
109 | if self._actuation_mode != 'attractors':
110 | raise ValueError('Can\'t get desired ee transform when not using attractors!')
111 |
112 | key = self._key(env_idx, name)
113 | return self._attractor_transforms_map[key]
114 |
115 | def get_left_finger_ct_forces(self, env_idx, name):
116 | rbi = self.rb_names_map[self._left_finger_rb_name]
117 | return self.get_rb_ct_forces(env_idx, name)[rbi]
118 |
119 | def get_right_finger_ct_forces(self, env_idx, name):
120 | rbi = self.rb_names_map[self._right_finger_rb_name]
121 | return self.get_rb_ct_forces(env_idx, name)[rbi]
122 |
123 | def get_ee_ct_forces(self, env_idx, name):
124 | if self._use_custom_ee:
125 | rbi = self.rb_names_map[self._custom_ee_rb_name]
126 | ct_forces = self.get_rb_ct_forces(env_idx, name)[rbi]
127 | else:
128 | ct_forces_lf = self.get_left_finger_ct_forces(env_idx, name)
129 | ct_forces_rf = self.get_right_finger_ct_forces(env_idx, name)
130 | ct_forces = ct_forces_lf + ct_forces_rf
131 |
132 | return ct_forces
133 |
134 | @property
135 | def joint_limits_lower(self):
136 | return self._LOWER_LIMITS
137 |
138 | @property
139 | def joint_limits_upper(self):
140 | return self._UPPER_LIMITS
141 |
142 | @property
143 | def joint_max_velocities(self):
144 | return self._VEL_LIMITS
145 |
146 | def set_actuation_mode(self, mode, env_idx, name):
147 | self._actuation_mode = mode
148 | env_ptr = self._scene.env_ptrs[env_idx]
149 | if self._actuation_mode == 'attractors':
150 | self.set_dof_props(env_idx, name, {
151 | 'driveMode': [gymapi.DOF_MODE_NONE] * 7 + [gymapi.DOF_MODE_POS] * 2
152 | })
153 |
154 | key = self._key(env_idx, name)
155 | if key not in self._attractor_handles_map:
156 | attractor_props = gymapi.AttractorProperties()
157 | attractor_props.stiffness = self._attractor_stiffness
158 | attractor_props.damping= self._attractor_damping
159 | attractor_props.axes = gymapi.AXIS_ALL
160 |
161 | gripper_handle = self._scene.gym.get_rigid_handle(env_ptr, name, 'panda_hand')
162 | attractor_props.rigid_handle = gripper_handle
163 | attractor_props.offset = self._gripper_offset * self._ee_tool_offset
164 |
165 | attractor_handle = self._scene.gym.create_rigid_body_attractor(env_ptr, attractor_props)
166 | self._attractor_handles_map[key] = attractor_handle
167 |
168 | gripper_transform = self.get_ee_transform(env_idx, name)
169 | self.set_ee_transform(env_idx, name, gripper_transform)
170 | elif self._actuation_mode == 'joints':
171 | self.set_dof_props(env_idx, name, {
172 | 'driveMode': [gymapi.DOF_MODE_POS] * 9
173 | })
174 | elif self._actuation_mode == 'torques':
175 | self.set_dof_props(env_idx, name, {
176 | 'driveMode': [gymapi.DOF_MODE_EFFORT] * 7 + [gymapi.DOF_MODE_POS] * 2
177 | })
178 | else:
179 | raise ValueError('Unknown actuation mode! Must be attractors, joints, or torques!')
180 |
181 | def _post_create_actor(self, env_idx, name):
182 | super()._post_create_actor(env_idx, name)
183 | self.set_joints(env_idx, name, self.INIT_JOINTS)
184 | self.set_joints_targets(env_idx, name, self.INIT_JOINTS)
185 |
186 | if self._LOWER_LIMITS is None or self._UPPER_LIMITS is None or self._VEL_LIMITS is None:
187 | dof_props = self.get_dof_props(env_idx, name)
188 | self._LOWER_LIMITS = dof_props['lower']
189 | self._UPPER_LIMITS = dof_props['upper']
190 | self._VEL_LIMITS = dof_props['velocity']
191 |
192 | self.set_actuation_mode(self._actuation_mode, env_idx, name)
193 |
194 | def set_attractor_props(self, env_idx, name, props):
195 | if self._actuation_mode != 'attractors':
196 | raise ValueError('Not using attractors!')
197 | env_ptr = self._scene.env_ptrs[env_idx]
198 |
199 | key = self._key(env_idx, name)
200 | ath = self._attractor_handles_map[key]
201 | attractor_props = self._scene.gym.get_attractor_properties(env_ptr, ath)
202 |
203 | for key, val in props.items():
204 | setattr(attractor_props, key, val)
205 |
206 | self._scene.gym.set_attractor_properties(env_ptr, ath, attractor_props)
207 |
208 | def set_ee_transform(self, env_idx, name, transform):
209 | if self._actuation_mode != 'attractors':
210 | raise ValueError('Can\'t set ee transform when not using attractors!')
211 | key = self._key(env_idx, name)
212 | attractor_handle = self._attractor_handles_map[key]
213 |
214 | self._attractor_transforms_map[key] = transform
215 |
216 | env_ptr = self._scene.env_ptrs[env_idx]
217 | self._scene.gym.set_attractor_target(env_ptr, attractor_handle, transform)
218 |
219 | def set_delta_ee_transform(self, env_idx, name, transform):
220 | ''' This performs delta translation in the global frame and
221 | delta rotation in the end-effector frame.
222 | '''
223 | current_transform = self.get_ee_transform(env_idx, name)
224 | desired_transform = gymapi.Transform(p=current_transform.p, r=current_transform.r)
225 | desired_transform.p = desired_transform.p + transform.p
226 | desired_transform.r = transform.r * desired_transform.r
227 |
228 | self.set_ee_transform(env_idx, name, desired_transform)
229 |
230 | def apply_torque(self, env_idx, name, tau):
231 | if len(tau) == 7:
232 | tau = np.concatenate([tau, np.zeros(2)])
233 |
234 | self.apply_actor_dof_efforts(env_idx, name, tau)
235 |
236 | def get_links_transforms(self, env_idx, name):
237 | return [
238 | self.get_rb_transform(env_idx, name, f'panda_link{i}')
239 | for i in range(1, 8)
240 | ]
241 |
242 | def get_links_rigid_transforms(self, env_idx, name):
243 | transforms = self.get_links_transforms(env_idx, name)
244 | return [transform_to_RigidTransform(transform,
245 | from_frame='panda_link{}'.format(i+1),
246 | to_frame='panda_link0')
247 | for i, transform in enumerate(transforms)]
248 |
249 | def get_jacobian(self, env_idx, name, target_joint=7):
250 | transforms = self.get_links_transforms(env_idx, name)
251 |
252 | if target_joint == 7:
253 | ee_pos = vec3_to_np(self.get_ee_transform(env_idx, name).p)
254 | else:
255 | ee_pos = vec3_to_np(transforms[target_joint].p)
256 |
257 | joints_pos, axes = np.zeros((7, 3)), np.zeros((7, 3))
258 | for i, transform in enumerate(transforms[:target_joint]):
259 | joints_pos[i] = vec3_to_np(transform.p)
260 | axes[i] = quat_to_rot(transform.r)[:, 2]
261 | J = np.r_[np.cross(axes, ee_pos - joints_pos).T, axes.T]
262 |
263 | return J
264 |
265 | def get_mass_matrix(self, env_idx, name):
266 | q = self.get_joints(env_idx, name)[:7]
267 | return get_franka_mass_matrix(q)
268 |
269 | def reset_joints(self, env_idx, name):
270 | self.set_joints(env_idx, name, self.INIT_JOINTS)
271 |
--------------------------------------------------------------------------------
/isaacgym_utils/assets/franka_numerical_utils.cpython-36m-x86_64-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/isaacgym_utils/assets/franka_numerical_utils.cpython-36m-x86_64-linux-gnu.so
--------------------------------------------------------------------------------
/isaacgym_utils/assets/franka_numerical_utils.cpython-37m-x86_64-linux-gnu.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iamlab-cmu/isaacgym-utils/7225b1eae71fd9d1bf943e64cda810c86c2c937a/isaacgym_utils/assets/franka_numerical_utils.cpython-37m-x86_64-linux-gnu.so
--------------------------------------------------------------------------------
/isaacgym_utils/camera.py:
--------------------------------------------------------------------------------
1 | from copy import deepcopy
2 | import quaternion
3 |
4 | import numpy as np
5 | from autolab_core import CameraIntrinsics, ColorImage, DepthImage, SegmentationImage, NormalCloudImage
6 |
7 | from isaacgym import gymapi
8 | from .math_utils import transform_to_RigidTransform, vec3_to_np, np_quat_to_quat
9 | from .constants import quat_gym_to_real_cam, quat_real_to_gym_cam
10 |
11 |
12 | class GymCamera:
13 |
14 | def __init__(self, scene, cam_props={}):
15 | self._scene = scene
16 |
17 | self.gym_cam_props = gymapi.CameraProperties()
18 | for key, value in cam_props.items():
19 | if hasattr(self.gym_cam_props, key):
20 | setattr(self.gym_cam_props, key, value)
21 |
22 | self._x_axis_rot = np.array([
23 | [1, 0, 0],
24 | [0, -1, 0],
25 | [0, 0, -1],
26 | ])
27 |
28 | self._intr_map = {}
29 |
30 | @property
31 | def width(self):
32 | return self.gym_cam_props.width
33 |
34 | @property
35 | def height(self):
36 | return self.gym_cam_props.height
37 |
38 | @property
39 | def fov(self):
40 | return np.deg2rad(self.gym_cam_props.horizontal_fov)
41 |
42 | def get_transform(self, env_idx, name):
43 | env_ptr = self._scene.env_ptrs[env_idx]
44 | ch = self._scene.ch_map[env_idx][name]
45 | # re-orients the camera in an "optical" convention
46 | # given the transform provided by isaac gym
47 | # +z forward, +x right, +y down
48 | transform = self._scene.gym.get_camera_transform(self._scene.sim, env_ptr, ch)
49 | transform.r = transform.r * quat_gym_to_real_cam
50 | return transform
51 |
52 | def set_look_at(self, env_idx, name, look_from_pos, look_at_pos):
53 | z_axis = vec3_to_np(look_at_pos - look_from_pos)
54 | z_axis = z_axis / np.linalg.norm(z_axis)
55 |
56 | y_axis = np.array([0, 0, -1])
57 | y_axis = y_axis - y_axis @ z_axis * z_axis
58 | y_axis = y_axis / np.linalg.norm(y_axis)
59 |
60 | x_axis = np.cross(y_axis, z_axis)
61 |
62 | R = np.c_[x_axis, y_axis, z_axis]
63 | q = np_quat_to_quat( quaternion.from_rotation_matrix(R))
64 |
65 | cam_transform = gymapi.Transform(look_from_pos, q)
66 | self.set_transform(env_idx, name, cam_transform)
67 |
68 | def set_transform(self, env_idx, name, transform):
69 | env_ptr = self._scene.env_ptrs[env_idx]
70 | ch = self._scene.ch_map[env_idx][name]
71 |
72 | tform_gym = deepcopy(transform)
73 | tform_gym.r = tform_gym.r * quat_real_to_gym_cam
74 |
75 | self._scene.gym.set_camera_transform(ch, env_ptr, tform_gym)
76 |
77 | def get_extrinsics(self, env_idx, name):
78 | transform = self.get_transform(env_idx, name)
79 | return transform_to_RigidTransform(transform, name, 'world')
80 |
81 | def get_intrinsics(self, name):
82 | if name not in self._intr_map:
83 | hx, hy = self.width/2, self.height/2
84 | fx = hx / np.tan(self.fov/2)
85 | fy = fx
86 | self._intr_map[name] = CameraIntrinsics(name, fx, fy, hx, hy, height=self.height, width=self.width)
87 | return self._intr_map[name]
88 |
89 | def frames(self, env_idx, name, get_color=True, get_depth=True, get_seg=True, get_normal=True):
90 | assert get_color or get_depth or get_seg or get_normal
91 |
92 | env_ptr = self._scene.env_ptrs[env_idx]
93 | ch = self._scene.ch_map[env_idx][name]
94 |
95 | frames = {}
96 |
97 | if get_color:
98 | raw_color = self._scene.gym.get_camera_image(self._scene.sim, env_ptr, ch, gymapi.IMAGE_COLOR)
99 | color = _process_gym_color(raw_color)
100 | frames['color'] = ColorImage(color, frame=name)
101 | if get_depth:
102 | raw_depth = self._scene.gym.get_camera_image(self._scene.sim, env_ptr, ch, gymapi.IMAGE_DEPTH)
103 | depth = _process_gym_depth(raw_depth)
104 | frames['depth'] = DepthImage(depth, frame=name)
105 | if get_seg:
106 | raw_seg = self._scene.gym.get_camera_image(self._scene.sim, env_ptr, ch, gymapi.IMAGE_SEGMENTATION)
107 | frames['seg'] = SegmentationImage(raw_seg.astype('uint16'), frame=name)
108 | if get_normal:
109 | if get_depth:
110 | depth_im = frames['depth']
111 | else:
112 | raw_depth = self._scene.gym.get_camera_image(self._scene.sim, env_ptr, ch, gymapi.IMAGE_DEPTH)
113 | depth = _process_gym_depth(raw_depth)
114 | depth_im = DepthImage(depth, frame=name)
115 |
116 | normal = _make_normal_map(depth_im, self.get_intrinsics(name))
117 | frames['normal'] = NormalCloudImage(normal, frame=name)
118 |
119 | return frames
120 |
121 |
122 | def _process_gym_color(raw_im):
123 | return raw_im.flatten().reshape(raw_im.shape[0], raw_im.shape[1]//4, 4)[:, :, :3]
124 |
125 |
126 | def _process_gym_depth(raw_depth, flip=True):
127 | return raw_depth * (-1 if flip else 1)
128 |
129 |
130 | def _make_normal_map(depth, intr, inf_depth=100):
131 | # from https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/ismar2011.pdf
132 | depth_data = depth.data.copy()
133 | inf_px_mask = np.isinf(depth_data)
134 | depth_data[inf_px_mask] = inf_depth
135 | depth = DepthImage(depth_data, frame=depth.frame)
136 |
137 | pts = intr.deproject_to_image(depth).data
138 |
139 | A = pts[1:, :-1] - pts[:-1, :-1]
140 | B = pts[:-1, 1:] - pts[:-1, :-1]
141 | C = np.cross(A.reshape(-1, 3), B.reshape(-1, 3))
142 | D = C / np.linalg.norm(C, axis=1).reshape(-1, 1)
143 |
144 | normal = np.zeros((depth.shape[0], depth.shape[1], 3))
145 | normal[:-1, :-1] = D.reshape(A.shape)
146 | normal[-1, :] = normal[-2, :]
147 | normal[:, -1] = normal[:, -2]
148 | normal[inf_px_mask] = 0
149 |
150 | return normal
151 |
--------------------------------------------------------------------------------
/isaacgym_utils/constants.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import pkg_resources
3 | from pathlib import Path
4 |
5 | import isaacgym
6 | from isaacgym import gymapi
7 |
8 | import isaacgym_utils
9 |
10 |
11 | isaacgym_PATH = Path(isaacgym.__file__).parent.parent
12 | isaacgym_ASSETS_PATH = isaacgym_PATH.parent / 'assets'
13 |
14 |
15 | isaacgym_utils_PATH = Path(isaacgym_utils.__file__).parent.parent
16 | isaacgym_utils_ASSETS_PATH = isaacgym_utils_PATH / 'assets'
17 |
18 |
19 | isaacgym_VERSION = pkg_resources.working_set.find(
20 | pkg_resources.Requirement('isaacgym')
21 | ).version
22 |
23 |
24 | # This is to convert between canonical/real/optical cam frame and gym cam frame
25 | # Real cam frame is (z forward, x right, y down)
26 | # Gym cam frame is (x forward, y left, z up)
27 | # R_gym = R_real * R_real_to_gym_cam
28 | R_real_to_gym_cam = np.array([
29 | [ 0., -1., 0.],
30 | [ 0., 0., -1.],
31 | [ 1., 0., 0.],
32 | ])
33 | quat_real_to_gym_cam = gymapi.Quat(0.5, -0.5, 0.5, 0.5)
34 | quat_gym_to_real_cam = quat_real_to_gym_cam.inverse()
35 |
--------------------------------------------------------------------------------
/isaacgym_utils/ctrl_utils.py:
--------------------------------------------------------------------------------
1 | from abc import ABC, abstractmethod
2 | import numpy as np
3 |
4 | import quaternion
5 |
6 |
7 | class PIDController:
8 |
9 | def __init__(self, Kps, Kis=None, Kds=None):
10 | self._Kps = np.array(Kps)
11 | self._Kis = Kis if Kis is not None else np.zeros_like(self._Kps)
12 | self._Kds = Kds if Kds is not None else np.zeros_like(self._Kps)
13 |
14 | self.reset()
15 |
16 | def set_gains(self, Kps=None, Kis=None, Kds=None):
17 | if Kps is not None:
18 | self._Kps = Kps
19 | if Kis is not None:
20 | self._Kis = Kis
21 | if Kds is not None:
22 | self._Kds = Kds
23 |
24 | def step(self, err, err_dot=None):
25 | if err_dot is None:
26 | if self._last_err is None:
27 | err_dot = np.zeros_like(self._Kps)
28 | else:
29 | err_dot = err - self._last_err
30 |
31 | ctrl = self._Kps * err + self._Kds * err_dot + self._Kis * self._errs_I
32 |
33 | self._last_err = err
34 | self._errs_I += err
35 |
36 | return ctrl
37 |
38 | def reset(self):
39 | self._last_err = None
40 | self._errs_I = np.zeros_like(self._Kps, dtype=np.float)
41 |
42 |
43 | class MovingFilter(ABC):
44 |
45 | def __init__(self, dim, window):
46 | self._buffer = np.zeros((window, dim))
47 | self.reset()
48 |
49 | def step(self, x):
50 | self._buffer[self._i] = x
51 |
52 | self._i = (self._i + 1) % len(self._buffer)
53 | if self._i == len(self._buffer) - 1:
54 | self._full = True
55 |
56 | N = len(self._buffer) if self._full else self._i
57 | return self._filter(self._buffer[:N])
58 |
59 | @abstractmethod
60 | def _filter(self, N):
61 | pass
62 |
63 | def reset(self):
64 | self._i = 0
65 | self._full = False
66 |
67 |
68 | class MovingAverageFilter(MovingFilter):
69 |
70 | def _filter(self, data):
71 | return np.mean(data, axis=0)
72 |
73 |
74 | class MovingMedianFilter(MovingFilter):
75 |
76 | def _filter(self, data):
77 | return np.median(data, axis=0)
78 |
79 |
80 | class ForcePositionController:
81 |
82 | def __init__(self, xd, fd, S, n_dof,
83 | force_kps=None, force_kis=None,
84 | pos_kps=None, pos_kds=None,
85 | use_joint_gains_for_position_ctrl=True,
86 | use_joint_gains_for_force_ctrl=True):
87 | self._xd = xd
88 | self._fd = fd
89 | self._S = np.diag(S)
90 | self._Sp = np.eye(6) - self._S
91 |
92 | self._n_dof = n_dof
93 |
94 | self._use_joint_gains_for_position_ctrl = use_joint_gains_for_position_ctrl
95 | self._use_joint_gains_for_force_ctrl = use_joint_gains_for_force_ctrl
96 |
97 | self._n_force = n_dof if use_joint_gains_for_force_ctrl else 6
98 | self._n_pos = n_dof if use_joint_gains_for_position_ctrl else 6
99 |
100 | if force_kps is None:
101 | force_kps = np.ones(self._n_force) * 0.1
102 | if force_kis is None:
103 | force_kis = force_kps * 0.1
104 | if pos_kps is None:
105 | pos_kps = np.ones(self._n_force) * 40
106 | if pos_kds is None:
107 | pos_kds = 2 * np.sqrt(pos_kps)
108 |
109 | self._torque_ctrlr = PIDController(force_kps, force_kis, [0] * self._n_force)
110 | self._pos_ctrlr = PIDController(pos_kps, [0] * self._n_pos, pos_kds)
111 |
112 | def set_targets(self, xd=None, fd=None, S=None):
113 | if xd is not None:
114 | self._xd = xd
115 | if fd is not None:
116 | self._fd = fd
117 | if S is not None:
118 | if len(S.shape) == 1:
119 | S = np.diag(S)
120 | self._S = S
121 | self._Sp = np.eye(6) - self._S
122 |
123 | def get_K_param_from_input(self, k_param, nd):
124 | if type(k_param) in (float, int, np.float32, np.int32, np.float64):
125 | k_param_list = [k_param] * nd
126 | elif type(k_param) is list:
127 | assert len(k_param) == nd, "Invalid number of params provided"
128 | k_param_list = k_param
129 | else:
130 | raise ValueError("Invalid force ")
131 | return np.array(k_param_list)
132 |
133 | def set_ctrls(self, force_kp=None, force_ki=None, pos_kp=None, pos_kd=None):
134 | force_kp_list = self.get_K_param_from_input(force_kp, self._n_force) \
135 | if force_kp is not None else None
136 | force_ki_list = self.get_K_param_from_input(force_ki, self._n_force) \
137 | if force_ki is not None else None
138 |
139 | pos_kp_list = self.get_K_param_from_input(pos_kp, self._n_pos) \
140 | if pos_kp is not None else None
141 | pos_kd_list = self.get_K_param_from_input(pos_kd, self._n_pos) \
142 | if pos_kd is not None else None
143 |
144 | self._torque_ctrlr.set_gains(Kps=force_kp_list, Kis=force_ki_list)
145 | self._pos_ctrlr.set_gains(Kps=pos_kp_list, Kis=None, Kds=pos_kd_list)
146 |
147 | def _calculate_position_torque(self, xa, xa_dot, J, qdot):
148 | # Compute cartesian position error.
149 | pos_d, orient_d = self._xd[:3], self._xd[3:7]
150 | pos, orient = xa[:3], xa[3:7]
151 | xe_pos = pos_d - pos
152 |
153 | orient_d_quat = quaternion.as_quat_array(orient_d)
154 | orient_quat = quaternion.as_quat_array(orient)
155 | if orient_d.dot(orient) < 0.0:
156 | orient = -orient_d
157 |
158 | # This is desired - actual
159 | error_quat = orient_d_quat * orient_quat.inverse()
160 | error_angle_axis = error_quat.angle() * quaternion.as_rotation_vector(error_quat)
161 |
162 | xe = np.concatenate([xe_pos, error_angle_axis])
163 | xes = self._S @ xe
164 | if self._use_joint_gains_for_position_ctrl:
165 | q_es = J.T @ xes
166 | tau_p = self._pos_ctrlr.step(q_es, -qdot)
167 | else:
168 | xas_dot = self._S @ xa_dot
169 | force_p = self._pos_ctrlr.step(xes, -xas_dot)
170 | tau_p = J.T @ force_p
171 |
172 | return tau_p
173 |
174 | def _calculate_force_torque(self, fa, J):
175 | fe = self._fd - fa
176 | fes = self._Sp @ fe
177 | if self._use_joint_gains_for_force_ctrl:
178 | tau_es = J.T @ fes
179 | tau_f = self._torque_ctrlr.step(tau_es)
180 | else:
181 | force_f = self._torque_ctrlr.step(fes)
182 | tau_f = J.T @ force_f
183 |
184 | return tau_f
185 |
186 | def step(self, xa, xa_dot, fa, J, qdot):
187 | tau_p = self._calculate_position_torque(xa, xa_dot, J, qdot)
188 | tau_f = self._calculate_force_torque(fa, J)
189 | tau = tau_p + tau_f
190 |
191 | return tau
192 |
--------------------------------------------------------------------------------
/isaacgym_utils/draw.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | from isaacgym import gymapi
3 | from isaacgym.gymutil import LineGeometry, AxesGeometry, WireframeSphereGeometry, WireframeBoxGeometry, draw_lines
4 |
5 |
6 | force_vector_color = gymapi.Vec3(0.7, 0.2, 0.15)
7 | contact_draw_scale = 0.01
8 | def draw_contacts(scene, env_idxs):
9 | if not scene.use_gpu_pipeline:
10 | for env_idx in env_idxs:
11 | env_ptr = scene.env_ptrs[env_idx]
12 | scene.gym.draw_env_rigid_contacts(scene.viewer, env_ptr, force_vector_color, contact_draw_scale, False)
13 |
14 |
15 | def draw_transforms(scene, env_idxs, transforms, length=0.05):
16 | axes_geom = AxesGeometry(length)
17 | for env_idx in env_idxs:
18 | env_ptr = scene.env_ptrs[env_idx]
19 | for transform in transforms:
20 | draw_lines(axes_geom, scene.gym, scene.viewer, env_ptr, transform)
21 |
22 |
23 | def draw_spheres(scene, env_idxs, positions, radius, color=None):
24 | sphere_geom = WireframeSphereGeometry(radius=radius, color=color)
25 | for env_idx in env_idxs:
26 | env_ptr = scene.env_ptrs[env_idx]
27 | for position in positions:
28 | draw_lines(sphere_geom, scene.gym, scene.viewer, env_ptr, gymapi.Transform(p=position))
29 |
30 |
31 | class FrustumGeometry(LineGeometry):
32 |
33 | def __init__(self, scale=1., aspect_ratio=None, pose=None, color=None):
34 | if color is None:
35 | color = (1, 0, 0)
36 | if aspect_ratio is None:
37 | aspect_ratio = 1.
38 |
39 | num_lines = 8
40 |
41 | x = 0.5 * scale * aspect_ratio
42 | y = 0.5 * scale
43 | z = scale
44 |
45 | verts = np.empty((num_lines, 2), gymapi.Vec3.dtype)
46 | # projection frustum
47 | verts[0][0] = (0, 0, 0)
48 | verts[0][1] = (x, y, z)
49 | verts[1][0] = (0, 0, 0)
50 | verts[1][1] = (-x, y, z)
51 | verts[2][0] = (0, 0, 0)
52 | verts[2][1] = (x, -y, z)
53 | verts[3][0] = (0, 0, 0)
54 | verts[3][1] = (-x, -y, z)
55 |
56 | # imaging plane
57 | verts[4][0] = (-x, y, z)
58 | verts[4][1] = (x, y, z)
59 | verts[5][0] = (x, -y, z)
60 | verts[5][1] = (x, y, z)
61 | verts[6][0] = (-x, -y, z)
62 | verts[6][1] = (x, -y, z)
63 | verts[7][0] = (-x, -y, z)
64 | verts[7][1] = (-x, y, z)
65 |
66 | if pose is None:
67 | self.verts = verts
68 | else:
69 | self.verts = pose.transform_points(verts)
70 |
71 | colors = np.empty(num_lines, gymapi.Vec3.dtype)
72 | colors.fill(color)
73 | self._colors = colors
74 |
75 | def vertices(self):
76 | return self.verts
77 |
78 | def colors(self):
79 | return self._colors
80 |
81 |
82 | def draw_camera(
83 | scene,
84 | env_idxs,
85 | transform,
86 | length=0.05,
87 | color=(0.9, 0.9, 0.9),
88 | frustum_aspect_ratio=None,
89 | draw_frustum=True,
90 | draw_housing=True,
91 | draw_triad=True
92 | ):
93 |
94 | if draw_housing:
95 | # scale housing based on length
96 | cam_xdim, cam_ydim, cam_zdim = (length, length, 2. * length)
97 | box_geom = WireframeBoxGeometry(
98 | xdim=cam_xdim,
99 | ydim=cam_ydim,
100 | zdim=cam_zdim,
101 | color=color
102 | )
103 | if draw_frustum:
104 | frust_geom = FrustumGeometry(length, frustum_aspect_ratio, color=color)
105 |
106 | for env_idx in env_idxs:
107 | env_ptr = scene.env_ptrs[env_idx]
108 |
109 | # Draw camera "box" housing
110 | if draw_housing:
111 | # This pushes the housing backwards, so the triad is drawn at the housing end, not the middle
112 | cam_box_transform = transform * gymapi.Transform(p=gymapi.Vec3(0., 0., -cam_zdim / 2.))
113 | draw_lines(box_geom, scene.gym, scene.viewer, env_ptr, cam_box_transform)
114 |
115 | # Draw camera frustum
116 | if draw_frustum:
117 | draw_lines(frust_geom, scene.gym, scene.viewer, env_ptr, transform)
118 |
119 | # Draw camera triad
120 | if draw_triad:
121 | draw_transforms(scene, [env_idx], [transform], length=length)
122 |
--------------------------------------------------------------------------------
/isaacgym_utils/math_utils.py:
--------------------------------------------------------------------------------
1 | import os
2 | import random
3 |
4 | import numpy as np
5 | from autolab_core import RigidTransform
6 | from numba import jit
7 | import quaternion
8 |
9 | from isaacgym import gymapi
10 |
11 |
12 | def set_seed(seed):
13 | random.seed(seed)
14 | os.environ['PYTHONHASHSEED'] = str(seed)
15 | np.random.seed(seed)
16 |
17 |
18 | def transform_to_RigidTransform(transform, from_frame='', to_frame=''):
19 | return RigidTransform(
20 | rotation=quat_to_rot(transform.r),
21 | translation=vec3_to_np(transform.p),
22 | from_frame=from_frame, to_frame=to_frame
23 | )
24 |
25 |
26 | def RigidTransform_to_transform(rigid_transform):
27 | return gymapi.Transform(
28 | np_to_vec3(rigid_transform.translation),
29 | np_to_quat(rigid_transform.quaternion, 'wxyz')
30 | )
31 |
32 |
33 | def change_basis(T, R_cb, left=True, right=True):
34 | if left:
35 | T = RigidTransform(rotation=R_cb.T, from_frame=T.to_frame, to_frame=T.to_frame) * T
36 | if right:
37 | T = T * RigidTransform(rotation=R_cb, from_frame=T.from_frame, to_frame=T.from_frame)
38 | return T
39 |
40 |
41 | def vec3_to_np(vec):
42 | return np.array([vec.x, vec.y, vec.z], dtype=np.float32) if isinstance(vec, gymapi.Vec3) else vec
43 |
44 |
45 | def quat_to_np(q, format='xyzw'):
46 | return np.array([getattr(q, k) for k in format], dtype=np.float32)
47 |
48 |
49 | @jit(nopython=True)
50 | def rot_from_np_quat(q):
51 | ''' Expects wxyz
52 |
53 | From: https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToMatrix/jay.htm
54 | '''
55 | w, x, y, z = q
56 | A = np.array([
57 | [w, -z, y, x],
58 | [z, w, -x, y],
59 | [-y, x, w, z],
60 | [-x, -y, -z, w]
61 | ])
62 | B = np.array([
63 | [w, -z, y, -x],
64 | [z, w, -x, -y],
65 | [-y, x, w, -z],
66 | [x, y, z, w],
67 | ])
68 |
69 | return (A @ B)[:3, :3]
70 |
71 |
72 | def quat_to_rot(q):
73 | return rot_from_np_quat(quat_to_np(q, 'wxyz'))
74 |
75 |
76 | def rpy_to_quat(rpy):
77 | q = quaternion.from_euler_angles(rpy)
78 | return gymapi.Quat(q.x, q.y, q.z, q.w)
79 |
80 |
81 | def quat_to_rpy(q):
82 | q = quaternion.quaternion(q.w, q.x, q.y, q.z)
83 | return quaternion.as_euler_angles(q)
84 |
85 |
86 | def transform_to_np(t, format='xyzw'):
87 | return np.concatenate([vec3_to_np(t.p), quat_to_np(t.r, format=format)], axis=0)
88 |
89 |
90 | def transform_to_np_rpy(t):
91 | T = transform_to_RigidTransform(t)
92 | return np.concatenate([T.translation, T.euler_angles], axis=0)
93 |
94 |
95 | def np_to_vec3(ary):
96 | return gymapi.Vec3(ary[0], ary[1], ary[2])
97 |
98 |
99 | def np_to_quat(ary, format='xyzw'):
100 | if format == 'wxyz':
101 | return gymapi.Quat(ary[1], ary[2], ary[3], ary[0])
102 | elif format == 'xyzw':
103 | return gymapi.Quat(ary[0], ary[1], ary[2], ary[3])
104 | else:
105 | raise ValueError('Unknown quat format! Must be xyzw or wxyz!')
106 |
107 |
108 | @jit(nopython=True)
109 | def rot_to_np_quat(R):
110 | # From https://d3cw3dd2w32x2b.cloudfront.net/wp-content/uploads/2015/01/matrix-to-quat.pdf
111 | q = np.zeros(4, dtype=np.float64)
112 | if R[2, 2] < 0:
113 | if R[0, 0] > R[1, 1]:
114 | t = 1 + R[0, 0] - R[1, 1] - R[2, 2]
115 | q[:] = [R[1, 2] - R[2, 1], t, R[0, 1] + R[1, 0], R[2, 0] + R[0, 2]]
116 | else:
117 | t = 1 - R[0, 0] + R[1, 1] - R[2, 2]
118 | q[:] = [R[2, 0] - R[0, 2], R[0, 1] + R[1, 0], t, R[1, 2] + R[2, 1]]
119 | else:
120 | if R[0, 0] < -R[1, 1]:
121 | t = 1 - R[0, 0] - R[1, 1] + R[2, 2]
122 | q[:] = [R[0, 1] - R[1, 0], R[2, 0] + R[0, 2], R[1, 2] + R[2, 1], t]
123 | else:
124 | t = 1 + R[0, 0] + R[1, 1] + R[2, 2]
125 | q[:] = [t, R[1, 2] - R[2, 1], R[2, 0] - R[0, 2], R[0, 1] - R[1, 0]]
126 |
127 | q *= 0.5 / np.sqrt(t)
128 | return q
129 |
130 |
131 | def rot_to_quat(R):
132 | return np_to_quat(rot_to_np_quat(R), format='wxyz')
133 |
134 |
135 | def np_quat_to_quat(q):
136 | return gymapi.Quat(w=q.w, x=q.x, y=q.y, z=q.z)
137 |
138 |
139 | def np_to_transform(ary, format='xyzw'):
140 | return gymapi.Transform(p=np_to_vec3(ary[:3]), r=np_to_quat(ary[3:], format=format))
141 |
142 |
143 | def min_jerk(xi, xf, t, T):
144 | r = t/T
145 | return xi + (xf - xi) * (10 * r ** 3 - 15 * r ** 4 + 6 * r ** 5)
146 |
147 |
148 | def min_jerk_delta(xi, xf, t, T):
149 | r = t/T
150 | return (xf - xi) * (30 * r ** 2 - 60 * r ** 3 + 30 * r ** 4)
151 |
152 |
153 | def min_jerk_v(v_max, t, T):
154 | r = t/T
155 | return 8 / 15 * v_max * (30 * r ** 2 - 60 * r ** 3 + 30 * r ** 4)
156 |
157 |
158 | def slerp_quat(q0, q1, t, T=1):
159 | t = max(min(t/T, 1), 0)
160 |
161 | qt = quaternion.slerp(
162 | quaternion.from_float_array(quat_to_np(q0, format='wxyz')),
163 | quaternion.from_float_array(quat_to_np(q1, format='wxyz')),
164 | 0, 1, t
165 | )
166 |
167 | return gymapi.Quat(w=qt.w, x=qt.x, y=qt.y, z=qt.z)
168 |
169 |
170 | def skew(x):
171 | return np.array([[0, -x[2], x[1]],
172 | [x[2], 0, -x[0]],
173 | [-x[1], x[0], 0]])
174 |
175 |
176 | def rotation_between_axes(v0, v1):
177 | '''
178 | Calculates R such that R @ v0 = v1
179 | Uses Rodrigues' formula.
180 | Assumes v0 and v1 are unit vectors
181 | '''
182 | d = v0 @ v1
183 | if np.isclose(d, 1, atol=1e-5):
184 | return np.eye(3)
185 | elif np.isclose(d, -1, atol=1e-5):
186 | N = np.eye(3) - np.outer(v0, v0)
187 | while True:
188 | ax = N @ np.random.randn(3)
189 | ax_norm = np.linalg.norm(ax)
190 | if not np.isclose(ax_norm, 0, atol=1e-5):
191 | ax /= ax_norm
192 | break
193 | v_axis = ax
194 | norm_v = 0
195 | else:
196 | v = np.cross(v0, v1)
197 | norm_v = np.linalg.norm(v)
198 | v_axis = v / norm_v
199 |
200 | K = skew(v_axis)
201 | R = np.eye(3) + norm_v * K + (1 - d) * (K @ K)
202 |
203 | return R
204 |
205 |
206 | def angle_axis_between_axes(v0, v1):
207 | ''' Computes the angle-axis rotation that brings v0 to v1
208 | '''
209 | v = np.cross(v0, v1)
210 | norm_v = np.linalg.norm(v)
211 |
212 | if np.isclose(norm_v, 0, atol=1e-5):
213 | return np.zeros(3)
214 |
215 | axis = v / norm_v
216 | angle = angle_between_axes(v0, v1)
217 |
218 | return angle * axis
219 |
220 |
221 | @jit(nopython=True)
222 | def angle_between_axes(v0, v1):
223 | return np.arccos(max(min(v0 @ v1, 1), -1))
224 |
225 |
226 | def rotation_to_angle_axis(R):
227 | q = quaternion.from_rotation_matrix(R)
228 | return quaternion.as_rotation_vector(q)
229 |
230 |
231 | def angle_axis_to_rotation(angle_axis):
232 | q = quaternion.from_rotation_vector(angle_axis)
233 | return quaternion.as_rotation_matrix(q)
234 |
235 |
236 | _R_sim_to_real_franka = np.array([
237 | [1, 0, 0],
238 | [0, 0, -1],
239 | [0, 1, 0]
240 | ])
241 |
242 |
243 | def real_to_sim_franka_transform(Treal_frame_to_base, Tsim_base_to_world=None):
244 | Tsim_frame_to_base = change_basis(Treal_frame_to_base, _R_sim_to_real_franka, left=True, right=False)
245 | if Tsim_base_to_world is None:
246 | Tsim_frame_to_world = Tsim_frame_to_base.as_frames(Tsim_frame_to_base.from_frame, 'world')
247 | else:
248 | Tsim_frame_to_world = Tsim_base_to_world * Tsim_frame_to_base
249 | return Tsim_frame_to_world
250 |
251 |
252 | def sim_to_real_franka_transform(Tsim_frame_to_world, Tsim_base_to_world=None):
253 | if Tsim_base_to_world is None:
254 | Tsim_frame_to_base = Tsim_frame_to_world
255 | else:
256 | Tsim_frame_to_base = Tsim_base_to_world.inverse() * Tsim_frame_to_world
257 |
258 | Treal_frame_to_base = change_basis(Tsim_frame_to_base, _R_sim_to_real_franka.T, left=True, right=False)
259 | Treal_frame_to_world = Treal_frame_to_base.as_frames(Treal_frame_to_base.from_frame, 'world')
260 | return Treal_frame_to_world
261 |
262 |
263 | def angle_axis_between_quats(q0, q1):
264 | '''
265 | Finds dq s.t. dq * q1 = q0
266 | '''
267 | if quaternion.as_float_array(q1) @ quaternion.as_float_array(q0) < 0:
268 | q0 = -q0
269 | dq = q0 * q1.inverse()
270 | return quaternion.as_rotation_vector(dq)
271 |
272 |
273 | def compute_task_space_impedance_control(J, curr_transform, target_transform, x_vel, Ks, Ds):
274 | x_pos = vec3_to_np(curr_transform.p)
275 | x_quat = quaternion.from_float_array(quat_to_np(curr_transform.r, format='wxyz'))
276 |
277 | xd_pos = vec3_to_np(target_transform.p)
278 | xd_quat = quaternion.from_float_array(quat_to_np(target_transform.r, format='wxyz'))
279 |
280 | xe_pos = x_pos - xd_pos
281 | xe_ang_axis = angle_axis_between_quats(x_quat, xd_quat)
282 | xe = np.concatenate([xe_pos, xe_ang_axis])
283 |
284 | tau = J.T @ (-Ks @ xe - Ds @ x_vel)
285 | return tau
286 |
287 |
288 | def project_to_line(u, u0, u1):
289 | ''' Finds v, the projection of u onto the line crossing u0 and u1
290 | '''
291 |
292 | u10 = u1 - u0
293 | v = (u - u0) @ u10 / (u10 @ u10) * u10 + u0
294 | return v
295 |
--------------------------------------------------------------------------------
/isaacgym_utils/policy.py:
--------------------------------------------------------------------------------
1 | from abc import ABC, abstractmethod
2 | import numpy as np
3 |
4 | from isaacgym import gymapi
5 | from .math_utils import min_jerk, slerp_quat, vec3_to_np, np_to_vec3, \
6 | project_to_line, compute_task_space_impedance_control
7 |
8 |
9 | class Policy(ABC):
10 |
11 | def __init__(self):
12 | self._time_horizon = -1
13 |
14 | @abstractmethod
15 | def __call__(self, scene, env_idx, t_step, t_sim):
16 | pass
17 |
18 | def reset(self):
19 | pass
20 |
21 | @property
22 | def time_horizon(self):
23 | return self._time_horizon
24 |
25 |
26 | class RandomDeltaJointPolicy(Policy):
27 |
28 | def __init__(self, franka, name, *args, **kwargs):
29 | super().__init__(*args, **kwargs)
30 | self._franka = franka
31 | self._name = name
32 |
33 | def __call__(self, scene, env_idx, _, __):
34 | delta_joints = (np.random.random(self._franka.n_dofs) * 2 - 1) * ([0.05] * 7 + [0.005] * 2)
35 | self._franka.apply_delta_joint_targets(env_idx, self._name, delta_joints)
36 |
37 |
38 | class GraspBlockPolicy(Policy):
39 |
40 | def __init__(self, franka, franka_name, block, block_name, *args, **kwargs):
41 | super().__init__(*args, **kwargs)
42 | self._franka = franka
43 | self._franka_name = franka_name
44 | self._block = block
45 | self._block_name = block_name
46 |
47 | self._time_horizon = 1000
48 |
49 | self.reset()
50 |
51 | def reset(self):
52 | self._pre_grasp_transforms = []
53 | self._grasp_transforms = []
54 | self._init_ee_transforms = []
55 | self._ee_waypoint_policies = []
56 |
57 | def __call__(self, scene, env_idx, t_step, t_sim):
58 | ee_transform = self._franka.get_ee_transform(env_idx, self._franka_name)
59 |
60 | if t_step == 0:
61 | self._init_ee_transforms.append(ee_transform)
62 | self._ee_waypoint_policies.append(
63 | EEImpedanceWaypointPolicy(self._franka, self._franka_name, ee_transform, ee_transform, T=20)
64 | )
65 |
66 | if t_step == 20:
67 | block_transform = self._block.get_rb_transforms(env_idx, self._block_name)[0]
68 | grasp_transform = gymapi.Transform(p=block_transform.p, r=self._init_ee_transforms[env_idx].r)
69 | pre_grasp_transfrom = gymapi.Transform(p=grasp_transform.p + gymapi.Vec3(0, 0, 0.2), r=grasp_transform.r)
70 |
71 | self._grasp_transforms.append(grasp_transform)
72 | self._pre_grasp_transforms.append(pre_grasp_transfrom)
73 |
74 | self._ee_waypoint_policies[env_idx] = \
75 | EEImpedanceWaypointPolicy(
76 | self._franka, self._franka_name, ee_transform, self._pre_grasp_transforms[env_idx], T=180
77 | )
78 |
79 | if t_step == 200:
80 | self._ee_waypoint_policies[env_idx] = \
81 | EEImpedanceWaypointPolicy(
82 | self._franka, self._franka_name, self._pre_grasp_transforms[env_idx], self._grasp_transforms[env_idx], T=100
83 | )
84 |
85 | if t_step == 300:
86 | self._franka.close_grippers(env_idx, self._franka_name)
87 |
88 | if t_step == 400:
89 | self._ee_waypoint_policies[env_idx] = \
90 | EEImpedanceWaypointPolicy(
91 | self._franka, self._franka_name, self._grasp_transforms[env_idx], self._pre_grasp_transforms[env_idx], T=100
92 | )
93 |
94 | if t_step == 500:
95 | self._ee_waypoint_policies[env_idx] = \
96 | EEImpedanceWaypointPolicy(
97 | self._franka, self._franka_name, self._pre_grasp_transforms[env_idx], self._grasp_transforms[env_idx], T=100
98 | )
99 |
100 | if t_step == 600:
101 | self._franka.open_grippers(env_idx, self._franka_name)
102 |
103 | if t_step == 700:
104 | self._ee_waypoint_policies[env_idx] = \
105 | EEImpedanceWaypointPolicy(
106 | self._franka, self._franka_name, self._grasp_transforms[env_idx], self._pre_grasp_transforms[env_idx], T=100
107 | )
108 |
109 | if t_step == 800:
110 | self._ee_waypoint_policies[env_idx] = \
111 | EEImpedanceWaypointPolicy(
112 | self._franka, self._franka_name, self._pre_grasp_transforms[env_idx], self._init_ee_transforms[env_idx], T=100
113 | )
114 |
115 | self._ee_waypoint_policies[env_idx](scene, env_idx, t_step, t_sim)
116 |
117 |
118 | class GraspPointPolicy(Policy):
119 |
120 | def __init__(self, franka, franka_name, grasp_transform, *args, **kwargs):
121 | super().__init__(*args, **kwargs)
122 | self._franka = franka
123 | self._franka_name = franka_name
124 | self._grasp_transform = grasp_transform
125 |
126 | self._time_horizon = 710
127 |
128 | self.reset()
129 |
130 | def reset(self):
131 | self._pre_grasp_transforms = []
132 | self._grasp_transforms = []
133 | self._init_ee_transforms = []
134 |
135 | def __call__(self, scene, env_idx, t_step, _):
136 | t_step = t_step % self._time_horizon
137 |
138 | if t_step == 0:
139 | self._init_joints = self._franka.get_joints(env_idx, self._franka_name)
140 | self._init_rbs = self._franka.get_rb_states(env_idx, self._franka_name)
141 |
142 | if t_step == 20:
143 | ee_transform = self._franka.get_ee_transform(env_idx, self._franka_name)
144 | self._init_ee_transforms.append(ee_transform)
145 |
146 | pre_grasp_transfrom = gymapi.Transform(p=self._grasp_transform.p, r=self._grasp_transform.r)
147 | pre_grasp_transfrom.p.z += 0.2
148 |
149 | self._grasp_transforms.append(self._grasp_transform)
150 | self._pre_grasp_transforms.append(pre_grasp_transfrom)
151 |
152 | self._franka.set_ee_transform(env_idx, self._franka_name, self._pre_grasp_transforms[env_idx])
153 |
154 | if t_step == 100:
155 | self._franka.set_ee_transform(env_idx, self._franka_name, self._grasp_transforms[env_idx])
156 |
157 | if t_step == 150:
158 | self._franka.close_grippers(env_idx, self._franka_name)
159 |
160 | if t_step == 250:
161 | self._franka.set_ee_transform(env_idx, self._franka_name, self._pre_grasp_transforms[env_idx])
162 |
163 | if t_step == 350:
164 | self._franka.set_ee_transform(env_idx, self._franka_name, self._grasp_transforms[env_idx])
165 |
166 | if t_step == 500:
167 | self._franka.open_grippers(env_idx, self._franka_name)
168 |
169 | if t_step == 550:
170 | self._franka.set_ee_transform(env_idx, self._franka_name, self._pre_grasp_transforms[env_idx])
171 |
172 | if t_step == 600:
173 | self._franka.set_ee_transform(env_idx, self._franka_name, self._init_ee_transforms[env_idx])
174 |
175 | if t_step == 700:
176 | self._franka.set_joints(env_idx, self._franka_name, self._init_joints)
177 | self._franka.set_rb_states(env_idx, self._franka_name, self._init_rbs)
178 |
179 |
180 | class FrankaEEImpedanceController:
181 |
182 | def __init__(self, franka, franka_name):
183 | self._franka = franka
184 | self._franka_name = franka_name
185 | self._elbow_joint = 3
186 |
187 | Kp_0, Kr_0 = 200, 8
188 | Kp_1, Kr_1 = 200, 5
189 | self._Ks_0 = np.diag([Kp_0] * 3 + [Kr_0] * 3)
190 | self._Ds_0 = np.diag([4 * np.sqrt(Kp_0)] * 3 + [2 * np.sqrt(Kr_0)] * 3)
191 | self._Ks_1 = np.diag([Kp_1] * 3 + [Kr_1] * 3)
192 | self._Ds_1 = np.diag([4 * np.sqrt(Kp_1)] * 3 + [2 * np.sqrt(Kr_1)] * 3)
193 |
194 | def compute_tau(self, env_idx, target_transform):
195 | # primary task - ee control
196 | ee_transform = self._franka.get_ee_transform(env_idx, self._franka_name)
197 |
198 | J = self._franka.get_jacobian(env_idx, self._franka_name)
199 | q_dot = self._franka.get_joints_velocity(env_idx, self._franka_name)[:7]
200 | x_vel = J @ q_dot
201 |
202 | tau_0 = compute_task_space_impedance_control(J, ee_transform, target_transform, x_vel, self._Ks_0, self._Ds_0)
203 |
204 | # secondary task - elbow straight
205 | link_transforms = self._franka.get_links_transforms(env_idx, self._franka_name)
206 | elbow_transform = link_transforms[self._elbow_joint]
207 |
208 | u0 = vec3_to_np(link_transforms[0].p)[:2]
209 | u1 = vec3_to_np(link_transforms[-1].p)[:2]
210 | curr_elbow_xyz = vec3_to_np(elbow_transform.p)
211 | goal_elbow_xy = project_to_line(curr_elbow_xyz[:2], u0, u1)
212 | elbow_target_transform = gymapi.Transform(
213 | p=gymapi.Vec3(goal_elbow_xy[0], goal_elbow_xy[1], curr_elbow_xyz[2] + 0.2),
214 | r=elbow_transform.r
215 | )
216 |
217 | J_elb = self._franka.get_jacobian(env_idx, self._franka_name, target_joint=self._elbow_joint)
218 | x_vel_elb = J_elb @ q_dot
219 |
220 | tau_1 = compute_task_space_impedance_control(J_elb, elbow_transform, elbow_target_transform, x_vel_elb, self._Ks_1, self._Ds_1)
221 |
222 | # nullspace projection
223 | JT_inv = np.linalg.pinv(J.T)
224 | Null = np.eye(7) - J.T @ (JT_inv)
225 | tau = tau_0 + Null @ tau_1
226 |
227 | return tau
228 |
229 |
230 | class EEImpedanceWaypointPolicy(Policy):
231 |
232 | def __init__(self, franka, franka_name, init_ee_transform, goal_ee_transform, T=300):
233 | self._franka = franka
234 | self._franka_name = franka_name
235 |
236 | self._T = T
237 | self._ee_impedance_ctrlr = FrankaEEImpedanceController(franka, franka_name)
238 |
239 | init_ee_pos = vec3_to_np(init_ee_transform.p)
240 | goal_ee_pos = vec3_to_np(goal_ee_transform.p)
241 | self._traj = [
242 | gymapi.Transform(
243 | p=np_to_vec3(min_jerk(init_ee_pos, goal_ee_pos, t, self._T)),
244 | r=slerp_quat(init_ee_transform.r, goal_ee_transform.r, t, self._T),
245 | )
246 | for t in range(self._T)
247 | ]
248 |
249 | @property
250 | def horizon(self):
251 | return self._T
252 |
253 | def __call__(self, scene, env_idx, t_step, t_sim):
254 | target_transform = self._traj[min(t_step, self._T - 1)]
255 | tau = self._ee_impedance_ctrlr.compute_tau(env_idx, target_transform)
256 | self._franka.apply_torque(env_idx, self._franka_name, tau)
257 |
--------------------------------------------------------------------------------
/isaacgym_utils/rl/__init__.py:
--------------------------------------------------------------------------------
1 | from .vec_env import GymVecEnv
2 | from .franka_vec_env import GymFrankaVecEnv, GymFrankaBlockVecEnv
3 | from .stable_baselines import StableBaselinesVecEnvAdapter
4 |
--------------------------------------------------------------------------------
/isaacgym_utils/rl/franka_vec_env.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import quaternion
3 |
4 | from isaacgym import gymapi
5 | from isaacgym_utils.assets import GymFranka, GymBoxAsset, GymURDFAsset
6 | from isaacgym_utils.math_utils import np_to_vec3, rpy_to_quat, transform_to_np
7 | from isaacgym_utils.ctrl_utils import ForcePositionController, MovingMedianFilter
8 |
9 | from gym.spaces import Box
10 |
11 | from .vec_env import GymVecEnv
12 |
13 |
14 | class GymFrankaVecEnv(GymVecEnv):
15 |
16 | _ACTUATION_MODE_MAP = {
17 | 'vic': 'attractors',
18 | 'hfpc': 'torques',
19 | 'hfpc_cartesian_gains': 'torques',
20 | 'joints': 'joints'
21 | }
22 |
23 | def _setup_single_env_gen(self, cfg):
24 | self._table = GymBoxAsset(self._scene, **cfg['table']['dims'],
25 | shape_props=cfg['table']['shape_props'],
26 | asset_options=cfg['table']['asset_options']
27 | )
28 | self._actuation_mode = self._ACTUATION_MODE_MAP[cfg['franka']['action']['mode']]
29 | franka = GymFranka(cfg['franka'], self._scene, actuation_mode=self._actuation_mode)
30 | self._frankas = [franka] * self.n_envs
31 |
32 | table_transform = gymapi.Transform(p=gymapi.Vec3(cfg['table']['dims']['sx']/3, 0, cfg['table']['dims']['sz']/2))
33 | self._franka_transform = gymapi.Transform(p=gymapi.Vec3(0, 0, cfg['table']['dims']['sz'] + 0.01))
34 |
35 | self._franka_name = 'franka'
36 | self._table_name = 'table'
37 |
38 | def setup(scene, _):
39 | scene.add_asset(self._table_name, self._table, table_transform)
40 | scene.add_asset(self._franka_name, franka, self._franka_transform, collision_filter=1) # avoid self-collisions
41 | return setup
42 |
43 | def _init_action_space(self, cfg):
44 | action_cfg = cfg['franka']['action'][cfg['franka']['action']['mode']]
45 | self._action_mode = cfg['franka']['action']['mode']
46 |
47 | if self._action_mode == 'vic':
48 | limits_low = np.array(
49 | [-action_cfg['max_tra_delta']] * 3 + \
50 | [-np.deg2rad(action_cfg['max_rot_delta'])] * 3 + \
51 | [action_cfg['min_stiffness']])
52 | limits_high = np.array(
53 | [action_cfg['max_tra_delta']] * 3 + \
54 | [np.deg2rad(action_cfg['max_rot_delta'])] * 3 + \
55 | [action_cfg['max_stiffness']])
56 |
57 | self._init_ee_transforms = [
58 | self._frankas[env_idx].get_desired_ee_transform(env_idx, self._franka_name)
59 | for env_idx in range(self.n_envs)
60 | ]
61 | elif self._action_mode == 'hfpc':
62 | self._force_filter = MovingMedianFilter(6, 3)
63 | self._fp_ctrlr = ForcePositionController(
64 | np.zeros(6), np.zeros(6), np.ones(6), 7)
65 | limits_low = np.array(
66 | [-action_cfg['max_tra_delta']] * 3 + \
67 | [-np.deg2rad(action_cfg['max_rot_delta'])] * 3 + \
68 | [-np.deg2rad(action_cfg['max_force_delta'])] * 3 + \
69 | [0] * 3 + \
70 | [action_cfg['min_pos_kp'], action_cfg['min_force_kp']])
71 | limits_high = np.array(
72 | [action_cfg['max_tra_delta']] * 3 + \
73 | [np.deg2rad(action_cfg['max_rot_delta'])] * 3 + \
74 | [np.deg2rad(action_cfg['max_force_delta'])] * 3 + \
75 | [1] * 3 + \
76 | [action_cfg['max_pos_kp'], action_cfg['max_force_kp']])
77 | elif self._action_mode == 'hfpc_cartesian_gains':
78 | self._force_filter = MovingMedianFilter(6, 3)
79 | self._fp_ctrlr = ForcePositionController(
80 | np.zeros(6), np.zeros(6), np.ones(6), 7,
81 | use_joint_gains_for_position_ctrl=False,
82 | use_joint_gains_for_force_ctrl=False
83 | )
84 |
85 | limits_low = np.array(
86 | [-action_cfg['max_tra_delta']] * 3 + \
87 | [-np.deg2rad(action_cfg['max_rot_delta'])] * 3 + \
88 | [-np.deg2rad(action_cfg['max_force_delta'])] * 3 + \
89 | [0] * 3 + \
90 | [action_cfg['min_pos_kp'], action_cfg['min_force_kp']])
91 | limits_high = np.array(
92 | [action_cfg['max_tra_delta']] * 3 + \
93 | [np.deg2rad(action_cfg['max_rot_delta'])] * 3 + \
94 | [np.deg2rad(action_cfg['max_force_delta'])] * 3 + \
95 | [1] * 3 + \
96 | [action_cfg['max_pos_kp'], action_cfg['max_force_kp']])
97 |
98 | elif self._action_mode == 'joints':
99 | max_rot_delta = np.deg2rad(action_cfg['max_rot_delta'])
100 | limits_high = np.array([max_rot_delta] * 7)
101 | limits_low = -limits_high
102 | else:
103 | raise ValueError('Unknown action mode!')
104 |
105 | # gripper action
106 | limits_low = np.concatenate([limits_low, [0]])
107 | limits_high = np.concatenate([limits_high, [1]])
108 |
109 | action_space = Box(limits_low, limits_high, dtype=np.float32)
110 | return action_space
111 |
112 | def _init_obs_space(self, cfg):
113 | '''
114 | Observations contains:
115 |
116 | joint angles - 7
117 | gripper width (0 to 0.08) - 1
118 | ee position - 3
119 | ee quat - 4
120 | ee contact forces - 3
121 | '''
122 | limits_low = np.array(
123 | self._frankas[0].joint_limits_lower.tolist()[:-2] + \
124 | [0] + \
125 | [-10] * 3 + \
126 | [-1] * 4 + \
127 | [-1e-5] * 3
128 | )
129 | limits_high = np.array(
130 | self._frankas[0].joint_limits_upper.tolist()[:-2] + \
131 | [0.08] + \
132 | [10] * 3 + \
133 | [1] * 4 + \
134 | [1e-5] * 3
135 | )
136 | obs_space = Box(limits_low, limits_high, dtype=np.float32)
137 | return obs_space
138 |
139 | def _apply_actions(self, all_actions):
140 | for env_idx in self._scene.env_idxs:
141 | action = all_actions[env_idx]
142 | arm_action = action[:-1]
143 |
144 | if self._action_mode == 'vic':
145 | delta_tra = arm_action[:3]
146 | delta_rpy = arm_action[3:6]
147 | stiffness = arm_action[6]
148 |
149 | self._frankas[env_idx].set_attractor_props(env_idx, self._franka_name,
150 | {
151 | 'stiffness': stiffness,
152 | 'damping': 2 * np.sqrt(stiffness)
153 | })
154 |
155 | delta_transform = gymapi.Transform(
156 | p=np_to_vec3(delta_tra),
157 | r=rpy_to_quat(delta_rpy),
158 | )
159 | self._frankas[env_idx].set_delta_ee_transform(env_idx, self._franka_name, delta_transform)
160 | elif self._action_mode == 'hfpc' or self._action_mode == 'hfpc_cartesian_gains':
161 | xa_tf = self._frankas[env_idx].get_ee_transform(env_idx, self._franka_name)
162 | xa = transform_to_np(xa_tf, format='wxyz')
163 |
164 | fa = -np.concatenate([self._frankas[env_idx].get_ee_ct_forces(env_idx, self._franka_name),
165 | [0,0,0]], axis=0)
166 | fa = self._force_filter.step(fa)
167 | J = self._frankas[env_idx].get_jacobian(env_idx, self._franka_name)
168 |
169 | # The last two points are finger joints.
170 | qdot = self._frankas[env_idx].get_joints_velocity(env_idx, self._franka_name)[:7]
171 | xdot = np.matmul(J, qdot)
172 |
173 | xd_position = xa[:3] + arm_action[:3]
174 | xd_orient_rpy = arm_action[3:6]
175 | xd_orient_quat = quaternion.from_euler_angles(xd_orient_rpy)
176 | xd_orient = quaternion.as_float_array(xd_orient_quat)
177 | xd = np.concatenate([xd_position, xd_orient])
178 |
179 | fd = np.concatenate([fa[:3] + arm_action[6:9], [0, 0, 0]])
180 | S = np.concatenate([arm_action[9:12], [1, 1, 1]])
181 |
182 | pos_kp, force_kp = arm_action[12:14]
183 | pos_kd = 2 * np.sqrt(pos_kp)
184 | force_ki = 0.01 * force_kp
185 | self._fp_ctrlr.set_ctrls(force_kp, force_ki, pos_kp, pos_kd)
186 | self._fp_ctrlr.set_targets(xd=xd, fd=fd, S=S)
187 |
188 | tau = self._fp_ctrlr.step(xa, xdot, fa, J, qdot)
189 | self._frankas[env_idx].apply_torque(env_idx, self._franka_name, tau)
190 | elif self._action_mode == 'joints':
191 | delta_joints = np.concatenate([arm_action, [0, 0]]) # add dummy gripper joint cmds
192 | self._frankas[env_idx].apply_delta_joint_targets(env_idx, self._franka_name, delta_joints)
193 | else:
194 | raise ValueError(f"Invalid action mode: {self._action_mode}")
195 |
196 | gripper_action = action[-1]
197 | gripper_width = np.clip(gripper_action, 0, 0.04)
198 | self._frankas[env_idx].set_gripper_width_target(env_idx, self._franka_name, gripper_width)
199 |
200 | def _compute_obs(self, all_actions):
201 | all_obs = np.zeros((self.n_envs, 18))
202 |
203 | for env_idx in self._scene.env_idxs:
204 | all_joints = self._frankas[env_idx].get_joints(env_idx, self._franka_name)
205 | ee_transform = self._frankas[env_idx].get_ee_transform(env_idx, self._franka_name)
206 | ee_ct_forces = self._frankas[env_idx].get_ee_ct_forces(env_idx, self._franka_name)
207 |
208 | all_obs[env_idx, :7] = all_joints[:7]
209 | all_obs[env_idx, 7] = all_joints[-1] * 2 # gripper width is 2 * each gripper's prismatic length
210 | all_obs[env_idx, 8:15] = transform_to_np(ee_transform, format='wxyz')
211 | all_obs[env_idx, 15:18] = ee_ct_forces
212 |
213 | return all_obs
214 |
215 | def _compute_rews(self, all_obs, all_actions):
216 | return np.zeros(self.n_envs)
217 |
218 | def _compute_dones(self, all_obs, all_actions, all_rews):
219 | return np.zeros(self.n_envs)
220 |
221 | def _reset(self, env_idxs):
222 | if not self._has_first_reset:
223 | self._init_joints = []
224 | for env_idx in env_idxs:
225 | self._init_joints.append(self._frankas[env_idx].get_joints(env_idx, self._franka_name))
226 |
227 | for env_idx in env_idxs:
228 | self._frankas[env_idx].set_joints(env_idx, self._franka_name, self._init_joints[env_idx])
229 | self._frankas[env_idx].set_joints_targets(env_idx, self._franka_name, self._init_joints[env_idx])
230 |
231 | if self._action_mode == 'joints':
232 | if 'randomize_joints' in self._cfg['franka'] and self._cfg['franka']['randomize_joints']:
233 | init_random_joints = np.clip(np.random.normal(self._init_joints[env_idx], \
234 | (self._frankas[env_idx].joint_limits_upper - self._frankas[env_idx].joint_limits_lower)/10), self._frankas[env_idx].joint_limits_lower, \
235 | self._frankas[env_idx].joint_limits_upper)
236 | self._frankas[env_idx].set_joints(env_idx, self._franka_name, init_random_joints)
237 | self._frankas[env_idx].set_joints_targets(env_idx, self._franka_name, init_random_joints)
238 |
239 | if self._action_mode == 'vic':
240 | self._frankas[env_idx].set_ee_transform(
241 | env_idx, self._franka_name, self._init_ee_transforms[env_idx]
242 | )
243 |
244 |
245 | class GymFrankaBlockVecEnv(GymFrankaVecEnv):
246 |
247 | def _setup_single_env_gen(self, cfg):
248 | parent_setup = super()._setup_single_env_gen(cfg)
249 | self._block = GymBoxAsset(self._scene, **cfg['block']['dims'],
250 | shape_props=cfg['block']['shape_props'],
251 | rb_props=cfg['block']['rb_props'],
252 | asset_options=cfg['block']['asset_options']
253 | )
254 | self._banana = GymURDFAsset(
255 | cfg['banana']['urdf_path'],
256 | self._scene,
257 | shape_props=cfg['banana']['shape_props'],
258 | rb_props=cfg['banana']['rb_props'],
259 | asset_options=cfg['banana']['asset_options']
260 | )
261 | self._block_name = 'block'
262 | self._banana_name = 'banana0'
263 |
264 | def setup(scene, env_idx):
265 | parent_setup(scene, env_idx)
266 | scene.add_asset(self._block_name, self._block, gymapi.Transform())
267 | scene.add_asset(self._banana_name, self._banana, gymapi.Transform())
268 | return setup
269 |
270 | def _reset(self, env_idxs):
271 | super()._reset(env_idxs)
272 | for env_idx in env_idxs:
273 | block_pose = gymapi.Transform(
274 | p=gymapi.Vec3(
275 | (np.random.rand() * 2 - 1) * 0.1 + 0.5,
276 | np.random.rand() * 0.2,
277 | self._cfg['table']['dims']['sz'] + self._cfg['block']['dims']['sz'] / 2 + 0.05
278 | ))
279 |
280 | banana_pose = gymapi.Transform(
281 | p=gymapi.Vec3(
282 | (np.random.rand() * 2 - 1) * 0.1 + 0.5,
283 | -np.random.rand() * 0.2,
284 | self._cfg['table']['dims']['sz'] + 0.05
285 | ),
286 | r=rpy_to_quat([np.pi/2, np.pi/2, -np.pi/2])
287 | )
288 |
289 | self._block.set_rb_transforms(env_idx, self._block_name, [block_pose])
290 | self._banana.set_rb_transforms(env_idx, self._banana_name, [banana_pose])
291 |
292 | def _init_obs_space(self, cfg):
293 | obs_space = super()._init_obs_space(cfg)
294 |
295 | # add pose of block to obs_space
296 | limits_low = np.concatenate([
297 | obs_space.low,
298 | [-10] * 3 + [-1] * 4
299 | ])
300 | limits_high = np.concatenate([
301 | obs_space.high,
302 | [10] * 3 + [1] * 4
303 | ])
304 | new_obs_space = Box(limits_low, limits_high, dtype=np.float32)
305 |
306 | return new_obs_space
307 |
308 | def _compute_obs(self, all_actions):
309 | all_obs = super()._compute_obs(all_actions)
310 |
311 | box_pose_obs = np.zeros((self.n_envs, 7))
312 |
313 | for env_idx in self._scene.env_idxs:
314 | block_transform = self._block.get_rb_transforms(env_idx, self._block_name)[0]
315 | box_pose_obs[env_idx, :] = transform_to_np(block_transform, format='wxyz')
316 |
317 | all_obs = np.c_[all_obs, box_pose_obs]
318 | return all_obs
319 |
--------------------------------------------------------------------------------
/isaacgym_utils/rl/stable_baselines.py:
--------------------------------------------------------------------------------
1 | '''
2 | To make vec_env.GymVecEnv compatible with stable_baselines
3 | '''
4 |
5 | from stable_baselines3.common.vec_env import VecEnv
6 | from .franka_vec_env import GymFrankaBlockVecEnv
7 |
8 |
9 | class StableBaselinesVecEnvAdapter(VecEnv):
10 |
11 | def step_async(self, actions):
12 | pass
13 |
14 | def step_wait(self):
15 | pass
16 |
17 | def get_attr(self, attr_name, indices=None):
18 | pass
19 |
20 | def set_attr(self, attr_name, value, indices=None):
21 | pass
22 |
23 | def env_method(self, method_name, *method_args, indices=None, **method_kwargs):
24 | pass
25 |
26 | def seed(self, seed):
27 | pass
28 |
29 | def env_is_wrapped(self, wrapper_class, indices=None):
30 | if indices is None:
31 | n = self.num_envs
32 | else:
33 | n = len(indices)
34 | return [False] * n
35 |
36 |
37 | class GymFrankaBlockVecEnvStableBaselines(GymFrankaBlockVecEnv, StableBaselinesVecEnvAdapter):
38 | '''
39 | An example of how to convert a GymVecEnv to a StableBaselines-compatible VecEnv
40 | '''
41 |
42 | def __init__(self, *args, **kwargs):
43 | GymFrankaBlockVecEnv.__init__(self, *args, **kwargs)
44 |
--------------------------------------------------------------------------------
/isaacgym_utils/rl/vec_env.py:
--------------------------------------------------------------------------------
1 | from abc import ABC, abstractmethod
2 | import numpy as np
3 | from isaacgym_utils.scene import GymScene
4 |
5 |
6 | class GymVecEnv(ABC):
7 |
8 | def __init__(self, cfg, auto_reset_after_done=True, n_inter_steps=1, inter_step_cb=None):
9 | self._cfg = cfg
10 | self._scene = GymScene(cfg['scene'])
11 |
12 | setup = self._setup_single_env_gen(cfg)
13 | self._scene.setup_all_envs(setup)
14 | self._action_space = self._init_action_space(cfg)
15 | self._obs_space = self._init_obs_space(cfg)
16 | self._init_rews(cfg)
17 |
18 | self._scene.step() # needed for physics to initialize correctly
19 | self._has_first_reset = False
20 |
21 | self._step_counts = np.zeros(self.n_envs)
22 | # Used for logging/debugging
23 | self._episode_rewards = np.zeros(self.n_envs)
24 |
25 | self._auto_reset_after_done = auto_reset_after_done
26 | self._n_inter_steps = n_inter_steps
27 | self._inter_step_cb = inter_step_cb
28 |
29 | @property
30 | def n_envs(self):
31 | return self._scene.n_envs
32 |
33 | @property
34 | def num_envs(self):
35 | return self.n_envs
36 |
37 | @property
38 | def action_space(self):
39 | return self._action_space
40 |
41 | @property
42 | def obs_space(self):
43 | return self._obs_space
44 |
45 | @property
46 | def observation_space(self):
47 | return self.obs_space
48 |
49 | @property
50 | def step_counts(self):
51 | return self._step_counts.copy()
52 |
53 | @property
54 | def episode_rewards(self):
55 | return self._episode_rewards.copy()
56 |
57 | @property
58 | def auto_reset_after_done(self):
59 | return self._auto_reset_after_done
60 |
61 | @auto_reset_after_done.setter
62 | def auto_reset_after_done(self, auto_reset_after_done):
63 | self._auto_reset_after_done = auto_reset_after_done
64 |
65 | @property
66 | def n_inter_steps(self):
67 | return self._n_inter_steps
68 |
69 | @abstractmethod
70 | def _setup_single_env_gen(self, cfg):
71 | pass
72 |
73 | @abstractmethod
74 | def _init_action_space(self, cfg):
75 | pass
76 |
77 | @abstractmethod
78 | def _init_obs_space(self, cfg):
79 | pass
80 |
81 | def _init_rews(self, cfg):
82 | pass
83 |
84 | @abstractmethod
85 | def _apply_actions(self, all_actions):
86 | pass
87 |
88 | def _apply_inter_actions(self, all_actions, t_inter_step, n_inter_steps):
89 | pass
90 |
91 | def _inter_step_terminate(self, all_actions, t_inter_step, n_inter_steps):
92 | return False
93 |
94 | @abstractmethod
95 | def _compute_obs(self, all_actions, is_reset=False):
96 | pass
97 |
98 | @abstractmethod
99 | def _compute_rews(self, all_obs, all_actions):
100 | pass
101 |
102 | @abstractmethod
103 | def _compute_dones(self, all_obs, all_actions, all_rews):
104 | pass
105 |
106 | def _compute_infos(self, all_obs, all_actions, all_rews, all_dones):
107 | return [{} for _ in range(self.n_envs)]
108 |
109 | @abstractmethod
110 | def _reset(self, env_idxs):
111 | pass
112 |
113 | def reset(self, env_idxs=None):
114 | if not self._has_first_reset or env_idxs is None:
115 | env_idxs = list(range(self.n_envs))
116 |
117 | if len(env_idxs) > 0:
118 | self._reset(env_idxs)
119 | self._has_first_reset = True
120 |
121 | self._step_counts[env_idxs] = 0
122 | self._episode_rewards[env_idxs] = 0
123 | all_obs = self._compute_obs(None)
124 |
125 | return all_obs
126 |
127 | def step(self, all_actions, n_inter_steps=None, inter_step_cb=None):
128 | self._apply_actions(all_actions)
129 |
130 | if n_inter_steps is None:
131 | n_inter_steps = self.n_inter_steps
132 | for t_inter_step in range(n_inter_steps):
133 | self._apply_inter_actions(all_actions, t_inter_step, n_inter_steps)
134 | self._scene.step()
135 | self._scene.render()
136 | self._scene.render_cameras()
137 |
138 | if inter_step_cb is None:
139 | inter_step_cb = self._inter_step_cb
140 | if inter_step_cb is not None:
141 | inter_step_cb(self, t_inter_step, n_inter_steps)
142 |
143 | terminate = self._inter_step_terminate(all_actions, t_inter_step, n_inter_steps)
144 | if terminate:
145 | break
146 |
147 | all_obs = self._compute_obs(all_actions)
148 | all_rews = self._compute_rews(all_obs, all_actions)
149 | all_dones = self._compute_dones(all_obs, all_actions, all_rews)
150 | all_infos = self._compute_infos(all_obs, all_actions, all_rews, all_dones)
151 |
152 | self._step_counts += 1
153 | self._episode_rewards += all_rews
154 |
155 | if self._auto_reset_after_done:
156 | done_env_idx = np.where(all_dones)[0]
157 | if len(done_env_idx) > 0:
158 | new_obs = self.reset(done_env_idx)
159 | for env_idx in done_env_idx:
160 | all_infos[env_idx]['terminal_observation'] = all_obs[env_idx]
161 |
162 | all_obs = new_obs
163 |
164 | return all_obs, all_rews, all_dones, all_infos
165 |
166 | def render(self, custom_draws=None):
167 | self._scene.render(custom_draws=custom_draws)
168 |
169 | def close(self):
170 | self._scene.close()
171 |
--------------------------------------------------------------------------------
/scripts/mesh_to_urdf.py:
--------------------------------------------------------------------------------
1 | import os
2 | import argparse
3 | import logging
4 |
5 | from shutil import copyfile
6 |
7 |
8 | def copy_to_output(src_filename, output_dir):
9 | copyfile(src_filename, os.path.join(output_dir, os.path.basename(src_filename)))
10 |
11 |
12 | if __name__ == "__main__":
13 | logging.getLogger().setLevel(logging.INFO)
14 | parser = argparse.ArgumentParser()
15 | parser.add_argument('--urdf_template_path', '-ut', type=str, default='assets/single_obj_urdf_template.urdf')
16 | parser.add_argument('--data_root', '-d', type=str, default='assets')
17 | parser.add_argument('--scale', '-s', type=float, default=1.)
18 | parser.add_argument('--mesh_path', '-m', type=str, required=True)
19 | parser.add_argument('--col_mesh_path', '-cm', type=str, default='')
20 | parser.add_argument('--urdf_name', '-u', type=str, required=True)
21 | parser.add_argument('--visual_origin', '-vo', type=list, default=[0., 0., 0.])
22 | parser.add_argument('--collision_origin', '-co', type=list, default=[0., 0., 0.])
23 | parser.add_argument('--mass', '-ma', type=float, default=1.)
24 | parser.add_argument('--ixx', '-ixx', type=float, default=1e-4)
25 | parser.add_argument('--iyy', '-iyy', type=float, default=1e-4)
26 | parser.add_argument('--izz', '-izz', type=float, default=1e-4)
27 | parser.add_argument('--ixy', '-ixy', type=float, default=0.)
28 | parser.add_argument('--iyz', '-iyz', type=float, default=0.)
29 | parser.add_argument('--ixz', '-ixz', type=float, default=0.)
30 | args = parser.parse_args()
31 |
32 | supported_formats = ['obj']
33 | mesh_format = os.path.basename(args.mesh_path).split('.')[-1]
34 | col_mesh_format = os.path.basename(args.col_mesh_path).split('.')[-1] if args.col_mesh_path else mesh_format
35 | if mesh_format not in supported_formats or col_mesh_format not in supported_formats:
36 | raise ValueError('Mesh format not supported! Only support {}'.format(supported_formats))
37 |
38 | target_path = os.path.join(args.data_root, args.urdf_name)
39 | if os.path.isdir(target_path):
40 | raise ValueError('URDF already exists in data folder!')
41 | os.makedirs(target_path)
42 |
43 | logging.info('Copying mesh')
44 | visual_mesh_target_path_rel = os.path.join(args.urdf_name, '{}_visual.{}'.format(args.urdf_name, mesh_format))
45 | visual_mesh_target_path = os.path.join(args.data_root, visual_mesh_target_path_rel)
46 | collision_mesh_target_path_rel = os.path.join(args.urdf_name, '{}_collision.{}'.format(args.urdf_name, mesh_format))
47 | collision_mesh_target_path = os.path.join(args.data_root, collision_mesh_target_path_rel)
48 |
49 | copyfile(args.mesh_path, visual_mesh_target_path)
50 | if args.col_mesh_path:
51 | copyfile(args.col_mesh_path, collision_mesh_target_path)
52 |
53 | logging.info('Writing URDF')
54 | with open(args.urdf_template_path, 'r') as f:
55 | urdf_template = f.read()
56 |
57 | urdf = urdf_template.replace('$name$', args.urdf_name) \
58 | .replace('$visual_origin_xyz$', ' '.join(map(str, args.visual_origin))) \
59 | .replace('$visual_geometry_path$', visual_mesh_target_path_rel) \
60 | .replace('$collision_origin_xyz$', ' '.join(map(str, args.collision_origin))) \
61 | .replace('$collision_geometry_path$', collision_mesh_target_path_rel if args.col_mesh_path else visual_mesh_target_path_rel) \
62 | .replace('$mass$', str(args.mass)) \
63 | .replace('$ixx$', str(args.ixx)) \
64 | .replace('$iyy$', str(args.iyy)) \
65 | .replace('$izz$', str(args.izz)) \
66 | .replace('$ixy$', str(args.ixy)) \
67 | .replace('$iyz$', str(args.iyz)) \
68 | .replace('$ixz$', str(args.ixz)) \
69 | .replace('$scale$', ' '.join([str(args.scale)]*3))
70 |
71 | with open(os.path.join(target_path, '{}.urdf'.format(args.urdf_name)), 'w') as f:
72 | f.write(urdf)
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | '''Setup script for isaacgym_utils'''
2 |
3 | from setuptools import setup
4 |
5 | # Optional dependency groups.
6 | extras = {
7 | 'ray': ['ray'],
8 | 'rl': ['stable_baselines3', 'gym'],
9 | }
10 |
11 | extras['all'] = list(
12 | set([item for group in extras.values() for item in group])
13 | )
14 |
15 | requirements = [
16 | 'autolab_core>=1.1.0',
17 | 'visualization',
18 | 'numba',
19 | 'triangle',
20 | 'numpy-quaternion'
21 | ]
22 |
23 | setup(name='isaacgym_utils',
24 | version='0.1.0',
25 | author='Jacky Liang',
26 | author_email='jackyliang@cmu.edu',
27 | package_dir = {'': '.'},
28 | packages=['isaacgym_utils'],
29 | install_requires=requirements,
30 | extras_require=extras,
31 | )
32 |
--------------------------------------------------------------------------------