jaxsim


Namejaxsim JSON
Version 0.6.0 PyPI version JSON
download
home_pageNone
SummaryA differentiable physics engine and multibody dynamics library for control and robot learning.
upload_time2025-01-10 17:04:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseBSD 3-Clause License Copyright (c) 2022, Artificial and Mechanical Intelligence All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords physics physics engine jax rigid body dynamics featherstone reinforcement learning robot robotics sdf urdf
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # JaxSim

**JaxSim** is a **differentiable physics engine** and **multibody dynamics library** built with JAX, tailored for control and robotic learning applications.

<div align="center">
<br/>
<table>
  <tr>
    <th><img src="https://github.com/user-attachments/assets/115b1c1c-6ae5-4c59-92e0-1be13ba954db" width="250"></th>
    <th><img src="https://github.com/user-attachments/assets/f9661fae-9a85-41dd-9a58-218758ec8c9c" width="250"></th>
    <th><img src="https://github.com/user-attachments/assets/ae8adadf-3bca-47b8-97ca-3a9273633d60" width="250"></th>
  </tr>
</table>
<br/>
</div>

## Features
- Reduced-coordinate physics engine for **fixed-base** and **floating-base** robots.
- Multibody dynamics library for model-based control algorithms.
- Fully Python-based, leveraging [jax][jax] following a functional programming paradigm.
- Seamless execution on CPUs, GPUs, and TPUs.
- Supports JIT compilation and automatic vectorization for high performance.
- Compatible with SDF models and URDF (via [sdformat][sdformat] conversion).

## Usage

### Using JaxSim as simulator


```python
import jax.numpy as jnp
import jaxsim.api as js
import icub_models
import pathlib

# Load the iCub model
model_path = icub_models.get_model_file("iCubGazeboV2_5")
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
          'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
          'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
          'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
          'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
          'r_ankle_roll')

# Build and reduce the model
model_description = pathlib.Path(model_path)
full_model = js.model.JaxSimModel.build_from_model_description(
    model_description=model_description, time_step=0.0001, is_urdf=True
)
model = js.model.reduce(model=full_model, considered_joints=joints)

ndof = model.dofs()
# Initialize data and simulation
data = js.data.JaxSimModelData.zero(model=model).reset_base_position(
    base_position=jnp.array([0.0, 0.0, 1.0])
)
T = jnp.arange(start=0, stop=1.0, step=model.time_step)
tau = jnp.zeros(ndof)

# Simulate
for t in T:
    data, _ = js.model.step(model=model, data=data, link_forces=None, joint_force_references=tau)

```

### Using JaxSim as a multibody dynamics library
``` python
import jax.numpy as jnp
import jaxsim.api as js
import icub_models
import pathlib

# Load the iCub model
model_path = icub_models.get_model_file("iCubGazeboV2_5")
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
          'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
          'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
          'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
          'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
          'r_ankle_roll')

# Build and reduce the model
model_description = pathlib.Path(model_path)
full_model = js.model.JaxSimModel.build_from_model_description(
    model_description=model_description, time_step=0.0001, is_urdf=True
)
model = js.model.reduce(model=full_model, considered_joints=joints)

# Initialize model data
data = js.data.JaxSimModelData.build(
    model=model,
    base_position=jnp.array([0.0, 0.0, 1.0],
)

# Frame and dynamics computations
frame_index = js.frame.name_to_idx(model=model, frame_name="l_foot")
W_H_F = js.frame.transform(model=model, data=data, frame_index=frame_index)  # Frame transformation
W_J_F = js.frame.jacobian(model=model, data=data, frame_index=frame_index)  # Frame Jacobian

# Dynamics properties
M = js.model.free_floating_mass_matrix(model=model, data=data)  # Mass matrix
h = js.model.free_floating_bias_forces(model=model, data=data)  # Bias forces
g = js.model.free_floating_gravity_forces(model=model, data=data)  # Gravity forces
C = js.model.free_floating_coriolis_matrix(model=model, data=data)  # Coriolis matrix

# Print dynamics results
print(f"M: shape={M.shape}, h: shape={h.shape}, g: shape={g.shape}, C: shape={C.shape}")

```
### Additional features

