Skip to main content

A physics engine in reduced coordinates implemented with JAX.

Project description

JAXsim

A scalable physics engine and multibody dynamics library implemented with JAX. With JIT batteries 🔋

[!WARNING] This project is still experimental, APIs could change without notice.

[!NOTE] This simulator currently focuses on locomotion applications. Only contacts with ground are supported.

Features

  • Physics engine in reduced coordinates implemented with JAX in Python.
  • JIT compilation of Python code for increased performance.
  • Transparent support to execute logic on CPUs, GPUs, and TPUs.
  • Parallel multi-body simulations on hardware accelerators for significantly increased throughput.
  • Support for SDF models (and, upon conversion, URDF models).
  • Collision detection between bodies and uneven ground surface.
  • Soft contacts model supporting full friction cone and sticking / slipping transition.
  • Complete support for inertial properties of rigid bodies.
  • Revolute, prismatic, and fixed joints support.
  • Integrators: forward Euler, semi-implicit Euler, Runge-Kutta 4.
  • High-level classes for object-oriented programming.
  • High-level classes to compute multi-body dynamics quantities from the simulation state.
  • High-level classes wrapping the low-level functional RBDAs with support of multiple velocities representations.
  • Default validation of JAX pytrees to prevent JIT re-compilations.
  • Preliminary support for automatic differentiation of RBDAs.

Documentation

The JAXsim API documentation is available at jaxsim.readthedocs.io.

Installation

You can install the project using conda:

conda install jaxsim -c conda-forge

Alternatively, you can use pypa/pip, preferably in a virtual environment:

pip install jaxsim

Check setup.cfg for the complete list of optional dependencies. Install all of them with jaxsim[all].

Note: For GPU support, follow the official installation instructions of JAX.

Quickstart

Explore and learn how to use the library through practical demonstrations available in the examples folder.

Credits

The physics module of JAXsim is based on the theory of the Rigid Body Dynamics Algorithms book by Roy Featherstone. We structured part of our logic following its accompanying code. The physics engine is developed entirely in Python using JAX.

The inspiration for developing JAXsim originally stemmed from early versions of google/brax. Here below we summarize the differences between the projects:

  • JAXsim simulates multibody dynamics in reduced coordinates, while brax v1 uses maximal coordinates.
  • The new v2 APIs of brax (and the new MJX) were then implemented in reduced coordinates, following an approach comparable to JAXsim, with major differences in contact handling.
  • The rigid-body algorithms used in JAXsim allow to efficiently compute quantities based on the Euler-Poincarè formulation of the equations of motion, necessary for model-based robotics research.
  • JAXsim supports SDF (and, indirectly, URDF) models, assuming the model is described with the recent Pose Frame Semantics.
  • Contrarily to brax, JAXsim only supports collision detection between bodies and a compliant ground surface.
  • The RBDAs of JAXsim support automatic differentiation, but this functionality has not been thoroughly tested.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Citing

@software{ferigo_jaxsim_2022,
  author = {Diego Ferigo and Silvio Traversaro and Daniele Pucci},
  title = {{JAXsim}: A Physics Engine in Reduced Coordinates and Multibody Dynamics Library for Control and Robot Learning},
  url = {http://github.com/ami-iit/jaxsim},
  year = {2022},
}

People

Author Maintainers

License

BSD3

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jaxsim-0.2.dev46.tar.gz (153.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jaxsim-0.2.dev46-py3-none-any.whl (96.4 kB view details)

Uploaded Python 3

File details

Details for the file jaxsim-0.2.dev46.tar.gz.

File metadata

  • Download URL: jaxsim-0.2.dev46.tar.gz
  • Upload date:
  • Size: 153.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for jaxsim-0.2.dev46.tar.gz
Algorithm Hash digest
SHA256 3e4c43db80b1891b911d247bd3104a8b9d2cd8fc264c0fba8a87a5cc0b5bc04e
MD5 70212c9fc6f7d1a6f5dcb652d52df177
BLAKE2b-256 d4c3b78f890bfe7896c376a0173b9b4c4564edcaa376c99c12b8f4c5b6f4a12b

See more details on using hashes here.

File details

Details for the file jaxsim-0.2.dev46-py3-none-any.whl.

File metadata

  • Download URL: jaxsim-0.2.dev46-py3-none-any.whl
  • Upload date:
  • Size: 96.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for jaxsim-0.2.dev46-py3-none-any.whl
Algorithm Hash digest
SHA256 babeeb1cfe750a3975481d7789cf6b9665a56716f8d5f3e9aaa3cda97da4f43d
MD5 2ea30dbf399655739367ef4c44bd4bab
BLAKE2b-256 0be9e8d3e9f463e99a6071da87d1d7a99b1e0751a25df6bd98a1cfb0e25eb0bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page