Skip to main content

Gymnasium environments for grasping 3D deformable objects

Project description

Tests Code style: black pre-commit DOI

DeformableGym

This repository contains a collection of gymnasium environments built with PyBullet and MuJoCo. In these environments, the agent needs to learn to grasp deformable 3D objects such as shoe insoles or pillows from sparse reward signals.

Installation

Install from PyPI

The easiest way to install deformable_gym is via PyPI:

pip install deformable_gym

Install from source

Alternatively, e.g. if you want to develop extensions, you can also clone the repository and then install it in editable mode:

git clone git@github.com:dfki-ric/deformable_gym.git
pip install -e .

Optional dependencies

To install the mujoco versions of the environments, use pip install 'deformable_gym[mujoco]'.

To install the development dependencies, use pip install 'deformable_gym[dev]'.

You can install all optional dependencies using pip install 'deformable_gym[all]'.

Available environments

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:

Example

Here is an example of how to run a random agent in the FloatingMiaEnv. More can be found in the examples/ folder.

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.

"""

env = gymnasium.make("FloatingMiaGraspInsole-v0")

env.reset()
episode_return = 0
num_episodes = 0

while num_episodes <= 10:

    action = env.action_space.sample()

    state, reward, terminated, truncated, _ = env.step(action)
    episode_return += reward

    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):

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:

pip install numpydoc sphinx sphinx-gallery sphinx-bootstrap-theme

Contributing

If you wish to report bugs, please use the issue tracker. If you would like to contribute to DeformableGym, just open an issue or a pull request. 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.
  • 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.

It is forbidden to directly push to the main branch. Each new version has its own development branch from which a pull request will be opened to the main branch. Only the maintainers of the software are allowed to merge a development branch to the main branch.

Referencing

If you use DeformableGym in your research, please consider citing it. You may find the paper here.

@inproceedings{Laux2023,
title = {Grasping 3D Deformable Objects via Reinforcement Learning: A Benchmark and Evaluation},
booktitle = {3rd Workshop on Representing and Manipulating Deformable Objects @ ICRA2023},
author = {Melvin Laux and Chandandeep Singh and Alexander Fabisch},
month = {May},
year = {2023},
url = {https://deformable-workshop.github.io/icra2023/},
}

Releases

Semantic Versioning

Semantic versioning 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, documentation, etc.

Funding

This library has been developed initially at the Robotics Innovation Center of the German Research Center for Artificial Intelligence (DFKI) in Bremen together with the Robotics Group of the University of Bremen. At this phase, the work was supported through a grant from the European Commission (870142).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deformable_gym-0.5.1.tar.gz (28.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deformable_gym-0.5.1-py3-none-any.whl (28.5 MB view details)

Uploaded Python 3

File details

Details for the file deformable_gym-0.5.1.tar.gz.

File metadata

  • Download URL: deformable_gym-0.5.1.tar.gz
  • Upload date:
  • Size: 28.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for deformable_gym-0.5.1.tar.gz
Algorithm Hash digest
SHA256 b94d5f26d8c94c7e36a637a76d5f7e00898948a48c2e412a58ef973ceaaea138
MD5 7584de4ef39016e86481d72f8d3c9937
BLAKE2b-256 6501630b6c6417c3a88bbcf9242c46a2c479990381ff7db6d17c436b24a91e3f

See more details on using hashes here.

File details

Details for the file deformable_gym-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: deformable_gym-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 28.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for deformable_gym-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c0d994c34fd076c9a05ab52f87327866d1bd868d930756c3f5392c97b222be4
MD5 b5629f390bfca9d8d0b8ca597dc307e8
BLAKE2b-256 5fa1cb379625f011e520be0fd4151dd1ab4216af3271004760e4eafb816a0832

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page