Skip to content

Commit

Permalink
Merge pull request #58 from dfki-ric/fix/disable_mj_gui
Browse files Browse the repository at this point in the history
Fix/disable mj gui
  • Loading branch information
mlaux1 authored Sep 12, 2024
2 parents 61db082 + 039543a commit c991f03
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 13 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![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/). In these environments, the agent
needs to learn to grasp deformable object such as shoe insoles or pillows from sparse reward signals.
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"/>
Expand All @@ -23,6 +23,22 @@ After cloning the repository, it is recommended to install the library in editab
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: |




### Known Issues

If you use conda, you may experience the error below:
Expand Down Expand Up @@ -100,7 +116,7 @@ pip install numpydoc sphinx sphinx-gallery sphinx-bootstrap-theme

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 master for new releases. If you have
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:
Expand Down Expand Up @@ -133,7 +149,7 @@ url = {https://deformable-workshop.github.io/icra2023/},

### Semantic Versioning

Semantic versioning must be used, that is, the major version number will be
[Semantic versioning](https://semver.org/) must be used, that is, the major version number will be
incremented when the API changes in a backwards incompatible way, the minor
version will be incremented when new functionality is added in a backwards
compatible manner, and the patch version is incremented for bugfixes,
Expand Down
2 changes: 1 addition & 1 deletion deformable_gym/envs/mujoco/base_mjenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
obj_name: str,
observable_object_pos: bool = True,
max_sim_time: float = 5,
gui: bool = True,
gui: bool = False,
init_frame: str | None = None,
):
self.scene = AssetManager().create_scene(robot_name, obj_name)
Expand Down
2 changes: 1 addition & 1 deletion deformable_gym/envs/mujoco/grasp_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(
obj_name: str,
observable_object_pos: bool = True,
max_sim_time: float = 5,
gui: bool = True,
gui: bool = False,
init_frame: Optional[str] = None,
**kwargs,
):
Expand Down
2 changes: 1 addition & 1 deletion deformable_gym/envs/mujoco/mia_grasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(
obj_name: str,
observable_object_pos: bool = True,
max_sim_time: float = 1,
gui: bool = True,
gui: bool = False,
init_frame: str | None = None,
**kwargs,
):
Expand Down
2 changes: 1 addition & 1 deletion deformable_gym/envs/mujoco/shadow_grasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(
obj_name: str,
observable_object_pos: bool = True,
max_sim_time: float = 1,
gui: bool = True,
gui: bool = False,
init_frame: str | None = None,
**kwargs,
):
Expand Down
4 changes: 2 additions & 2 deletions examples/mj_mia_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
episode = 0
n_episodes = 3
observation, info = env.reset()
env.render()
#env.render()
while episode < n_episodes:
action = env.action_space.sample()
observation, reward, terminate, truncated, info = env.step(action)
env.render()
#env.render()
if terminate:
episode += 1
print(f"Episode {episode} finished with reward {reward}")
Expand Down
2 changes: 0 additions & 2 deletions examples/mj_shadow_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
episode = 0
n_episodes = 3
observation, info = env.reset()
env.render()
while episode < n_episodes:
action = env.action_space.sample()
observation, reward, terminate, truncated, info = env.step(action)
env.render()
if terminate:
episode += 1
print(f"Episode {episode} finished with reward {reward}")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="deformable_gym",
version="0.4.0",
version="0.4.1",
maintainer="Melvin Laux",
maintainer_email="melvin.laux@uni-bremen.de",
description="Gym environments for grasping deformable objects",
Expand Down

0 comments on commit c991f03

Please sign in to comment.