Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin
[Paper] [Video] [Slides] [Code]
- This project is still work-in-progress. It can be built with gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04), cmake 3.17.3, and CUDA 10.2 (only required for MBPO).
- Clone this repo and setup the python environment.
git clone [email protected]:YilingQiao/diffarticulated.git
cd diffarticulated
conda env create -f gpu-env.yml
conda activate diffarti_36
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
- Compile this library.
mkdir build
cd build
cmake ..
make -j
cd ..
python setup.py install
If you do not have the uuid
lib, you may install it by apt-get install uuid-dev
. We will add uuid
to the third_party
directory shortly.
- Run the examples
We use meshcat
to visualize the simulation. Please run the following command to start a session before runing the simulation.
meshcat-server --open
An exmaple of solving inverse physics using the differentiable physics is python/exp_throw.py
. Please run
python python/exp_throw.py
and it will optimize the control input in 60 episodes.
- When you want to export the simulation results in one frame, you can call
world.sync_visual_meshcat(sim_step)
in the python code. An example can be found inpython/exp_throw.py
- By default, simulation records are stored in
meshcat/his/
. This path can be customized by modifying thesync_visual_transforms()
function inexamples/meshcat_urdf_visualizer.h
. - To convert the simulation records into obj meshes, please run
cd python/results
cp -r ../../meshcat/* ./
python convert_history.py
cd ../..
Before generating new records for conversion, please clean the cache in meshcat/his
and meshcat/obj
To run the demo of throwing a marble,
python python/exp_throw.py
python python/exp_punch.py
python python/exp_car.py
We place the RL code in another seperate repo.
- Clone the submodule for RL.
git submodule init
git submodule update
- Install the packages for MBPO.
cd diffarti_mbpo/
git checkout master
pip install -e viskit
pip install -e .
- Run the experiments.
In diffarti_mbpo/
, run the command
chmod +x ./run_mbpo.sh
./run_mbpo.sh 8_7 pendulumours
In diffarti_mbpo/
, run the command
./run_mbpo.sh final_3 antours
Differentiable Soft Body Dynamics Code Paper Differentiable Simulation of Soft Multi-body Systems. Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin. (Neurips 2021)
Differentiable Articulated Body Dynamics Code Paper Efficient Differentiable Simulation of Articulated Bodies. Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin. (ICML 2021)
Differentiable Dynamics for Rigid Body and Cloth Coupling Code Paper Scalable Differentiable Physics for Learning and Control. Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin. (ICML 2020)
Differentiable Cloth Dynamics Code Paper Differentiable Cloth Simulation for Inverse Problems. Junbang Liang, Ming C. Lin, Vladlen Koltun. (NeurIPS 2019)
Thanks for the great open-source project tiny-differentiable-simulatior. This repo is derived from tinydiffsim. You might want to try the original tinydiffsim for its templatized auto-differentiation.
@inproceedings{Qiao2021Efficient,
author = {Qiao, Yi-Ling and Liang, Junbang and Koltun, Vladlen and Lin, Ming C.},
title = {Efficient Differentiable Simulation of Articulated Bodies},
booktitle = {ICML},
year = {2021},
}