Skip to main content

Soft-robotics control environment package for Gymnasium

Project description

Soft-Robot Control Environment (gym-softrobot)

Documentation Status

The environment is designed to leverage wide-range of reinforcement learning methods into soft-robotics control. Our inspiration is from slender-body living creatures, such as octopus or snake. The code is based on PyElastica, an open-source physics simulation for highly-deformable slender structure. We intend this package to be easy-to-install and fully compatible to OpenAI Gym and other available RL algorithms.

Installation

pip install gym-softrobot

Some recent version of python might not be compatible with LLVM version. Please let us know usign the git-issue. At the current stabe, we best recommend python 3.10.

To test the installation, we provide few debugging scripts. The environment can be tested using the following command.

python -m gym_softrobot.debug.make     # Make environment and run 10 steps
python -m gym_softrobot.debug.registry # Print gym-softrobot environment

Requirements:

  • Python 3.10+
  • Gymnasium 1.0.0
  • PyElastica 0.3.2+
  • COOMM
  • Matplotlib (optional for display rendering and plotting)
  • POVray (optional for 3D rendering)

Rendering

We support two different backends for the rendering: POVray and Matplotlib. The default is set to use POVray, but the configuration can be switched by adding following lines.

from gym_softrobot.config import RendererType
gym_softrobot.RENDERER_CONFIG = RendererType.MATPLOTLIB  # Default: POVRAY

POVray

To make a good-looking 3D videos and figures, we use POVray python wrapper Vapory. POVray is not a requirement to run the environment, but it is necessary to use env.render() function as typical gym environment.

If you would like to test POVray with gym-softrobot, use

python -m gym_softrobot.debug.render  # Render 10 frames using vapory

Matplotlib

We provide secondary rendering tool using Matplotlib for a quick debugging and sanity checking.

Reinforcement Learning Example

We tested the environment using Stable Baselines3 for centralized control. More advanced algorithms are still under development.

If you have your own algorithm that you would like to test with our environment, you are welcome to reach out to us.

Citation

Please use this bibtex to cite in your publications:

@misc{gym_softrobot,
  author = {Chia-Hsien Shih, Seung Hyun Kim, Mattia Gazzola},
  title = {Soft Robotics Environment for OpenAI Gym},
  year = {2022},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/skim0119/gym-softrobot}},
}

Environment Documentation

The description of each environment is available in documentation.

Contribution

We are currently developing the package internally. We mainly use uv to manage the project setting. If you plan to commit your code, please use the following commands to setup the pre-commit hooks.

uv sync --all-groups
uv run pre-commit install

Author

GitHub Contributors Image

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

gym_softrobot-0.2.1.tar.gz (157.1 kB view details)

Uploaded Source

Built Distribution

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

gym_softrobot-0.2.1-py3-none-any.whl (121.7 kB view details)

Uploaded Python 3

File details

Details for the file gym_softrobot-0.2.1.tar.gz.

File metadata

  • Download URL: gym_softrobot-0.2.1.tar.gz
  • Upload date:
  • Size: 157.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for gym_softrobot-0.2.1.tar.gz
Algorithm Hash digest
SHA256 129bb2b0c130b6414a29bd893ac94bd708106e850c49d220d7bc5296dccd1f25
MD5 4283d53c4a3119dab74dff8211d61ece
BLAKE2b-256 89e5f8c5910b0b218b5f99527dfac7f9bdfce96484d0f0d56f80cab97c08e685

See more details on using hashes here.

File details

Details for the file gym_softrobot-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: gym_softrobot-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 121.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for gym_softrobot-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4bcbffe732edac6ead62e227aac7acb95560c7f6719738d9d8bdf254ec121fd
MD5 8e8777b910b45315362b32f6ebc5e6de
BLAKE2b-256 b6755958926fd9a4fa1b2f97570c7c40321bee511917c3f223b3389a1019d1d2

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