-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from dfki-ric/development
Add mujoco environments
- Loading branch information
Showing
56 changed files
with
2,827 additions
and
1,514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ logs | |
*.mp4 | ||
*.json | ||
.coverage | ||
*MUJOCO_LOG.TXT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
[![Tests](https://github.com/dfki-ric/deformable_gym/actions/workflows/test.yaml/badge.svg)](https://github.com/dfki-ric/deformable_gym/actions/workflows/test.yaml) | ||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) | ||
|
||
# DeformableGym | ||
|
||
This repository contains a collection of [gymnasium](https://github.com/Farama-Foundation/Gymnasium) environments built with [PyBullet](https://pybullet.org/) and [MuJoCo](https://github.com/google-deepmind/mujoco). | ||
This repository contains a collection of [gymnasium](https://github.com/Farama-Foundation/Gymnasium) environments built with [PyBullet](https://pybullet.org/) and [MuJoCo](https://github.com/google-deepmind/mujoco). | ||
In these environments, the agent needs to learn to grasp deformable 3D objects such as shoe insoles or pillows from sparse reward signals. | ||
|
||
<p align="center"> | ||
<img src="doc/source/_static/defgym.svg"/> | ||
</p> | ||
|
||
|
||
## Installation | ||
## Installation | ||
|
||
```bash | ||
git clone [email protected]:dfki-ric/deformable_gym.git | ||
|
@@ -25,19 +25,16 @@ pip install -e . | |
|
||
## Available environments | ||
|
||
| Environment Name | PyBullet | MuJoCo | | ||
|---------------------------|:-------------------:|:------------------:| | ||
| FloatingMiaGraspInsole | :heavy_check_mark: | :heavy_check_mark: | | ||
| FloatingShadowGraspInsole | :heavy_check_mark: | :heavy_check_mark: | | ||
| FloatingMiaGraspPillow | :heavy_check_mark: | :x: | | ||
| FloatingShadowGraspPillow | :heavy_check_mark: | :x: | | ||
| URMiaGraspInsole | :heavy_check_mark: | :x: | | ||
| URShadowGraspInsole | :heavy_check_mark: | :x: | | ||
| URMiaGraspPillow | :heavy_check_mark: | :x: | | ||
| URShadowGraspPillow | :heavy_check_mark: | :x: | | ||
|
||
|
||
|
||
| Environment Name | PyBullet | MuJoCo | | ||
| ------------------------- | :----------------: | :----------------: | | ||
| FloatingMiaGraspInsole | :heavy_check_mark: | :heavy_check_mark: | | ||
| FloatingShadowGraspInsole | :heavy_check_mark: | :heavy_check_mark: | | ||
| FloatingMiaGraspPillow | :heavy_check_mark: | :heavy_check_mark: | | ||
| FloatingShadowGraspPillow | :heavy_check_mark: | :heavy_check_mark: | | ||
| URMiaGraspInsole | :heavy_check_mark: | :heavy_check_mark: | | ||
| URShadowGraspInsole | :heavy_check_mark: | :heavy_check_mark: | | ||
| URMiaGraspPillow | :heavy_check_mark: | :heavy_check_mark: | | ||
| URShadowGraspPillow | :heavy_check_mark: | :heavy_check_mark: | | ||
|
||
### Known Issues | ||
|
||
|
@@ -49,7 +46,17 @@ libGL error: failed to load driver: iris | |
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) | ||
libGL error: failed to load driver: swrast | ||
``` | ||
|
||
``` | ||
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) | ||
libGL error: failed to load driver: iris | ||
libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) | ||
libGL error: failed to load driver: iris | ||
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri) | ||
libGL error: failed to load driver: swrast | ||
/home/kaixing/miniconda3/envs/test/lib/python3.10/site-packages/glfw/__init__.py:914: GLFWError: (65543) b'GLX: Failed to create context: BadValue (integer parameter out of range for operation)' | ||
warnings.warn(message, GLFWError) | ||
ERROR: could not create window | ||
``` | ||
In this case, install the following dependency via conda-forge: | ||
|
||
```bash | ||
|
@@ -72,8 +79,8 @@ import gymnasium | |
Floating Mia Example | ||
========= | ||
This is an example of how to use the FloatingMiaGraspEnv. A random policy is then | ||
used to generate ten episodes. | ||
This is an example of how to use the FloatingMiaGraspEnv. A random policy is then | ||
used to generate ten episodes. | ||
""" | ||
|
||
|
@@ -93,19 +100,20 @@ while num_episodes <= 10: | |
if terminated or truncated: | ||
print(f"Episode finished with return {episode_return}!") | ||
num_episodes += 1 | ||
|
||
env.reset() | ||
|
||
``` | ||
|
||
|
||
## Documentation | ||
|
||
The documentation can be found in the directory doc. To build the documentation, run e.g. (on linux): | ||
|
||
```bash | ||
cd doc | ||
make html | ||
``` | ||
|
||
The HTML documentation is now located at doc/build/html/index.html. You need the following packages to build the documentation: | ||
|
||
```bash | ||
|
@@ -114,14 +122,15 @@ pip install numpydoc sphinx sphinx-gallery sphinx-bootstrap-theme | |
|
||
## Contributing | ||
|
||
If you wish to report bugs, please use the [issue tracker](https://github.com/dfki-ric/deformable_gym/issues). If you would like to contribute to DeformableGym, just open an issue or a | ||
[pull request](https://github.com/dfki-ric/deformable_gym/pulls). The target branch for | ||
merge requests is the development branch. The development branch will be merged to main for new releases. If you have | ||
If you wish to report bugs, please use the [issue tracker](https://github.com/dfki-ric/deformable_gym/issues). If you would like to contribute to DeformableGym, just open an issue or a | ||
[pull request](https://github.com/dfki-ric/deformable_gym/pulls). The target branch for | ||
merge requests is the development branch. The development branch will be merged to main for new releases. If you have | ||
questions about the software, you should ask them in the discussion section. | ||
|
||
The recommended workflow to add a new feature, add documentation, or fix a bug is the following: | ||
|
||
- Push your changes to a branch (e.g. feature/x, doc/y, or fix/z) of your fork of the deformable_gym repository. | ||
- Open a pull request to the latest development branch. There is usually an open merge request from the latest development branch to the main branch. | ||
- Open a pull request to the latest development branch. There is usually an open merge request from the latest development branch to the main branch. | ||
- When the latest development branch is merged to the main branch, a new release will be made. | ||
|
||
Note that there is a checklist for new features. | ||
|
@@ -143,8 +152,6 @@ url = {https://deformable-workshop.github.io/icra2023/}, | |
} | ||
``` | ||
|
||
|
||
|
||
## Releases | ||
|
||
### Semantic Versioning | ||
|
@@ -155,22 +162,16 @@ version will be incremented when new functionality is added in a backwards | |
compatible manner, and the patch version is incremented for bugfixes, | ||
documentation, etc. | ||
|
||
|
||
## Funding | ||
|
||
This library has been developed initially at the | ||
[Robotics Innovation Center](http://robotik.dfki-bremen.de/en/startpage.html) of the | ||
[German Research Center for Artificial Intelligence (DFKI)](http://www.dfki.de) in Bremen together with the | ||
[Robotics Group](https://robotik.dfki-bremen.de/en/about-us/university-of-bremen-robotics-group.html) of the | ||
[Robotics Innovation Center](http://robotik.dfki-bremen.de/en/startpage.html) of the | ||
[German Research Center for Artificial Intelligence (DFKI)](http://www.dfki.de) in Bremen together with the | ||
[Robotics Group](https://robotik.dfki-bremen.de/en/about-us/university-of-bremen-robotics-group.html) of the | ||
[University of Bremen](http://www.uni-bremen.de/en.html). At this phase, the work was supported through a grant from the European | ||
Commission (870142). | ||
|
||
<p float="left"> | ||
<img src="doc/source/_static/DFKI_Logo.png" height="100px" /> | ||
<img src="doc/source/_static/Uni_Logo.png" height="100px" /> | ||
</p> | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<mujoco> | ||
<!-- <include file="floor.xml"/> --> | ||
<!-- <include file="floor.xml" /> --> | ||
<compiler meshdir="../../meshes/" /> | ||
<extension> | ||
<plugin plugin="mujoco.elasticity.solid" /> | ||
</extension> | ||
<worldbody> | ||
<body name="pillow_fixed" pos=".12 -.05 .456"> | ||
<flexcomp name="pillow" mass=".5" dim="3" type="gmsh" scale=".7 .7 .7" file="pillow_small.msh" rgba=".1 .9 .1 1" radius="0.001"> | ||
<body name="pillow_fixed" pos="0 0 1" quat="1 0 0 1"> | ||
<flexcomp name="pillow" mass="1" dim="3" type="gmsh" scale=".7 .7 .7" file="pillow_small.msh" rgba=".1 .9 .1 1" radius="0.001"> | ||
<edge equality="true" /> | ||
<plugin plugin="mujoco.elasticity.solid"> | ||
<config key="young" value="1e4" /> | ||
<config key="young" value="2000" /> | ||
<config key="poisson" value="0.1" /> | ||
<config key="damping" value="1e-4" /> | ||
</plugin> | ||
</flexcomp> | ||
</body> | ||
</worldbody> | ||
<equality> | ||
<weld name="fix_1" body1="pillow_94" body2="world" /> | ||
<weld name="fix_2" body1="pillow_8" body2="world" /> | ||
<weld name="fix_3" body1="pillow_9" body2="world" /> | ||
<weld name="fix_4" body1="pillow_2" body2="world" /> | ||
<weld name="fix_5" body1="pillow_58" body2="world" /> | ||
<weld name="fix_6" body1="pillow_69" body2="world" /> | ||
<weld name="fix_7" body1="pillow_116" body2="world" /> | ||
<weld name="fix_8" body1="pillow_47" body2="world" /> | ||
<weld name="fix_1" body1="pillow_94" body2="pillow_fixed" /> | ||
<weld name="fix_2" body1="pillow_8" body2="pillow_fixed" /> | ||
<weld name="fix_3" body1="pillow_9" body2="pillow_fixed" /> | ||
<weld name="fix_4" body1="pillow_2" body2="pillow_fixed" /> | ||
<weld name="fix_5" body1="pillow_58" body2="pillow_fixed" /> | ||
<weld name="fix_6" body1="pillow_69" body2="pillow_fixed" /> | ||
<weld name="fix_7" body1="pillow_116" body2="pillow_fixed" /> | ||
<weld name="fix_8" body1="pillow_47" body2="pillow_fixed" /> | ||
</equality> | ||
</mujoco> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<mujoco> | ||
<asset> | ||
<mesh name="index_finger" file="stl/index_finger.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="index_tip" file="stl/index_tip.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="little_finger" file="stl/little_finger.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="little_tip" file="stl/little_tip.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="middle_finger" file="stl/middle_finger.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="middle_tip" file="stl/middle_tip.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="dorsum_simple" file="stl/dorsum_simple.stl" scale="0.0766738 0.104275 0.0766738" /> | ||
<mesh name="palm_simple" file="stl/palm_simple.stl" scale="0.122027 0.122027 0.122027" /> | ||
<mesh name="wrist" file="stl/wrist.stl" scale="0.000999999 0.000999999 0.000999999" /> | ||
<mesh name="ring_finger" file="stl/ring_finger.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="ring_tip" file="stl/ring_tip.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="thumb_cover" file="stl/thumb_cover.stl" scale="0.000999988 0.000999987 0.000999987" /> | ||
<mesh name="thumb_frame" file="stl/thumb_frame.stl" scale="0.000999988 0.000999987 0.000999987" /> | ||
<mesh name="thumb_metacarpus" file="stl/thumb_metacarpus.stl" scale="0.000999987 0.000999987 0.000999987" /> | ||
<mesh name="UR_flange" file="stl/UR_flange.stl" scale="0.000999999 0.000999999 0.000999999" /> | ||
</asset> | ||
</mujoco> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<mujoco> | ||
<asset> | ||
<material name="black" specular="0.5" shininess="0.25" rgba="0.16355 0.16355 0.16355 1" /> | ||
<material name="gray" specular="0.0" shininess="0.25" rgba="0.80848 0.80848 0.80848 1" /> | ||
<material name="metallic" specular="0" shininess="0.25" rgba="0.9 0.9 0.9 1" /> | ||
<mesh name="shadow_rh_forearm_0" scale="0.001 0.001 0.001" file="shadow_hand/forearm_0.obj" /> | ||
<mesh name="shadow_rh_forearm_1" scale="0.001 0.001 0.001" file="shadow_hand/forearm_1.obj" /> | ||
<mesh name="shadow_rh_forearm_collision" scale="0.001 0.001 0.001" file="shadow_hand/forearm_collision.obj" /> | ||
<mesh name="shadow_rh_wrist" scale="0.001 0.001 0.001" file="shadow_hand/wrist.obj" /> | ||
<mesh name="shadow_rh_palm" scale="0.001 0.001 0.001" file="shadow_hand/palm.obj" /> | ||
<mesh name="shadow_rh_f_knuckle" scale="0.001 0.001 0.001" file="shadow_hand/f_knuckle.obj" /> | ||
<mesh name="shadow_rh_f_proximal" scale="0.001 0.001 0.001" file="shadow_hand/f_proximal.obj" /> | ||
<mesh name="shadow_rh_f_middle" scale="0.001 0.001 0.001" file="shadow_hand/f_middle.obj" /> | ||
<mesh name="shadow_rh_f_distal_pst" scale="0.001 0.001 0.001" file="shadow_hand/f_distal_pst.obj" /> | ||
<mesh name="shadow_rh_lf_metacarpal" scale="0.001 0.001 0.001" file="shadow_hand/lf_metacarpal.obj" /> | ||
<mesh name="shadow_rh_th_proximal" scale="0.001 0.001 0.001" file="shadow_hand/th_proximal.obj" /> | ||
<mesh name="shadow_rh_th_middle" scale="0.001 0.001 0.001" file="shadow_hand/th_middle.obj" /> | ||
<mesh name="shadow_rh_th_distal_pst" scale="0.001 0.001 0.001" file="shadow_hand/th_distal_pst.obj" /> | ||
</asset> | ||
</mujoco> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<mujoco> | ||
<asset> | ||
<mesh name="base" file="ur10/collision/base.stl" /> | ||
<mesh name="shoulder" file="ur10/collision/shoulder.stl" /> | ||
<mesh name="upperarm" file="ur10/collision/upperarm.stl" /> | ||
<mesh name="forearm" file="ur10/collision/forearm.stl" /> | ||
<mesh name="wrist1" file="ur10/collision/wrist1.stl" /> | ||
<mesh name="wrist2" file="ur10/collision/wrist2.stl" /> | ||
<mesh name="wrist3" file="ur10/collision/wrist3.stl" /> | ||
</asset> | ||
</mujoco> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<mujoco> | ||
<asset> | ||
<mesh name="base" file="ur10e/collision/base.stl" /> | ||
<mesh name="shoulder" file="ur10e/collision/shoulder.stl" /> | ||
<mesh name="upperarm" file="ur10e/collision/upperarm.stl" /> | ||
<mesh name="forearm" file="ur10e/collision/forearm.stl" /> | ||
<mesh name="wrist1" file="ur10e/collision/wrist1.stl" /> | ||
<mesh name="wrist2" file="ur10e/collision/wrist2.stl" /> | ||
<mesh name="wrist3" file="ur10e/collision/wrist3.stl" /> | ||
</asset> | ||
</mujoco> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<mujoco> | ||
<asset> | ||
<mesh name="base" file="ur10/collision/base.stl" /> | ||
<mesh name="shoulder" file="ur10/collision/shoulder.stl" /> | ||
<mesh name="upperarm" file="ur10/collision/upperarm.stl" /> | ||
<mesh name="forearm" file="ur10/collision/forearm.stl" /> | ||
<mesh name="wrist1" file="ur10/collision/wrist1.stl" /> | ||
<mesh name="wrist2" file="ur10/collision/wrist2.stl" /> | ||
<mesh name="wrist3" file="ur10/collision/wrist3.stl" /> | ||
<mesh name="robotiq_ft300" file="collision/robotiq/robotiq_ft300.STL" /> | ||
<mesh name="robotiq_ft300-G-062-COUPLING_G-50-4M6-1D6_20181119" file="collision/robotiq/mountings/robotiq_ft300-G-062-COUPLING_G-50-4M6-1D6_20181119.STL" /> | ||
</asset> | ||
</mujoco> |
Oops, something went wrong.