- Full support for automatic differentiation of RBDAs (forward and reverse modes) with JAX.
- Support for automatically differentiating against kinematics and dynamics parameters.
- All fixed-step integrators are forward and reverse differentiable.
- All variable-step integrators are forward differentiable.
- Check the example folder for additional usecase !

[jax]: https://github.com/google/jax/
[sdformat]: https://github.com/gazebosim/sdformat
[notation]: https://research.tue.nl/en/publications/multibody-dynamics-notation-version-2
[passive_viewer_mujoco]: https://mujoco.readthedocs.io/en/stable/python.html#passive-viewer

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

> [!NOTE]
> JaxSim currently focuses on locomotion applications.
> Only contacts between bodies and smooth ground surfaces are supported.

## Installation

<details>
<summary>With <code>conda</code></summary>

You can install the project using [`conda`][conda] as follows:

```bash
conda install jaxsim -c conda-forge
```

You can enforce GPU support, if needed, by also specifying `"jaxlib = * = *cuda*"`.

</details>

<details>
<summary>With <code>pixi</code></summary>

> ### Note
> The minimum version of `pixi` required is `0.39.0`.

You can add the jaxsim dependency in [`pixi`][pixi] project as follows:

```bash
pixi add jaxsim
```

If you are on Linux and you want to use a `cuda`-powered version of `jax`, remember to add the appropriate line in the [`system-requirements`](https://pixi.sh/latest/reference/pixi_manifest/#the-system-requirements-table) table, i.e. adding

~~~toml
[system-requirements]
cuda = "12"
~~~

if you are using a `pixi.toml` file or

~~~toml
[tool.pixi.system-requirements]
cuda = "12"
~~~

if you are using a `pyproject.toml` file.

</details>

<details>
<summary>With <code>pip</code></summary>

You can install the project using [`pypa/pip`][pip], preferably in a [virtual environment][venv], as follows:

```bash
pip install jaxsim
```

Check [`pyproject.toml`](pyproject.toml) for the complete list of optional dependencies.
You can obtain a full installation using `jaxsim[all]`.

If you need GPU support, follow the official [installation instructions][jax_gpu] of JAX.

</details>

<details>
<summary>Contributors installation (with <code>conda</code>)</summary>

If you want to contribute to the project, we recommend creating the following `jaxsim` conda environment first:

```bash
conda env create -f environment.yml
```

Then, activate the environment and install the project in editable mode:

```bash
conda activate jaxsim
pip install --no-deps -e .
```

</details>

<details>
<summary>Contributors installation (with <code>pixi</code>)</summary>

> ### Note
> The minimum version of `pixi` required is `0.39.0`.

You can install the default dependencies of the project using [`pixi`][pixi] as follows:

```bash
pixi install
```

See `pixi task list` for a list of available tasks.

</details>

[conda]: https://anaconda.org/
[pip]: https://github.com/pypa/pip/
[pixi]: https://pixi.sh/
[venv]: https://docs.python.org/3/tutorial/venv.html
[jax_gpu]: https://github.com/google/jax/#installation

## Documentation

The JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs].

[readthedocs]: https://jaxsim.readthedocs.io/


## Overview

<details>
<summary>Structure of the Python package</summary>

