SoftGym is a set of benchmark environments for deformable object manipulation including tasks involving fluid, cloth and rope. It is built on top of the Nvidia FleX simulator and has standard Gym API for interaction with RL agents.
The provided Dockerfile is based on the pre-built image for softgym which in turn uses CUDA 9.2. This codebase is tested with Ubuntu 20.04 LTS and Nvidia driver version 450.102.04
- Install docker-ce
- Install nvidia-docker (Docker versions earlier than 19.03 require nvidia-docker2 and the
--runtime=nvidiaflag. On versions including and after 19.03, you will use thenvidia-container-toolkitpackage and the--gpus allflag)
- run
make buildto build the docker image - run
make bashto run the image with an interactive bash session (step 2 also includes step 1) - run
source setup.shto setup thesoftgym conda environmentand compile the python bindings forpyflex
| Image | Name | Description |
|---|---|---|
![]() |
DropCloth | Lay a piece of cloth in the air flat on the floor |
![]() |
FoldCloth | Fold a piece of flattened cloth in half |
![]() |
SpreadCloth | Spread a crumpled cloth on the floor |
![]() |
PourWater | Pour a cup of water into a target cup |
![]() |
TransportWater | Move a cup of water to a target position as fast as possible without spilling out the water |
![]() |
StraightenRope | Straighten a rope starting from a random configuration |
![]() |
PourWaterAmount | This task is similar to PourWater but requires a specific amount of water poured into the target cup. The required water level is indicated by a red line. |
![]() |
FoldCrumpledCloth | This task is similar to FoldCloth but the cloth is initially crumpled |
![]() |
DropFoldCloth | This task has the same initial state as DropCloth but requires the agent to fold the cloth instead of just laying it on the ground |
![]() |
RopeConfiguration | This task is similar to StraightenCloth but the agent needs to manipulate the rope into a specific configuration from different starting locations. |
To have a quick view of different tasks listed in the paper (with random actions), run the following commands: For SoftGym-Medium:
- TransportWater:
python examples/random_env.py --env_name PassWater - PourWater:
python examples/random_env.py --env_name PourWater - StraightenRope:
python examples/random_env.py --env_name RopeFlatten - SpreadCloth:
python examples/random_env.py --env_name ClothFlatten - FoldCloth:
python examples/random_env.py --env_name ClothFold - DropCloth:
python examples/random_env.py --env_name ClothDrop
For SoftGym-Hard:
- PourWaterAmount:
python examples/random_env.py --env_name PourWaterAmount - FoldCrumpledCloth:
python examples/random_env.py --env_name ClothFoldCrumpled - DropFoldCloth:
python examples/random_env.py --env_name ClothFoldDrop - RopeConfiguration:
python examples/random_env.py --env_name RopeConfiguration
Please refer to softgym/registered_env.py for the default parameters and source code files for each of these environments.
If you find this codebase useful in your research, please consider citing:
@inproceedings{corl2020softgym,
title={SoftGym: Benchmarking Deep Reinforcement Learning for Deformable Object Manipulation},
author={Lin, Xingyu and Wang, Yufei and Olkin, Jake and Held, David},
booktitle={Conference on Robot Learning},
year={2020}
}
- NVIDIA FleX - 1.2.0: https://github.com/NVIDIAGameWorks/FleX
- Our python interface builds on top of PyFleX: https://github.com/YunzhuLi/PyFleX









