Tiny Differentiable Simulator is a header-only C++ and CUDA physics library for reinforcement learning and robotics with zero dependencies.
Find a file
2023-04-25 18:26:32 -07:00
.github/workflows Create cmake.yml 2021-10-28 14:36:51 -07:00
data add different checked background for white/lighter colored robots 2021-12-08 05:19:51 -08:00
examples Update inclined_plane_gui.cpp 2022-08-10 17:39:54 -07:00
python Allow to use pytinyopengl3 module to render instances of urdf files, separate from pytinydiffsim. 2022-06-03 11:41:25 -07:00
src rl_games test see vec_ant.py 2022-05-17 20:39:44 -07:00
test Merge remote-tracking branch 'gr/master' into master 2021-10-29 10:21:53 -07:00
third_party bump up pybind11 version 2023-04-25 18:26:32 -07:00
.clang-format Add clang-format file 2021-10-06 11:24:20 -07:00
.gitignore Improve gitignore 2021-04-18 18:10:32 -07:00
.gitmodules add TinyRendererUrdfVisualizer work-in-progress 2021-10-05 19:54:44 -07:00
build_libs_unix.sh fix build_libs_unix.sh 2022-05-21 00:20:28 -07:00
build_libs_windows.bat disable PAGMO/TBB, their break the API too often 2021-12-02 07:26:21 -08:00
CMakeLists.txt cmake option for tinyrenderer 2021-10-05 20:37:04 -07:00
CONTRIBUTING.md Initial checkin of our research in differentiable physics simulation 2020-05-14 22:01:22 -07:00
LICENSE remote extension from LICENSE file 2021-04-21 08:17:40 -07:00
MANIFEST.in add missing Eigen files (due to .gitignore) 2020-12-05 12:13:34 -08:00
README.md Update README.md 2022-04-14 10:36:59 -07:00
register_dylibs.sh add dylib registration script 2021-02-03 17:02:27 -08:00
setup.py bump version 2023-04-26 01:18:35 +00:00

Tiny Differentiable Simulator

Tiny Differentiable Simulator is a header-only C++ (and CUDA) physics library with zero dependencies.

  • Note that the main repository is transfered from google-research to Erwin Coumans

It currently implements various rigid-body dynamics algorithms, including forward and inverse dynamics, as well as contact models based on impulse-level LCP and force-based nonlinear spring-dampers. Actuator models for motors, servos, and Series-Elastic Actuator (SEA) dynamics are implemented.

The entire codebase is templatized so you can use forward- and reverse-mode automatic differentiation scalar types, such as CppAD, Stan Math fvar and ceres::Jet. The library can also be used with regular float or double precision values. Another option is to use the included fix-point integer math, that provide cross-platform deterministic computation.

TDS can run thousands of simulations in parallel on a single RTX 2080 CUDA GPU at 50 frames per second:

https://user-images.githubusercontent.com/725468/135697035-7df34b85-c73e-4739-9a76-dc114ce84c4c.mp4

Multiple visualizers are available, see below.

Bibtex

Please use the following reference to cite this research:

@inproceedings{heiden2021neuralsim,
  author =	  {Heiden, Eric and Millard, David and Coumans, Erwin and Sheng, Yizhou and Sukhatme, Gaurav S},
  year =		  {2021},
  title =		  {Neural{S}im: Augmenting Differentiable Simulators with Neural Networks},
  booktitle = {Proceedings of the IEEE International Conference on Robotics and Automation (ICRA)},
  url =		    {https://github.com/google-research/tiny-differentiable-simulator}
}
  • "Inferring Articulated Rigid Body Dynamics from RGBD Video" (IROS 2022 submission) Eric Heiden, Ziang Liu, Vibhav Vineet, Erwin Coumans, Gaurav S. Sukhatme Project Page
  • "NeuralSim: Augmenting Differentiable Simulators with Neural Networks" (ICRA 2021) Eric Heiden, David Millard, Erwin Coumans, Yizhou Sheng, Gaurav S. Sukhatme. PDF on Arxiv
  • “Augmenting Differentiable Simulators with Neural Networks to Close the Sim2Real Gap” (RSS 2020 sim-to-real workshop), Eric Heiden, David Millard, Erwin Coumans, Gaurav Sukhatme. PDF on Arxiv and video
  • "Interactive Differentiable Simulation", 2020, Eric Heiden, David Millard, Hejia Zhang, Gaurav S. Sukhatme. PDF on Arxiv
  • "Efficient Differentiable Simulation of Articulated Bodies" (ICML 2021) Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin PDF on Arxiv

Getting started

The open-source version builds using CMake and requires a compiler with C++17 support.

mkdir build
cd build
cmake ..
make -j

Examples

For visualization, two options are supported:

OpenGL 3+ Visualization

  • tiny_opengl3_app, an OpenGL3 visualizer

This visualizer is native part of this library under src/visualizer/opengl

MeshCat Visualization

  • MeshCat, a web-based visualizer that uses WebGL

A C++ ZMQ interface is provided.

Before running the example, install python, pip and meshcat, run the meshcat-server and open the web browser (Chrome is recommended for a good three.js experience.)

pip install meshcat
meshcat-server --open
This should open Chrome at http://localhost:7000/static/
Then compile and run tiny_urdf_parser_meshcat_example in optimized/release build.

URDF files can be loaded using a provided parser based on TinyXML2.

All dependencies for meshcat visualization are included in third_party.


Disclaimer: This is not an official Google product.