```
# tree -L 2 -I "__pycache__" -I "__init__*" -I "__main__*" src/jaxsim

src/jaxsim
|-- api..........................# Package containing the main functional APIs.
|   |-- com.py...................# |-- APIs for computing quantities related to the center of mass.
|   |-- common.py................# |-- Common utilities used in the current package.
|   |-- contact.py...............# |-- APIs for computing quantities related to the collidable points.
|   |-- data.py..................# |-- Class storing the data of a simulated model.
|   |-- frame.py.................# |-- APIs for computing quantities related to additional frames.
|   |-- joint.py.................# |-- APIs for computing quantities related to the joints.
|   |-- kin_dyn_parameters.py....# |-- Class storing kinematic and dynamic parameters of a model.
|   |-- link.py..................# |-- APIs for computing quantities related to the links.
|   |-- model.py.................# |-- Class defining a simulated model and APIs for computing related quantities.
|   |-- ode.py...................# |-- APIs for computing quantities related to the system dynamics.
|   |-- ode_data.py..............# |-- Set of classes to store the data of the system dynamics.
|   `-- references.py............# `-- Helper class to create references (link forces and joint torques).
|-- exceptions.py................# Module containing functions to raise exceptions from JIT-compiled functions.
|-- integrators..................# Package containing the integrators used to simulate the system dynamics.
|   |-- common.py................# |-- Common utilities used in the current package.
|   |-- fixed_step.py............# |-- Fixed-step integrators (explicit Runge-Kutta schemes).
|   `-- variable_step.py.........# `-- Variable-step integrators (embedded Runge-Kutta schemes).
|-- logging.py...................# Module containing logging utilities.
|-- math.........................# Package containing mathematical utilities.
|   |-- adjoint.py...............# |-- APIs for creating and manipulating 6D transformations.
|   |-- cross.py.................# |-- APIs for computing cross products of 6D quantities.
|   |-- inertia.py...............# |-- APIs for creating and manipulating 6D inertia matrices.
|   |-- joint_model.py...........# |-- APIs defining the supported joint model and the corresponding transformations.
|   |-- quaternion.py............# |-- APIs for creating and manipulating quaternions.
|   |-- rotation.py..............# |-- APIs for creating and manipulating rotation matrices.
|   |-- skew.py..................# |-- APIs for creating and manipulating skew-symmetric matrices.
|   `-- transform.py.............# `-- APIs for creating and manipulating homogeneous transformations.
|-- mujoco.......................# Package containing utilities to interact with the Mujoco passive viewer.
|   |-- loaders.py...............# |-- Utilities for converting JaxSim models to Mujoco models.
|   |-- model.py.................# |-- Class providing high-level methods to compute quantities using Mujoco.
|   `-- visualizer.py............# `-- Class that simplifies opening the passive viewer and recording videos.
|-- parsers......................# Package containing utilities to parse model descriptions (SDF and URDF models).
|   |-- descriptions/............# |-- Package containing the intermediate representation of a model description.
|   |-- kinematic_graph.py.......# |-- Definition of the kinematic graph associated with a parsed model description.
|   `-- rod/.....................# `-- Package to create the intermediate representation from model descriptions using ROD.
|-- rbda.........................# Package containing the low-level rigid body dynamics algorithms.
|   |-- aba.py...................# |-- The Articulated Body Algorithm.
|   |-- collidable_points.py.....# |-- Kinematics of collidable points.
|   |-- contacts/................# |-- Package containing the supported contact models.
|   |-- crba.py..................# |-- The Composite Rigid Body Algorithm.
|   |-- forward_kinematics.py....# |-- Forward kinematics of the model.
|   |-- jacobian.py..............# |-- Full Jacobian and full Jacobian derivative.
|   |-- rnea.py..................# |-- The Recursive Newton-Euler Algorithm.
|   `-- utils.py.................# `-- Common utilities used in the current package.
|-- terrain......................# Package containing resources to specify the terrain.
|   `-- terrain.py...............# `-- Classes defining the supported terrains.
|-- typing.py....................# Module containing type hints.
`-- utils........................# Package of common utilities.
    |-- jaxsim_dataclass.py......# |-- Utilities to operate on pytree dataclasses.
    |-- tracing.py...............# |-- Utilities to use when JAX is tracing functions.
    `-- wrappers.py..............# `-- Utilities to wrap objects for specific use cases on pytree dataclass attributes.
