About
Soft robots replace conventional rigid links and localized joints with continuously deformable bodies. Their compliance can make them safe, adaptable, and capable of rich motion, but it also makes control and actuator design difficult: deformation is nonlinear, actuation is often distributed throughout the body, and an actuator changes the mechanics of the structure that it is trying to control. Useful control studies therefore need both realistic continuum dynamics and freedom to ask how the robot should be actuated.
gym-softrobot provides Gymnasium environments for this problem, using PyElastica for high-fidelity Cosserat-rod simulation. Rather than committing every task to a single hardware design, the environments cover several levels of actuator abstraction:
- direct push-pull forces for simple control experiments;
- tendon-driven actuation for continuum arms;
- distributed, muscle-like activation for bio-inspired robots; and
- idealized force and torque controls for studying hypothetical actuator placement and authority.
This range makes it possible to separate control questions from actuator-design questions, then progressively introduce physical constraints. The environments can be used to investigate policy transfer between actuation models, curriculum learning from simpler to higher-fidelity tasks, sim-to-real-oriented robustness, co-design, and reinforcement-learning methods for distributed control.
Installation
gym-softrobot requires Python 3.12 or newer.
pip install gym-softrobot
Quick start
import gymnasium as gym
import gym_softrobot # Registers the environments.
env = gym.make("SoftPendulum-v0")
observation, info = env.reset(seed=42)
terminated = truncated = False
while not (terminated or truncated):
action = env.action_space.sample()
observation, reward, terminated, truncated, info = env.step(action)
env.close()
For a more involved example, the CyberOctopus environments expose distributed feedback control over multiple soft arms:
import gymnasium as gym
import gym_softrobot
env = gym.make("OctoMuscleCrawl-v0")
observation, info = env.reset(seed=42)
observation, reward, terminated, truncated, info = env.step(
env.action_space.sample()
)
env.close()
See the documentation for the environment catalog, API conventions, rendering, CyberOctopus variants, and RL examples. The registered IDs can also be listed with:
python -m gym_softrobot.debug.registry
Development
uv sync --all-groups
uv run pre-commit install
Citation
@misc{gym_softrobot,
author = {Seung Hyun Kim and Chia-Hsien Shih and Mattia Gazzola},
title = {Soft Robotics Environment for Gymnasium},
year = {2026},
publisher = {GitHub},
howpublished = {\url{https://github.com/skim0119/gym-softrobot}}
}
@article{Naughton2021,
author = {Naughton, Noel and Sun, Jiarui and Tekinalp, Arman and
Parthasarathy, Tejaswin and Chowdhary, Girish and Gazzola, Mattia},
title = {Elastica: A Compliant Mechanics Environment for Soft Robotic Control},
journal = {IEEE Robotics and Automation Letters},
year = {2021},
volume = {6},
number = {2},
pages = {3389--3396},
doi = {10.1109/LRA.2021.3063698}
}
Author
Metadata
Release files for gym-softrobot 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gym_softrobot-0.3.0.tar.gz | 209.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gym_softrobot-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 339.7 kB
Release files / gym_softrobot-0.3.0.tar.gz
| Download URL | gym_softrobot-0.3.0.tar.gz |
|---|---|
| Size | 209.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba91e7251d40dbef224a0e9be96890d8600377bb69dd8f2c11cfe9a24426030a
|
|
BLAKE2b-256 checksum How to use checksums |
29df5ee5267d483c670b2a01f3a013213ed4db09afa0bfeca5981eda6e60bbdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.10
|
Release files / gym_softrobot-0.3.0-py3-none-any.whl
| Download URL | gym_softrobot-0.3.0-py3-none-any.whl |
|---|---|
| Size | 130.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a2ccddd30d47ac1e4f875bcf07c3e77e67ed77f9c484f4f6bb36356f4da70ea
|
|
BLAKE2b-256 checksum How to use checksums |
65d6fece7f6da1266c695497e941f01f9d2651311767ba071b103607213fac37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.10
|