Improving Gradient Computation for Differentiable Physics Simulation with Contacts

Yaofeng Desmond Zhong, Jiequn Han, Biswadip Dey, Georgia Olympia Brikis
4/28/2023
cs.LGcs.AIcs.RO

No official code found. Best implementation: DesmondZhong/diff_sim_improve_grads (6 stars, PyTorch, last commit 2023-08-13).

Abstract

Differentiable simulation enables gradients to be back-propagated through physics simulations. In this way, one can learn the dynamics and properties of a physics system by gradient-based optimization or embed the whole differentiable simulation as a layer in a deep learning model for downstream tasks, such as planning and control. However, differentiable simulation at its current stage is not perfect and might provide wrong gradients that deteriorate its performance in learning tasks. In this paper, we study differentiable rigid-body simulation with contacts. We find that existing differentiable simulation methods provide inaccurate gradients when the contact normal direction is not fixed - a general situation when the contacts are between two moving objects. We propose to improve gradient computation by continuous collision detection and leverage the time-of-impact (TOI) to calculate the post-collision velocities. We demonstrate our proposed method, referred to as TOI-Velocity, on two optimal control problems. We show that with TOI-Velocity, we are able to learn an optimal control sequence that matches the analytical solution, while without TOI-Velocity, existing differentiable simulation methods fail to do so.

View on arXivView PDF

Code Implementations(1)

PyTorch

PyTorch and Taichi implementations of our paper on improving gradient computation

60PythonApr 28, 20233 years agoNOASSERTION
differentiable-programmingdifferentiable-simulationdynamical-systemsoptimal-controlpytorch+1 more

Similar Papers

Cite this paper

@article{zhong2023improving,
  title  = {Improving Gradient Computation for Differentiable Physics Simulation with Contacts},
  author = {Yaofeng Desmond Zhong and Jiequn Han and Biswadip Dey and Georgia Olympia Brikis},
  year   = {2023},
  eprint = {2305.00092},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.00092v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.00092.svg)](https://codeofpaper.com/paper/2305.00092)

Discussion