- Please check out our new paper if interested: RoboCook: Long-Horizon Elasto-Plastic Object Manipulation with Diverse Tools
- Please see the dev branch for an improved version of the RoboCraft codebase, especially if you're interested in real-world experiments!
If you use the codebase in your research, please cite:
@article{shi2022robocraft,
title={RoboCraft: Learning to See, Simulate, and Shape Elasto-Plastic Objects with Graph Networks},
author={Shi, Haochen and Xu, Huazhe and Huang, Zhiao and Li, Yunzhu and Wu, Jiajun},
journal={arXiv preprint arXiv:2205.02909},
year={2022}
}
This is the codebase of RoboCraft in the simulator.
- Linux or macOS (Tested on Ubuntu 20.04)
- Python 3
- CPU or NVIDIA GPU + CUDA CuDNN
- Conda
# clone the repo
git clone https://github.com/hshi74/RoboCraft.git
cd RoboCraft
# create the conda environment
conda env create -f robocraft.yml
conda activate robocraft
# install requirements for the simulator
cd simulator
pip install -e .
- Run all the blocks in
simulator/plb/algorithms/test_tasks.ipynb
. Note that it is easier to use ipython notebook when dealing with Taichi env for fast materialization. - You can control the number of videos to generate by changing the variable
n_vid
. The default is 5 for the purpose of debugging. We used 50 in the paper.
cd simulator/plb/algorithms
- Go to line 598 in
sample_data.py
and replace the string with the output folder name you just generated insimulator/dataset
- Run
python sample_data.py
. Note that this step may take a while.
- You will need to remove the old dataset if you want to update the dataset
cd ../../../robocraft
bash scripts/utils/move_data.sh ngrip_fixed sample_ngrip_fixed_[timestamp of the folder you just generated]
bash scripts/dynamics/train.sh
- Go to line 6 in
robocraft/scripts/control/control.sh
and change the model path to the path to the checkpoint you just trained. bash scripts/control/control.sh
- The simulator folder contains the simulation environment we used for data collection and particle sampling.
- The robocraft folder contains the code for learning the GNN and planning.