Skip to content

Diffsim with updated dependencies and installation instructions

Notifications You must be signed in to change notification settings

jjdunlop/diffsim

 
 

Repository files navigation

Scalable Differentiable Physics for Learning and Control

This is a forked repo from this paper

Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin

[Project] [arXiv] [Video] [GitHub]

Setup

This code has been tested on Ubuntu-18.04 running on WSL2.

  1. Create a conda virtual environment and activate it.
wget https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh
bash Anaconda3-2024.02-1-Linux-x86_64.sh

## Restart Shell ##

conda create -n diffsim python=3.6 -y
conda activate diffsim
  1. Download and build the project.
git clone https://github.com/jjdunlop/diffsim.git
cd diffsim
chmod +x installDependencies.sh
bash installDependencies.sh
bash script_build.sh
cd pysim
  1. Run the examples

Examples

Optimize an inverse problem

python exp_inverse.py

By default, the simulation output would be stored in pysim/default_out directory. If you want to store the results in some other places, like ./test_out, you can specify it by python exp_inverse.py test_out

To visualize the simulation results, use

python msim.py

You can change the source folder of the visualization in msim.py. More functionality of msim.py can be found in arcsim/src/msim.cpp.

The visualization is the same for all other experiments.

Learn to drag a cube using a cloth

python exp_learn_cloth.py

Learn to hold a rigid body using a parallel gripper

python exp_learn_stick.py

Scalability experiments

Figure 3, first row.

bash script_multibody.sh

Figure 3, second row.

bash script_scale.sh

Ablation study

Table 1, sparse collision handling.

bash script_absparse.sh

Table 2, fast differentiation.

bash script_abqr.sh

Estimate the mass of a cube

python exp_momentum.py

Two-way coupling - Trampoline

python exp_trampoline.py

Two-way coupling - Domino

python exp_domino.py

Two-way coupling - armadillo and bunny

python exp_bunny.py

Domain transfer - motion control in MuJoCo

This experiment requires MuJoCo environment. Install MuJoCo and its python interface mujoco_py before running this script.

python exp_mujoco.py

Our Related Repos

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)

Bibtex

@inproceedings{Qiao2020Scalable,
author  = {Qiao, Yi-Ling and Liang, Junbang and Koltun, Vladlen and Lin, Ming C.},
title  = {Scalable Differentiable Physics for Learning and Control},
booktitle = {ICML},
year  = {2020},
}

About

Diffsim with updated dependencies and installation instructions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 81.0%
  • HTML 11.1%
  • C 6.6%
  • Python 1.0%
  • Makefile 0.2%
  • Shell 0.1%