```

</details>

## Credits

The RBDAs are based on the theory of the [Rigid Body Dynamics Algorithms][RBDA]
book by Roy Featherstone.
The algorithms and some simulation features were inspired by its accompanying [code][spatial_v2].

[RBDA]: https://link.springer.com/book/10.1007/978-1-4899-7560-7
[spatial_v2]: http://royfeatherstone.org/spatial/index.html#spatial-software

The development of JaxSim started in late 2021, inspired by early versions of [`google/brax`][brax].
At that time, Brax was implemented in maximal coordinates, and we wanted a physics engine in reduced coordinates.
We are grateful to the Brax team for their work and showing the potential of [JAX][jax] in this field.

Brax v2 was later implemented reduced coordinates, following an approach comparable to JaxSim.
The development then shifted to [MJX][mjx], which today provides a JAX-based implementation of the Mujoco APIs.

The main differences between MJX/Brax and JaxSim are as follows:

- JaxSim supports out-of-the-box all SDF models with [Pose Frame Semantics][PFS].
- JaxSim only supports collisions between points rigidly attached to bodies and a compliant ground surface.
  Our contact model requires careful tuning of its spring-damper parameters, but being an instantaneous
  function of the state $(\mathbf{q}, \boldsymbol{\nu})$, it doesn't require running any optimization algorithm
  when stepping the simulation forward.
- JaxSim mitigates the stiffness of the contact-aware system dynamics by providing variable-step integrators.

[brax]: https://github.com/google/brax
[mjx]: https://mujoco.readthedocs.io/en/3.0.0/mjx.html
[PFS]: http://sdformat.org/tutorials?tut=pose_frame_semantics

## Contributing

We welcome contributions from the community.
Please read the [contributing guide](./CONTRIBUTING.md) to get started.

## Citing

```bibtex
@software{ferigo_jaxsim_2022,
  author = {Diego Ferigo and Filippo Luca Ferretti and Silvio Traversaro and Daniele Pucci},
  title = {{JaxSim}: A Differentiable Physics Engine and Multibody Dynamics Library for Control and Robot Learning},
  url = {http://github.com/ami-iit/jaxsim},
  year = {2022},
}
```

Theoretical aspects of JaxSim are based on Chapters 7 and 8 of the following Ph.D. thesis:

```bibtex
@phdthesis{ferigo_phd_thesis_2022,
  title = {Simulation Architectures for Reinforcement Learning applied to Robotics},
  author = {Diego Ferigo},
  school = {University of Manchester},
  type = {PhD Thesis},
  month = {July},
  year = {2022},
}
```

## People

| Authors | Maintainers |
|:------:|:-----------:|
| [<img src="https://avatars.githubusercontent.com/u/469199?v=4" width="40">][df] [<img src="https://avatars.githubusercontent.com/u/102977828?v=4" width="40">][ff] | [<img src="https://avatars.githubusercontent.com/u/102977828?v=4" width="40">][ff] [<img src="https://avatars.githubusercontent.com/u/57228872?v=4" width="40">][ac] |

[df]: https://github.com/diegoferigo
[ff]: https://github.com/flferretti
[ac]: https://github.com/xela-95

## License

[BSD3](https://choosealicense.com/licenses/bsd-3-clause/)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "jaxsim",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Filippo Luca Ferretti <filippo.ferretti@iit.it>, Alessandro Croci <alessandro.croci@iit.it>",
    "keywords": "physics, physics engine, jax, rigid body dynamics, featherstone, reinforcement learning, robot, robotics, sdf, urdf",
    "author": null,
    "author_email": "Diego Ferigo <dgferigo@gmail.com>, Filippo Luca Ferretti <filippoluca.ferretti@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/0f/e4/586bbbde0465fcfbb85aaeb69fba962610a8febac698cccf1ebd06918abe/jaxsim-0.6.0.tar.gz",
    "platform": null,
    "description": "# JaxSim\n\n**JaxSim** is a **differentiable physics engine** and **multibody dynamics library** built with JAX, tailored for control and robotic learning applications.\n\n<div align=\"center\">\n<br/>\n<table>\n  <tr>\n    <th><img src=\"https://github.com/user-attachments/assets/115b1c1c-6ae5-4c59-92e0-1be13ba954db\" width=\"250\"></th>\n    <th><img src=\"https://github.com/user-attachments/assets/f9661fae-9a85-41dd-9a58-218758ec8c9c\" width=\"250\"></th>\n    <th><img src=\"https://github.com/user-attachments/assets/ae8adadf-3bca-47b8-97ca-3a9273633d60\" width=\"250\"></th>\n  </tr>\n</table>\n<br/>\n</div>\n\n## Features\n- Reduced-coordinate physics engine for **fixed-base** and **floating-base** robots.\n- Multibody dynamics library for model-based control algorithms.\n- Fully Python-based, leveraging [jax][jax] following a functional programming paradigm.\n- Seamless execution on CPUs, GPUs, and TPUs.\n- Supports JIT compilation and automatic vectorization for high performance.\n- Compatible with SDF models and URDF (via [sdformat][sdformat] conversion).\n\n## Usage\n\n### Using JaxSim as simulator\n\n\n```python\nimport jax.numpy as jnp\nimport jaxsim.api as js\nimport icub_models\nimport pathlib\n\n# Load the iCub model\nmodel_path = icub_models.get_model_file(\"iCubGazeboV2_5\")\njoints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',\n          'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',\n          'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',\n          'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',\n          'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',\n          'r_ankle_roll')\n\n# Build and reduce the model\nmodel_description = pathlib.Path(model_path)\nfull_model = js.model.JaxSimModel.build_from_model_description(\n    model_description=model_description, time_step=0.0001, is_urdf=True\n)\nmodel = js.model.reduce(model=full_model, considered_joints=joints)\n\nndof = model.dofs()\n# Initialize data and simulation\ndata = js.data.JaxSimModelData.zero(model=model).reset_base_position(\n    base_position=jnp.array([0.0, 0.0, 1.0])\n)\nT = jnp.arange(start=0, stop=1.0, step=model.time_step)\ntau = jnp.zeros(ndof)\n\n# Simulate\nfor t in T:\n    data, _ = js.model.step(model=model, data=data, link_forces=None, joint_force_references=tau)\n\n```\n\n### Using JaxSim as a multibody dynamics library\n``` python\nimport jax.numpy as jnp\nimport jaxsim.api as js\nimport icub_models\nimport pathlib\n\n# Load the iCub model\nmodel_path = icub_models.get_model_file(\"iCubGazeboV2_5\")\njoints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',\n          'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',\n          'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',\n          'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',\n          'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',\n          'r_ankle_roll')\n\n# Build and reduce the model\nmodel_description = pathlib.Path(model_path)\nfull_model = js.model.JaxSimModel.build_from_model_description(\n    model_description=model_description, time_step=0.0001, is_urdf=True\n)\nmodel = js.model.reduce(model=full_model, considered_joints=joints)\n\n# Initialize model data\ndata = js.data.JaxSimModelData.build(\n    model=model,\n    base_position=jnp.array([0.0, 0.0, 1.0],\n)\n\n# Frame and dynamics computations\nframe_index = js.frame.name_to_idx(model=model, frame_name=\"l_foot\")\nW_H_F = js.frame.transform(model=model, data=data, frame_index=frame_index)  # Frame transformation\nW_J_F = js.frame.jacobian(model=model, data=data, frame_index=frame_index)  # Frame Jacobian\n\n# Dynamics properties\nM = js.model.free_floating_mass_matrix(model=model, data=data)  # Mass matrix\nh = js.model.free_floating_bias_forces(model=model, data=data)  # Bias forces\ng = js.model.free_floating_gravity_forces(model=model, data=data)  # Gravity forces\nC = js.model.free_floating_coriolis_matrix(model=model, data=data)  # Coriolis matrix\n\n# Print dynamics results\nprint(f\"M: shape={M.shape}, h: shape={h.shape}, g: shape={g.shape}, C: shape={C.shape}\")\n\n```\n### Additional features\n\n- Full support for automatic differentiation of RBDAs (forward and reverse modes) with JAX.\n- Support for automatically differentiating against kinematics and dynamics parameters.\n- All fixed-step integrators are forward and reverse differentiable.\n- All variable-step integrators are forward differentiable.\n- Check the example folder for additional usecase !\n\n[jax]: https://github.com/google/jax/\n[sdformat]: https://github.com/gazebosim/sdformat\n[notation]: https://research.tue.nl/en/publications/multibody-dynamics-notation-version-2\n[passive_viewer_mujoco]: https://mujoco.readthedocs.io/en/stable/python.html#passive-viewer\n\n> [!WARNING]\n> This project is still experimental, APIs could change between releases without notice.\n\n> [!NOTE]\n> JaxSim currently focuses on locomotion applications.\n> Only contacts between bodies and smooth ground surfaces are supported.\n\n## Installation\n\n<details>\n<summary>With <code>conda</code></summary>\n\nYou can install the project using [`conda`][conda] as follows:\n\n```bash\nconda install jaxsim -c conda-forge\n```\n\nYou can enforce GPU support, if needed, by also specifying `\"jaxlib = * = *cuda*\"`.\n\n</details>\n\n<details>\n<summary>With <code>pixi</code></summary>\n\n> ### Note\n> The minimum version of `pixi` required is `0.39.0`.\n\nYou can add the jaxsim dependency in [`pixi`][pixi] project as follows:\n\n```bash\npixi add jaxsim\n```\n\nIf you are on Linux and you want to use a `cuda`-powered version of `jax`, remember to add the appropriate line in the [`system-requirements`](https://pixi.sh/latest/reference/pixi_manifest/#the-system-requirements-table) table, i.e. adding\n\n~~~toml\n[system-requirements]\ncuda = \"12\"\n~~~\n\nif you are using a `pixi.toml` file or\n\n~~~toml\n[tool.pixi.system-requirements]\ncuda = \"12\"\n~~~\n\nif you are using a `pyproject.toml` file.\n\n</details>\n\n<details>\n<summary>With <code>pip</code></summary>\n\nYou can install the project using [`pypa/pip`][pip], preferably in a [virtual environment][venv], as follows:\n\n```bash\npip install jaxsim\n```\n\nCheck [`pyproject.toml`](pyproject.toml) for the complete list of optional dependencies.\nYou can obtain a full installation using `jaxsim[all]`.\n\nIf you need GPU support, follow the official [installation instructions][jax_gpu] of JAX.\n\n</details>\n\n<details>\n<summary>Contributors installation (with <code>conda</code>)</summary>\n\nIf you want to contribute to the project, we recommend creating the following `jaxsim` conda environment first:\n\n```bash\nconda env create -f environment.yml\n```\n\nThen, activate the environment and install the project in editable mode:\n\n```bash\nconda activate jaxsim\npip install --no-deps -e .\n```\n\n</details>\n\n<details>\n<summary>Contributors installation (with <code>pixi</code>)</summary>\n\n> ### Note\n> The minimum version of `pixi` required is `0.39.0`.\n\nYou can install the default dependencies of the project using [`pixi`][pixi] as follows:\n\n```bash\npixi install\n```\n\nSee `pixi task list` for a list of available tasks.\n\n</details>\n\n[conda]: https://anaconda.org/\n[pip]: https://github.com/pypa/pip/\n[pixi]: https://pixi.sh/\n[venv]: https://docs.python.org/3/tutorial/venv.html\n[jax_gpu]: https://github.com/google/jax/#installation\n\n## Documentation\n\nThe JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs].\n\n[readthedocs]: https://jaxsim.readthedocs.io/\n\n\n## Overview\n\n<details>\n<summary>Structure of the Python package</summary>\n\n```\n# tree -L 2 -I \"__pycache__\" -I \"__init__*\" -I \"__main__*\" src/jaxsim\n\nsrc/jaxsim\n|-- api..........................# Package containing the main functional APIs.\n|   |-- com.py...................# |-- APIs for computing quantities related to the center of mass.\n|   |-- common.py................# |-- Common utilities used in the current package.\n|   |-- contact.py...............# |-- APIs for computing quantities related to the collidable points.\n|   |-- data.py..................# |-- Class storing the data of a simulated model.\n|   |-- frame.py.................# |-- APIs for computing quantities related to additional frames.\n|   |-- joint.py.................# |-- APIs for computing quantities related to the joints.\n|   |-- kin_dyn_parameters.py....# |-- Class storing kinematic and dynamic parameters of a model.\n|   |-- link.py..................# |-- APIs for computing quantities related to the links.\n|   |-- model.py.................# |-- Class defining a simulated model and APIs for computing related quantities.\n|   |-- ode.py...................# |-- APIs for computing quantities related to the system dynamics.\n|   |-- ode_data.py..............# |-- Set of classes to store the data of the system dynamics.\n|   `-- references.py............# `-- Helper class to create references (link forces and joint torques).\n|-- exceptions.py................# Module containing functions to raise exceptions from JIT-compiled functions.\n|-- integrators..................# Package containing the integrators used to simulate the system dynamics.\n|   |-- common.py................# |-- Common utilities used in the current package.\n|   |-- fixed_step.py............# |-- Fixed-step integrators (explicit Runge-Kutta schemes).\n|   `-- variable_step.py.........# `-- Variable-step integrators (embedded Runge-Kutta schemes).\n|-- logging.py...................# Module containing logging utilities.\n|-- math.........................# Package containing mathematical utilities.\n|   |-- adjoint.py...............# |-- APIs for creating and manipulating 6D transformations.\n|   |-- cross.py.................# |-- APIs for computing cross products of 6D quantities.\n|   |-- inertia.py...............# |-- APIs for creating and manipulating 6D inertia matrices.\n|   |-- joint_model.py...........# |-- APIs defining the supported joint model and the corresponding transformations.\n|   |-- quaternion.py............# |-- APIs for creating and manipulating quaternions.\n|   |-- rotation.py..............# |-- APIs for creating and manipulating rotation matrices.\n|   |-- skew.py..................# |-- APIs for creating and manipulating skew-symmetric matrices.\n|   `-- transform.py.............# `-- APIs for creating and manipulating homogeneous transformations.\n|-- mujoco.......................# Package containing utilities to interact with the Mujoco passive viewer.\n|   |-- loaders.py...............# |-- Utilities for converting JaxSim models to Mujoco models.\n|   |-- model.py.................# |-- Class providing high-level methods to compute quantities using Mujoco.\n|   `-- visualizer.py............# `-- Class that simplifies opening the passive viewer and recording videos.\n|-- parsers......................# Package containing utilities to parse model descriptions (SDF and URDF models).\n|   |-- descriptions/............# |-- Package containing the intermediate representation of a model description.\n|   |-- kinematic_graph.py.......# |-- Definition of the kinematic graph associated with a parsed model description.\n|   `-- rod/.....................# `-- Package to create the intermediate representation from model descriptions using ROD.\n|-- rbda.........................# Package containing the low-level rigid body dynamics algorithms.\n|   |-- aba.py...................# |-- The Articulated Body Algorithm.\n|   |-- collidable_points.py.....# |-- Kinematics of collidable points.\n|   |-- contacts/................# |-- Package containing the supported contact models.\n|   |-- crba.py..................# |-- The Composite Rigid Body Algorithm.\n|   |-- forward_kinematics.py....# |-- Forward kinematics of the model.\n|   |-- jacobian.py..............# |-- Full Jacobian and full Jacobian derivative.\n|   |-- rnea.py..................# |-- The Recursive Newton-Euler Algorithm.\n|   `-- utils.py.................# `-- Common utilities used in the current package.\n|-- terrain......................# Package containing resources to specify the terrain.\n|   `-- terrain.py...............# `-- Classes defining the supported terrains.\n|-- typing.py....................# Module containing type hints.\n`-- utils........................# Package of common utilities.\n    |-- jaxsim_dataclass.py......# |-- Utilities to operate on pytree dataclasses.\n    |-- tracing.py...............# |-- Utilities to use when JAX is tracing functions.\n    `-- wrappers.py..............# `-- Utilities to wrap objects for specific use cases on pytree dataclass attributes.\n```\n\n</details>\n\n## Credits\n\nThe RBDAs are based on the theory of the [Rigid Body Dynamics Algorithms][RBDA]\nbook by Roy Featherstone.\nThe algorithms and some simulation features were inspired by its accompanying [code][spatial_v2].\n\n[RBDA]: https://link.springer.com/book/10.1007/978-1-4899-7560-7\n[spatial_v2]: http://royfeatherstone.org/spatial/index.html#spatial-software\n\nThe development of JaxSim started in late 2021, inspired by early versions of [`google/brax`][brax].\nAt that time, Brax was implemented in maximal coordinates, and we wanted a physics engine in reduced coordinates.\nWe are grateful to the Brax team for their work and showing the potential of [JAX][jax] in this field.\n\nBrax v2 was later implemented reduced coordinates, following an approach comparable to JaxSim.\nThe development then shifted to [MJX][mjx], which today provides a JAX-based implementation of the Mujoco APIs.\n\nThe main differences between MJX/Brax and JaxSim are as follows:\n\n- JaxSim supports out-of-the-box all SDF models with [Pose Frame Semantics][PFS].\n- JaxSim only supports collisions between points rigidly attached to bodies and a compliant ground surface.\n  Our contact model requires careful tuning of its spring-damper parameters, but being an instantaneous\n  function of the state $(\\mathbf{q}, \\boldsymbol{\\nu})$, it doesn't require running any optimization algorithm\n  when stepping the simulation forward.\n- JaxSim mitigates the stiffness of the contact-aware system dynamics by providing variable-step integrators.\n\n[brax]: https://github.com/google/brax\n[mjx]: https://mujoco.readthedocs.io/en/3.0.0/mjx.html\n[PFS]: http://sdformat.org/tutorials?tut=pose_frame_semantics\n\n## Contributing\n\nWe welcome contributions from the community.\nPlease read the [contributing guide](./CONTRIBUTING.md) to get started.\n\n## Citing\n\n```bibtex\n@software{ferigo_jaxsim_2022,\n  author = {Diego Ferigo and Filippo Luca Ferretti and Silvio Traversaro and Daniele Pucci},\n  title = {{JaxSim}: A Differentiable Physics Engine and Multibody Dynamics Library for Control and Robot Learning},\n  url = {http://github.com/ami-iit/jaxsim},\n  year = {2022},\n}\n```\n\nTheoretical aspects of JaxSim are based on Chapters 7 and 8 of the following Ph.D. thesis:\n\n```bibtex\n@phdthesis{ferigo_phd_thesis_2022,\n  title = {Simulation Architectures for Reinforcement Learning applied to Robotics},\n  author = {Diego Ferigo},\n  school = {University of Manchester},\n  type = {PhD Thesis},\n  month = {July},\n  year = {2022},\n}\n```\n\n## People\n\n| Authors | Maintainers |\n|:------:|:-----------:|\n| [<img src=\"https://avatars.githubusercontent.com/u/469199?v=4\" width=\"40\">][df] [<img src=\"https://avatars.githubusercontent.com/u/102977828?v=4\" width=\"40\">][ff] | [<img src=\"https://avatars.githubusercontent.com/u/102977828?v=4\" width=\"40\">][ff] [<img src=\"https://avatars.githubusercontent.com/u/57228872?v=4\" width=\"40\">][ac] |\n\n[df]: https://github.com/diegoferigo\n[ff]: https://github.com/flferretti\n[ac]: https://github.com/xela-95\n\n## License\n\n[BSD3](https://choosealicense.com/licenses/bsd-3-clause/)\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2022, Artificial and Mechanical Intelligence All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "A differentiable physics engine and multibody dynamics library for control and robot learning.",
    "version": "0.6.0",
    "project_urls": {
        "Changelog": "https://github.com/ami-iit/jaxsim/releases",
        "Documentation": "https://jaxsim.readthedocs.io",
        "Source": "https://github.com/ami-iit/jaxsim",
        "Tracker": "https://github.com/ami-iit/jaxsim/issues"
    },
    "split_keywords": [
        "physics",
        " physics engine",
        " jax",
        " rigid body dynamics",
        " featherstone",
        " reinforcement learning",
        " robot",
        " robotics",
        " sdf",
        " urdf"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "012c9a8356a66ff6ed12d8e8cc527d01ff890ae976811d76fc31acd64baea9b0",
                "md5": "b2874ab104e7f3d7cb60981b5edb45fe",
                "sha256": "a6fdfde890c243b21fe345a96288235b556b95eedc1eb62463e34423535e7c8a"
            },
            "downloads": -1,
            "filename": "jaxsim-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b2874ab104e7f3d7cb60981b5edb45fe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 174858,
            "upload_time": "2025-01-10T17:04:36",
            "upload_time_iso_8601": "2025-01-10T17:04:36.720402Z",
            "url": "https://files.pythonhosted.org/packages/01/2c/9a8356a66ff6ed12d8e8cc527d01ff890ae976811d76fc31acd64baea9b0/jaxsim-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0fe4586bbbde0465fcfbb85aaeb69fba962610a8febac698cccf1ebd06918abe",
                "md5": "c9677e75e6f2d6bd6cd66c473316d14f",
                "sha256": "3a407f5d6cda2c3c3d6b138557f4506915ed6481d1f0bd7c8b5e8732b01898bc"
            },
            "downloads": -1,
            "filename": "jaxsim-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c9677e75e6f2d6bd6cd66c473316d14f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 203415,
            "upload_time": "2025-01-10T17:04:40",
            "upload_time_iso_8601": "2025-01-10T17:04:40.150402Z",
            "url": "https://files.pythonhosted.org/packages/0f/e4/586bbbde0465fcfbb85aaeb69fba962610a8febac698cccf1ebd06918abe/jaxsim-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 17:04:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ami-iit",
    "github_project": "jaxsim",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jaxsim"
}
        
Elapsed time: 0.45910s