jaxsim 0.2.dev191__py3-none-any.whl → 0.6.1.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jaxsim/__init__.py +73 -22
- jaxsim/_version.py +2 -2
- jaxsim/api/__init__.py +13 -1
- jaxsim/api/com.py +423 -0
- jaxsim/api/common.py +48 -19
- jaxsim/api/contact.py +604 -52
- jaxsim/api/data.py +308 -163
- jaxsim/api/frame.py +471 -0
- jaxsim/api/joint.py +166 -37
- jaxsim/api/kin_dyn_parameters.py +901 -0
- jaxsim/api/link.py +277 -78
- jaxsim/api/model.py +1572 -362
- jaxsim/api/ode.py +324 -133
- jaxsim/api/ode_data.py +401 -0
- jaxsim/api/references.py +216 -80
- jaxsim/exceptions.py +80 -0
- jaxsim/integrators/__init__.py +2 -2
- jaxsim/integrators/common.py +191 -107
- jaxsim/integrators/fixed_step.py +97 -102
- jaxsim/integrators/variable_step.py +706 -0
- jaxsim/logging.py +1 -2
- jaxsim/math/__init__.py +13 -0
- jaxsim/math/adjoint.py +57 -22
- jaxsim/math/cross.py +16 -7
- jaxsim/math/inertia.py +10 -8
- jaxsim/math/joint_model.py +289 -0
- jaxsim/math/quaternion.py +54 -20
- jaxsim/math/rotation.py +27 -21
- jaxsim/math/skew.py +16 -5
- jaxsim/math/transform.py +102 -0
- jaxsim/math/utils.py +31 -0
- jaxsim/mujoco/__init__.py +2 -1
- jaxsim/mujoco/loaders.py +216 -29
- jaxsim/mujoco/model.py +163 -33
- jaxsim/mujoco/utils.py +228 -0
- jaxsim/mujoco/visualizer.py +107 -22
- jaxsim/parsers/__init__.py +0 -1
- jaxsim/parsers/descriptions/__init__.py +8 -2
- jaxsim/parsers/descriptions/collision.py +83 -26
- jaxsim/parsers/descriptions/joint.py +80 -87
- jaxsim/parsers/descriptions/link.py +58 -31
- jaxsim/parsers/descriptions/model.py +101 -68
- jaxsim/parsers/kinematic_graph.py +606 -229
- jaxsim/parsers/rod/meshes.py +104 -0
- jaxsim/parsers/rod/parser.py +125 -82
- jaxsim/parsers/rod/utils.py +127 -82
- jaxsim/rbda/__init__.py +11 -0
- jaxsim/rbda/aba.py +289 -0
- jaxsim/rbda/collidable_points.py +156 -0
- jaxsim/rbda/contacts/__init__.py +13 -0
- jaxsim/rbda/contacts/common.py +313 -0
- jaxsim/rbda/contacts/relaxed_rigid.py +605 -0
- jaxsim/rbda/contacts/rigid.py +462 -0
- jaxsim/rbda/contacts/soft.py +480 -0
- jaxsim/rbda/contacts/visco_elastic.py +1066 -0
- jaxsim/rbda/crba.py +167 -0
- jaxsim/rbda/forward_kinematics.py +117 -0
- jaxsim/rbda/jacobian.py +330 -0
- jaxsim/rbda/rnea.py +235 -0
- jaxsim/rbda/utils.py +160 -0
- jaxsim/terrain/__init__.py +2 -0
- jaxsim/terrain/terrain.py +238 -0
- jaxsim/typing.py +24 -24
- jaxsim/utils/__init__.py +1 -4
- jaxsim/utils/jaxsim_dataclass.py +289 -34
- jaxsim/utils/tracing.py +5 -11
- jaxsim/utils/wrappers.py +159 -0
- {jaxsim-0.2.dev191.dist-info → jaxsim-0.6.1.dev2.dist-info}/LICENSE +1 -1
- jaxsim-0.6.1.dev2.dist-info/METADATA +465 -0
- jaxsim-0.6.1.dev2.dist-info/RECORD +74 -0
- {jaxsim-0.2.dev191.dist-info → jaxsim-0.6.1.dev2.dist-info}/WHEEL +1 -1
- jaxsim/high_level/__init__.py +0 -2
- jaxsim/high_level/common.py +0 -11
- jaxsim/high_level/joint.py +0 -148
- jaxsim/high_level/link.py +0 -259
- jaxsim/high_level/model.py +0 -1686
- jaxsim/math/conv.py +0 -114
- jaxsim/math/joint.py +0 -102
- jaxsim/math/plucker.py +0 -100
- jaxsim/physics/__init__.py +0 -12
- jaxsim/physics/algos/__init__.py +0 -0
- jaxsim/physics/algos/aba.py +0 -254
- jaxsim/physics/algos/aba_motors.py +0 -284
- jaxsim/physics/algos/crba.py +0 -154
- jaxsim/physics/algos/forward_kinematics.py +0 -79
- jaxsim/physics/algos/jacobian.py +0 -98
- jaxsim/physics/algos/rnea.py +0 -180
- jaxsim/physics/algos/rnea_motors.py +0 -196
- jaxsim/physics/algos/soft_contacts.py +0 -523
- jaxsim/physics/algos/terrain.py +0 -78
- jaxsim/physics/algos/utils.py +0 -69
- jaxsim/physics/model/__init__.py +0 -0
- jaxsim/physics/model/ground_contact.py +0 -53
- jaxsim/physics/model/physics_model.py +0 -388
- jaxsim/physics/model/physics_model_state.py +0 -283
- jaxsim/simulation/__init__.py +0 -4
- jaxsim/simulation/integrators.py +0 -393
- jaxsim/simulation/ode.py +0 -290
- jaxsim/simulation/ode_data.py +0 -96
- jaxsim/simulation/ode_integration.py +0 -62
- jaxsim/simulation/simulator.py +0 -543
- jaxsim/simulation/simulator_callbacks.py +0 -79
- jaxsim/simulation/utils.py +0 -15
- jaxsim/sixd/__init__.py +0 -2
- jaxsim/utils/oop.py +0 -536
- jaxsim/utils/vmappable.py +0 -117
- jaxsim-0.2.dev191.dist-info/METADATA +0 -184
- jaxsim-0.2.dev191.dist-info/RECORD +0 -81
- {jaxsim-0.2.dev191.dist-info → jaxsim-0.6.1.dev2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,465 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: jaxsim
|
3
|
+
Version: 0.6.1.dev2
|
4
|
+
Summary: A differentiable physics engine and multibody dynamics library for control and robot learning.
|
5
|
+
Author-email: Diego Ferigo <dgferigo@gmail.com>, Filippo Luca Ferretti <filippoluca.ferretti@outlook.com>
|
6
|
+
Maintainer-email: Filippo Luca Ferretti <filippo.ferretti@iit.it>, Alessandro Croci <alessandro.croci@iit.it>
|
7
|
+
License: BSD 3-Clause License
|
8
|
+
|
9
|
+
Copyright (c) 2022, Artificial and Mechanical Intelligence
|
10
|
+
All rights reserved.
|
11
|
+
|
12
|
+
Redistribution and use in source and binary forms, with or without
|
13
|
+
modification, are permitted provided that the following conditions are met:
|
14
|
+
|
15
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
16
|
+
list of conditions and the following disclaimer.
|
17
|
+
|
18
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
19
|
+
this list of conditions and the following disclaimer in the documentation
|
20
|
+
and/or other materials provided with the distribution.
|
21
|
+
|
22
|
+
3. Neither the name of the copyright holder nor the names of its
|
23
|
+
contributors may be used to endorse or promote products derived from
|
24
|
+
this software without specific prior written permission.
|
25
|
+
|
26
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
27
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
28
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
29
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
30
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
31
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
32
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
33
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
34
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
35
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
36
|
+
|
37
|
+
Project-URL: Changelog, https://github.com/ami-iit/jaxsim/releases
|
38
|
+
Project-URL: Documentation, https://jaxsim.readthedocs.io
|
39
|
+
Project-URL: Source, https://github.com/ami-iit/jaxsim
|
40
|
+
Project-URL: Tracker, https://github.com/ami-iit/jaxsim/issues
|
41
|
+
Keywords: physics,physics engine,jax,rigid body dynamics,featherstone,reinforcement learning,robot,robotics,sdf,urdf
|
42
|
+
Classifier: Development Status :: 4 - Beta
|
43
|
+
Classifier: Framework :: Robot Framework
|
44
|
+
Classifier: Intended Audience :: Developers
|
45
|
+
Classifier: Intended Audience :: Science/Research
|
46
|
+
Classifier: License :: OSI Approved :: BSD License
|
47
|
+
Classifier: Operating System :: POSIX :: Linux
|
48
|
+
Classifier: Operating System :: MacOS
|
49
|
+
Classifier: Operating System :: Microsoft
|
50
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
51
|
+
Classifier: Programming Language :: Python :: 3.10
|
52
|
+
Classifier: Programming Language :: Python :: 3.11
|
53
|
+
Classifier: Programming Language :: Python :: 3.12
|
54
|
+
Classifier: Programming Language :: Python :: 3.13
|
55
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
56
|
+
Classifier: Topic :: Games/Entertainment :: Simulation
|
57
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
58
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
59
|
+
Classifier: Topic :: Software Development
|
60
|
+
Requires-Python: >=3.10
|
61
|
+
Description-Content-Type: text/markdown
|
62
|
+
License-File: LICENSE
|
63
|
+
Requires-Dist: coloredlogs
|
64
|
+
Requires-Dist: jax>=0.4.26
|
65
|
+
Requires-Dist: jaxlib>=0.4.26
|
66
|
+
Requires-Dist: jaxlie>=1.3.0
|
67
|
+
Requires-Dist: jax_dataclasses>=1.4.0
|
68
|
+
Requires-Dist: pptree
|
69
|
+
Requires-Dist: optax>=0.2.3
|
70
|
+
Requires-Dist: qpax
|
71
|
+
Requires-Dist: rod>=0.3.3
|
72
|
+
Requires-Dist: typing_extensions; python_version < "3.12"
|
73
|
+
Requires-Dist: trimesh
|
74
|
+
Provides-Extra: style
|
75
|
+
Requires-Dist: black[jupyter]~=24.0; extra == "style"
|
76
|
+
Requires-Dist: isort; extra == "style"
|
77
|
+
Requires-Dist: pre-commit; extra == "style"
|
78
|
+
Provides-Extra: testing
|
79
|
+
Requires-Dist: idyntree>=12.2.1; extra == "testing"
|
80
|
+
Requires-Dist: pytest>=6.0; extra == "testing"
|
81
|
+
Requires-Dist: pytest-benchmark; extra == "testing"
|
82
|
+
Requires-Dist: pytest-icdiff; extra == "testing"
|
83
|
+
Requires-Dist: robot-descriptions; extra == "testing"
|
84
|
+
Requires-Dist: icub-models; extra == "testing"
|
85
|
+
Provides-Extra: viz
|
86
|
+
Requires-Dist: lxml; extra == "viz"
|
87
|
+
Requires-Dist: mediapy; extra == "viz"
|
88
|
+
Requires-Dist: mujoco>=3.0.0; extra == "viz"
|
89
|
+
Requires-Dist: scipy>=1.14.0; extra == "viz"
|
90
|
+
Provides-Extra: all
|
91
|
+
Requires-Dist: jaxsim[style,testing,viz]; extra == "all"
|
92
|
+
|
93
|
+
# JaxSim
|
94
|
+
|
95
|
+
**JaxSim** is a **differentiable physics engine** and **multibody dynamics library** built with JAX, tailored for control and robotic learning applications.
|
96
|
+
|
97
|
+
<div align="center">
|
98
|
+
<br/>
|
99
|
+
<table>
|
100
|
+
<tr>
|
101
|
+
<th><img src="https://github.com/user-attachments/assets/115b1c1c-6ae5-4c59-92e0-1be13ba954db" width="250"></th>
|
102
|
+
<th><img src="https://github.com/user-attachments/assets/f9661fae-9a85-41dd-9a58-218758ec8c9c" width="250"></th>
|
103
|
+
<th><img src="https://github.com/user-attachments/assets/ae8adadf-3bca-47b8-97ca-3a9273633d60" width="250"></th>
|
104
|
+
</tr>
|
105
|
+
</table>
|
106
|
+
<br/>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
## Features
|
110
|
+
- Reduced-coordinate physics engine for **fixed-base** and **floating-base** robots.
|
111
|
+
- Multibody dynamics library for model-based control algorithms.
|
112
|
+
- Fully Python-based, leveraging [jax][jax] following a functional programming paradigm.
|
113
|
+
- Seamless execution on CPUs, GPUs, and TPUs.
|
114
|
+
- Supports JIT compilation and automatic vectorization for high performance.
|
115
|
+
- Compatible with SDF models and URDF (via [sdformat][sdformat] conversion).
|
116
|
+
|
117
|
+
## Usage
|
118
|
+
|
119
|
+
### Using JaxSim as simulator
|
120
|
+
|
121
|
+
|
122
|
+
```python
|
123
|
+
import jax.numpy as jnp
|
124
|
+
import jaxsim.api as js
|
125
|
+
import icub_models
|
126
|
+
import pathlib
|
127
|
+
|
128
|
+
# Load the iCub model
|
129
|
+
model_path = icub_models.get_model_file("iCubGazeboV2_5")
|
130
|
+
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
|
131
|
+
'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
|
132
|
+
'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
|
133
|
+
'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
|
134
|
+
'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
|
135
|
+
'r_ankle_roll')
|
136
|
+
|
137
|
+
# Build and reduce the model
|
138
|
+
model_description = pathlib.Path(model_path)
|
139
|
+
full_model = js.model.JaxSimModel.build_from_model_description(
|
140
|
+
model_description=model_description, time_step=0.0001, is_urdf=True
|
141
|
+
)
|
142
|
+
model = js.model.reduce(model=full_model, considered_joints=joints)
|
143
|
+
|
144
|
+
ndof = model.dofs()
|
145
|
+
# Initialize data and simulation
|
146
|
+
data = js.data.JaxSimModelData.zero(model=model).reset_base_position(
|
147
|
+
base_position=jnp.array([0.0, 0.0, 1.0])
|
148
|
+
)
|
149
|
+
T = jnp.arange(start=0, stop=1.0, step=model.time_step)
|
150
|
+
tau = jnp.zeros(ndof)
|
151
|
+
|
152
|
+
# Simulate
|
153
|
+
for t in T:
|
154
|
+
data, _ = js.model.step(model=model, data=data, link_forces=None, joint_force_references=tau)
|
155
|
+
|
156
|
+
```
|
157
|
+
|
158
|
+
### Using JaxSim as a multibody dynamics library
|
159
|
+
``` python
|
160
|
+
import jax.numpy as jnp
|
161
|
+
import jaxsim.api as js
|
162
|
+
import icub_models
|
163
|
+
import pathlib
|
164
|
+
|
165
|
+
# Load the iCub model
|
166
|
+
model_path = icub_models.get_model_file("iCubGazeboV2_5")
|
167
|
+
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
|
168
|
+
'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
|
169
|
+
'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
|
170
|
+
'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
|
171
|
+
'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
|
172
|
+
'r_ankle_roll')
|
173
|
+
|
174
|
+
# Build and reduce the model
|
175
|
+
model_description = pathlib.Path(model_path)
|
176
|
+
full_model = js.model.JaxSimModel.build_from_model_description(
|
177
|
+
model_description=model_description, time_step=0.0001, is_urdf=True
|
178
|
+
)
|
179
|
+
model = js.model.reduce(model=full_model, considered_joints=joints)
|
180
|
+
|
181
|
+
# Initialize model data
|
182
|
+
data = js.data.JaxSimModelData.build(
|
183
|
+
model=model,
|
184
|
+
base_position=jnp.array([0.0, 0.0, 1.0],
|
185
|
+
)
|
186
|
+
|
187
|
+
# Frame and dynamics computations
|
188
|
+
frame_index = js.frame.name_to_idx(model=model, frame_name="l_foot")
|
189
|
+
W_H_F = js.frame.transform(model=model, data=data, frame_index=frame_index) # Frame transformation
|
190
|
+
W_J_F = js.frame.jacobian(model=model, data=data, frame_index=frame_index) # Frame Jacobian
|
191
|
+
|
192
|
+
# Dynamics properties
|
193
|
+
M = js.model.free_floating_mass_matrix(model=model, data=data) # Mass matrix
|
194
|
+
h = js.model.free_floating_bias_forces(model=model, data=data) # Bias forces
|
195
|
+
g = js.model.free_floating_gravity_forces(model=model, data=data) # Gravity forces
|
196
|
+
C = js.model.free_floating_coriolis_matrix(model=model, data=data) # Coriolis matrix
|
197
|
+
|
198
|
+
# Print dynamics results
|
199
|
+
print(f"M: shape={M.shape}, h: shape={h.shape}, g: shape={g.shape}, C: shape={C.shape}")
|
200
|
+
|
201
|
+
```
|
202
|
+
### Additional features
|
203
|
+
|
204
|
+
- Full support for automatic differentiation of RBDAs (forward and reverse modes) with JAX.
|
205
|
+
- Support for automatically differentiating against kinematics and dynamics parameters.
|
206
|
+
- All fixed-step integrators are forward and reverse differentiable.
|
207
|
+
- All variable-step integrators are forward differentiable.
|
208
|
+
- Check the example folder for additional usecase !
|
209
|
+
|
210
|
+
[jax]: https://github.com/google/jax/
|
211
|
+
[sdformat]: https://github.com/gazebosim/sdformat
|
212
|
+
[notation]: https://research.tue.nl/en/publications/multibody-dynamics-notation-version-2
|
213
|
+
[passive_viewer_mujoco]: https://mujoco.readthedocs.io/en/stable/python.html#passive-viewer
|
214
|
+
|
215
|
+
> [!WARNING]
|
216
|
+
> This project is still experimental, APIs could change between releases without notice.
|
217
|
+
|
218
|
+
> [!NOTE]
|
219
|
+
> JaxSim currently focuses on locomotion applications.
|
220
|
+
> Only contacts between bodies and smooth ground surfaces are supported.
|
221
|
+
|
222
|
+
## Installation
|
223
|
+
|
224
|
+
<details>
|
225
|
+
<summary>With <code>conda</code></summary>
|
226
|
+
|
227
|
+
You can install the project using [`conda`][conda] as follows:
|
228
|
+
|
229
|
+
```bash
|
230
|
+
conda install jaxsim -c conda-forge
|
231
|
+
```
|
232
|
+
|
233
|
+
You can enforce GPU support, if needed, by also specifying `"jaxlib = * = *cuda*"`.
|
234
|
+
|
235
|
+
</details>
|
236
|
+
|
237
|
+
<details>
|
238
|
+
<summary>With <code>pixi</code></summary>
|
239
|
+
|
240
|
+
> ### Note
|
241
|
+
> The minimum version of `pixi` required is `0.39.0`.
|
242
|
+
|
243
|
+
You can add the jaxsim dependency in [`pixi`][pixi] project as follows:
|
244
|
+
|
245
|
+
```bash
|
246
|
+
pixi add jaxsim
|
247
|
+
```
|
248
|
+
|
249
|
+
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
|
250
|
+
|
251
|
+
~~~toml
|
252
|
+
[system-requirements]
|
253
|
+
cuda = "12"
|
254
|
+
~~~
|
255
|
+
|
256
|
+
if you are using a `pixi.toml` file or
|
257
|
+
|
258
|
+
~~~toml
|
259
|
+
[tool.pixi.system-requirements]
|
260
|
+
cuda = "12"
|
261
|
+
~~~
|
262
|
+
|
263
|
+
if you are using a `pyproject.toml` file.
|
264
|
+
|
265
|
+
</details>
|
266
|
+
|
267
|
+
<details>
|
268
|
+
<summary>With <code>pip</code></summary>
|
269
|
+
|
270
|
+
You can install the project using [`pypa/pip`][pip], preferably in a [virtual environment][venv], as follows:
|
271
|
+
|
272
|
+
```bash
|
273
|
+
pip install jaxsim
|
274
|
+
```
|
275
|
+
|
276
|
+
Check [`pyproject.toml`](pyproject.toml) for the complete list of optional dependencies.
|
277
|
+
You can obtain a full installation using `jaxsim[all]`.
|
278
|
+
|
279
|
+
If you need GPU support, follow the official [installation instructions][jax_gpu] of JAX.
|
280
|
+
|
281
|
+
</details>
|
282
|
+
|
283
|
+
<details>
|
284
|
+
<summary>Contributors installation (with <code>conda</code>)</summary>
|
285
|
+
|
286
|
+
If you want to contribute to the project, we recommend creating the following `jaxsim` conda environment first:
|
287
|
+
|
288
|
+
```bash
|
289
|
+
conda env create -f environment.yml
|
290
|
+
```
|
291
|
+
|
292
|
+
Then, activate the environment and install the project in editable mode:
|
293
|
+
|
294
|
+
```bash
|
295
|
+
conda activate jaxsim
|
296
|
+
pip install --no-deps -e .
|
297
|
+
```
|
298
|
+
|
299
|
+
</details>
|
300
|
+
|
301
|
+
<details>
|
302
|
+
<summary>Contributors installation (with <code>pixi</code>)</summary>
|
303
|
+
|
304
|
+
> ### Note
|
305
|
+
> The minimum version of `pixi` required is `0.39.0`.
|
306
|
+
|
307
|
+
You can install the default dependencies of the project using [`pixi`][pixi] as follows:
|
308
|
+
|
309
|
+
```bash
|
310
|
+
pixi install
|
311
|
+
```
|
312
|
+
|
313
|
+
See `pixi task list` for a list of available tasks.
|
314
|
+
|
315
|
+
</details>
|
316
|
+
|
317
|
+
[conda]: https://anaconda.org/
|
318
|
+
[pip]: https://github.com/pypa/pip/
|
319
|
+
[pixi]: https://pixi.sh/
|
320
|
+
[venv]: https://docs.python.org/3/tutorial/venv.html
|
321
|
+
[jax_gpu]: https://github.com/google/jax/#installation
|
322
|
+
|
323
|
+
## Documentation
|
324
|
+
|
325
|
+
The JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs].
|
326
|
+
|
327
|
+
[readthedocs]: https://jaxsim.readthedocs.io/
|
328
|
+
|
329
|
+
|
330
|
+
## Overview
|
331
|
+
|
332
|
+
<details>
|
333
|
+
<summary>Structure of the Python package</summary>
|
334
|
+
|
335
|
+
```
|
336
|
+
# tree -L 2 -I "__pycache__" -I "__init__*" -I "__main__*" src/jaxsim
|
337
|
+
|
338
|
+
src/jaxsim
|
339
|
+
|-- api..........................# Package containing the main functional APIs.
|
340
|
+
| |-- com.py...................# |-- APIs for computing quantities related to the center of mass.
|
341
|
+
| |-- common.py................# |-- Common utilities used in the current package.
|
342
|
+
| |-- contact.py...............# |-- APIs for computing quantities related to the collidable points.
|
343
|
+
| |-- data.py..................# |-- Class storing the data of a simulated model.
|
344
|
+
| |-- frame.py.................# |-- APIs for computing quantities related to additional frames.
|
345
|
+
| |-- joint.py.................# |-- APIs for computing quantities related to the joints.
|
346
|
+
| |-- kin_dyn_parameters.py....# |-- Class storing kinematic and dynamic parameters of a model.
|
347
|
+
| |-- link.py..................# |-- APIs for computing quantities related to the links.
|
348
|
+
| |-- model.py.................# |-- Class defining a simulated model and APIs for computing related quantities.
|
349
|
+
| |-- ode.py...................# |-- APIs for computing quantities related to the system dynamics.
|
350
|
+
| |-- ode_data.py..............# |-- Set of classes to store the data of the system dynamics.
|
351
|
+
| `-- references.py............# `-- Helper class to create references (link forces and joint torques).
|
352
|
+
|-- exceptions.py................# Module containing functions to raise exceptions from JIT-compiled functions.
|
353
|
+
|-- integrators..................# Package containing the integrators used to simulate the system dynamics.
|
354
|
+
| |-- common.py................# |-- Common utilities used in the current package.
|
355
|
+
| |-- fixed_step.py............# |-- Fixed-step integrators (explicit Runge-Kutta schemes).
|
356
|
+
| `-- variable_step.py.........# `-- Variable-step integrators (embedded Runge-Kutta schemes).
|
357
|
+
|-- logging.py...................# Module containing logging utilities.
|
358
|
+
|-- math.........................# Package containing mathematical utilities.
|
359
|
+
| |-- adjoint.py...............# |-- APIs for creating and manipulating 6D transformations.
|
360
|
+
| |-- cross.py.................# |-- APIs for computing cross products of 6D quantities.
|
361
|
+
| |-- inertia.py...............# |-- APIs for creating and manipulating 6D inertia matrices.
|
362
|
+
| |-- joint_model.py...........# |-- APIs defining the supported joint model and the corresponding transformations.
|
363
|
+
| |-- quaternion.py............# |-- APIs for creating and manipulating quaternions.
|
364
|
+
| |-- rotation.py..............# |-- APIs for creating and manipulating rotation matrices.
|
365
|
+
| |-- skew.py..................# |-- APIs for creating and manipulating skew-symmetric matrices.
|
366
|
+
| `-- transform.py.............# `-- APIs for creating and manipulating homogeneous transformations.
|
367
|
+
|-- mujoco.......................# Package containing utilities to interact with the Mujoco passive viewer.
|
368
|
+
| |-- loaders.py...............# |-- Utilities for converting JaxSim models to Mujoco models.
|
369
|
+
| |-- model.py.................# |-- Class providing high-level methods to compute quantities using Mujoco.
|
370
|
+
| `-- visualizer.py............# `-- Class that simplifies opening the passive viewer and recording videos.
|
371
|
+
|-- parsers......................# Package containing utilities to parse model descriptions (SDF and URDF models).
|
372
|
+
| |-- descriptions/............# |-- Package containing the intermediate representation of a model description.
|
373
|
+
| |-- kinematic_graph.py.......# |-- Definition of the kinematic graph associated with a parsed model description.
|
374
|
+
| `-- rod/.....................# `-- Package to create the intermediate representation from model descriptions using ROD.
|
375
|
+
|-- rbda.........................# Package containing the low-level rigid body dynamics algorithms.
|
376
|
+
| |-- aba.py...................# |-- The Articulated Body Algorithm.
|
377
|
+
| |-- collidable_points.py.....# |-- Kinematics of collidable points.
|
378
|
+
| |-- contacts/................# |-- Package containing the supported contact models.
|
379
|
+
| |-- crba.py..................# |-- The Composite Rigid Body Algorithm.
|
380
|
+
| |-- forward_kinematics.py....# |-- Forward kinematics of the model.
|
381
|
+
| |-- jacobian.py..............# |-- Full Jacobian and full Jacobian derivative.
|
382
|
+
| |-- rnea.py..................# |-- The Recursive Newton-Euler Algorithm.
|
383
|
+
| `-- utils.py.................# `-- Common utilities used in the current package.
|
384
|
+
|-- terrain......................# Package containing resources to specify the terrain.
|
385
|
+
| `-- terrain.py...............# `-- Classes defining the supported terrains.
|
386
|
+
|-- typing.py....................# Module containing type hints.
|
387
|
+
`-- utils........................# Package of common utilities.
|
388
|
+
|-- jaxsim_dataclass.py......# |-- Utilities to operate on pytree dataclasses.
|
389
|
+
|-- tracing.py...............# |-- Utilities to use when JAX is tracing functions.
|
390
|
+
`-- wrappers.py..............# `-- Utilities to wrap objects for specific use cases on pytree dataclass attributes.
|
391
|
+
```
|
392
|
+
|
393
|
+
</details>
|
394
|
+
|
395
|
+
## Credits
|
396
|
+
|
397
|
+
The RBDAs are based on the theory of the [Rigid Body Dynamics Algorithms][RBDA]
|
398
|
+
book by Roy Featherstone.
|
399
|
+
The algorithms and some simulation features were inspired by its accompanying [code][spatial_v2].
|
400
|
+
|
401
|
+
[RBDA]: https://link.springer.com/book/10.1007/978-1-4899-7560-7
|
402
|
+
[spatial_v2]: http://royfeatherstone.org/spatial/index.html#spatial-software
|
403
|
+
|
404
|
+
The development of JaxSim started in late 2021, inspired by early versions of [`google/brax`][brax].
|
405
|
+
At that time, Brax was implemented in maximal coordinates, and we wanted a physics engine in reduced coordinates.
|
406
|
+
We are grateful to the Brax team for their work and showing the potential of [JAX][jax] in this field.
|
407
|
+
|
408
|
+
Brax v2 was later implemented reduced coordinates, following an approach comparable to JaxSim.
|
409
|
+
The development then shifted to [MJX][mjx], which today provides a JAX-based implementation of the Mujoco APIs.
|
410
|
+
|
411
|
+
The main differences between MJX/Brax and JaxSim are as follows:
|
412
|
+
|
413
|
+
- JaxSim supports out-of-the-box all SDF models with [Pose Frame Semantics][PFS].
|
414
|
+
- JaxSim only supports collisions between points rigidly attached to bodies and a compliant ground surface.
|
415
|
+
Our contact model requires careful tuning of its spring-damper parameters, but being an instantaneous
|
416
|
+
function of the state $(\mathbf{q}, \boldsymbol{\nu})$, it doesn't require running any optimization algorithm
|
417
|
+
when stepping the simulation forward.
|
418
|
+
- JaxSim mitigates the stiffness of the contact-aware system dynamics by providing variable-step integrators.
|
419
|
+
|
420
|
+
[brax]: https://github.com/google/brax
|
421
|
+
[mjx]: https://mujoco.readthedocs.io/en/3.0.0/mjx.html
|
422
|
+
[PFS]: http://sdformat.org/tutorials?tut=pose_frame_semantics
|
423
|
+
|
424
|
+
## Contributing
|
425
|
+
|
426
|
+
We welcome contributions from the community.
|
427
|
+
Please read the [contributing guide](./CONTRIBUTING.md) to get started.
|
428
|
+
|
429
|
+
## Citing
|
430
|
+
|
431
|
+
```bibtex
|
432
|
+
@software{ferigo_jaxsim_2022,
|
433
|
+
author = {Diego Ferigo and Filippo Luca Ferretti and Silvio Traversaro and Daniele Pucci},
|
434
|
+
title = {{JaxSim}: A Differentiable Physics Engine and Multibody Dynamics Library for Control and Robot Learning},
|
435
|
+
url = {http://github.com/ami-iit/jaxsim},
|
436
|
+
year = {2022},
|
437
|
+
}
|
438
|
+
```
|
439
|
+
|
440
|
+
Theoretical aspects of JaxSim are based on Chapters 7 and 8 of the following Ph.D. thesis:
|
441
|
+
|
442
|
+
```bibtex
|
443
|
+
@phdthesis{ferigo_phd_thesis_2022,
|
444
|
+
title = {Simulation Architectures for Reinforcement Learning applied to Robotics},
|
445
|
+
author = {Diego Ferigo},
|
446
|
+
school = {University of Manchester},
|
447
|
+
type = {PhD Thesis},
|
448
|
+
month = {July},
|
449
|
+
year = {2022},
|
450
|
+
}
|
451
|
+
```
|
452
|
+
|
453
|
+
## People
|
454
|
+
|
455
|
+
| Authors | Maintainers |
|
456
|
+
|:------:|:-----------:|
|
457
|
+
| [<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] |
|
458
|
+
|
459
|
+
[df]: https://github.com/diegoferigo
|
460
|
+
[ff]: https://github.com/flferretti
|
461
|
+
[ac]: https://github.com/xela-95
|
462
|
+
|
463
|
+
## License
|
464
|
+
|
465
|
+
[BSD3](https://choosealicense.com/licenses/bsd-3-clause/)
|
@@ -0,0 +1,74 @@
|
|
1
|
+
jaxsim/__init__.py,sha256=_8rbKOf3bwx-2ChEbspZxs_rZY0RqUcmWAftnEw1bfM,3401
|
2
|
+
jaxsim/_version.py,sha256=XhkX4VADFUsjBRLLpHgnjaa0GQcyhAwL34o5pq73Ykk,424
|
3
|
+
jaxsim/exceptions.py,sha256=qjfTjE9lXvD3-JCPQcxxiX2XSS8QegawzQ6ZuC2tc0Y,2638
|
4
|
+
jaxsim/logging.py,sha256=STI-D_upXZYX-ZezLrlJJ0UlD5YspST0vZ_DcIwkzO4,1553
|
5
|
+
jaxsim/typing.py,sha256=7msl8t5Jt09RNYfKdPJtpjLfWurldcycDappb045Eso,761
|
6
|
+
jaxsim/api/__init__.py,sha256=8eV22t2S3UwNyCg8karPetG1dmX1VDBXkyv28_FwNQA,210
|
7
|
+
jaxsim/api/com.py,sha256=XovL7ytilPlGxU8KsAakaCK3F8coOBzRxdrsE0XGHKA,13816
|
8
|
+
jaxsim/api/common.py,sha256=jd3thxFUxcyoAMV3ZDMqfk2DlBdvWMZuI25Y0Pw5Dlo,7088
|
9
|
+
jaxsim/api/contact.py,sha256=8Bw0YhkjKKgVig4EMMiIGeJ10gosKslKADz8-dvJBdM,25541
|
10
|
+
jaxsim/api/data.py,sha256=S9btxn_KBA1HTI8VEGfYqiQ6pLeqsECbA99lR92hTI4,30191
|
11
|
+
jaxsim/api/frame.py,sha256=d6pa6vywGDqfaJU76F_-yjLJs6R3mrjZ6B-KXPu6f3Q,14595
|
12
|
+
jaxsim/api/joint.py,sha256=AnqlNWmBOay-gsoo0y4AbfFQ2OCJm-8T1E0IMhZeLoY,7457
|
13
|
+
jaxsim/api/kin_dyn_parameters.py,sha256=BaOp7ICxWosDIdWVjh8-cdlX8mXM9IM8wzy2fHz8Ufc,30444
|
14
|
+
jaxsim/api/link.py,sha256=nHjffhNdi_xGkteMsqdb_hC9mdV9rNw7k3pl89Uhw_8,12798
|
15
|
+
jaxsim/api/model.py,sha256=27U_3JxEvbCyPox76h2uxIKnpFHahxsGZCYZQy1vXf4,79859
|
16
|
+
jaxsim/api/ode.py,sha256=XFi3gGRU2s-hqOpZEAuk7o4cxEa871V1LmGcvT5wf10,16056
|
17
|
+
jaxsim/api/ode_data.py,sha256=ggF1AVaLW5QuXrfpNsFs-voVcW6gZkxK2Xe9GiDmou0,13755
|
18
|
+
jaxsim/api/references.py,sha256=YkdZhRv8NoBC94qvpwn1w9_alVuxrfiZV5w5NHQIt-g,20737
|
19
|
+
jaxsim/integrators/__init__.py,sha256=hxvOD-VK_mmd6v31wtC-nb28AYve1gLuZCNLV9wS-Kg,103
|
20
|
+
jaxsim/integrators/common.py,sha256=sXc0HLmqiGluU-ffsNcAxVO-UA4QzS96pjef5N-5rHI,20174
|
21
|
+
jaxsim/integrators/fixed_step.py,sha256=roiRR1evnQMPmdvY5D_iRHTYlbOvkG4CM6JDSqlmTAU,4034
|
22
|
+
jaxsim/integrators/variable_step.py,sha256=pMYiMbaqQTlq2VF4Ca78ovxU06lMF1mrnrfzAahtvcg,24577
|
23
|
+
jaxsim/math/__init__.py,sha256=2T1WUU_chNBCvyvkKSdiesPlckbo-gXVbCZEGoF-W0I,381
|
24
|
+
jaxsim/math/adjoint.py,sha256=ccXuF9jnMLpGhQ3vg1hu7V6zUz8D3rVMhj-bongdk9c,5019
|
25
|
+
jaxsim/math/cross.py,sha256=brlzoThCzQAHmuHubh1N_CLtvP5asR4iWXp-I1HAYFc,1522
|
26
|
+
jaxsim/math/inertia.py,sha256=Bh92FlJvJMMZg8825mzEzV3sHAAufJOSaQST1ZnzgSQ,1631
|
27
|
+
jaxsim/math/joint_model.py,sha256=EzAveaG5B6ZnCFNUzN30KEQUVesd83lfWXJarYR-kUw,9989
|
28
|
+
jaxsim/math/quaternion.py,sha256=fO3VNrIoZrcchCXCv_Zn2Ad6-rcgrNzysRrn5raQWJE,4595
|
29
|
+
jaxsim/math/rotation.py,sha256=bl9WCbYyLKg6RyRkMaEBBTmARBs8pB-FGR0JVbfbaNE,2187
|
30
|
+
jaxsim/math/skew.py,sha256=P82yeQs9Fzb7Ri_MAikcb54_06cE_syi9yPssSg4ydw,1426
|
31
|
+
jaxsim/math/transform.py,sha256=We0ChLajSckxGINiJsP1a5Ur3yjg3JuweQ3kK4Woix4,3332
|
32
|
+
jaxsim/math/utils.py,sha256=2id1F6QOvkHkIF3Nuxuj_tz_kI0IYlrlgVQrETmXFfI,1058
|
33
|
+
jaxsim/mujoco/__init__.py,sha256=1kAWzYOS7nP29S5FGyWPqiAnPf4yPSoaPW-WBGBjVV0,214
|
34
|
+
jaxsim/mujoco/__main__.py,sha256=GBmB7J-zj75ZnFyuAAmpSOpbxi_HhHhWJeot3ljGDJY,5291
|
35
|
+
jaxsim/mujoco/loaders.py,sha256=Jjb5Us9ERmLjejM4S1FcqrF12ZVkjBMZXelu9n6HGA4,23138
|
36
|
+
jaxsim/mujoco/model.py,sha256=tZWn2gpZSpQtwS5v7O5rGdjYNcEU6rnfAS6_ZKnZagE,16478
|
37
|
+
jaxsim/mujoco/utils.py,sha256=ZFEGvmz0xfbN-EKLOXVkcumqBKs5ywc49XGEnFOwBmU,8400
|
38
|
+
jaxsim/mujoco/visualizer.py,sha256=zkdu5qxZK0BGYotAHxoYQ5ZVTWSmwVZPQ3vTWGOik9E,7218
|
39
|
+
jaxsim/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
40
|
+
jaxsim/parsers/kinematic_graph.py,sha256=N6cn8Bh4uH92ygkoYFvazbi1Gq7svTojDiZVkhbxsRI,35897
|
41
|
+
jaxsim/parsers/descriptions/__init__.py,sha256=N_hp8cGI5FyEFiuNx9a-CAGCr0F0QpYEpdMHvwB7_1g,261
|
42
|
+
jaxsim/parsers/descriptions/collision.py,sha256=C6SekAPL2tNG62Y-lTqj1m9BblhoTZDj2F2vgspKNbI,4577
|
43
|
+
jaxsim/parsers/descriptions/joint.py,sha256=MurLIHHmu-y_bwUcR_J1NZ-FjfRZRk166zKsn6VzIwE,4232
|
44
|
+
jaxsim/parsers/descriptions/link.py,sha256=Eh0W5qL7_Uw0GV-BkNKXhm9Q2dRTfIWCX5D-87zQkxA,3711
|
45
|
+
jaxsim/parsers/descriptions/model.py,sha256=G7nYy4CTppj2NM7hTXP6xGJ2h5dwT41N1fsy0EYSIBk,9860
|
46
|
+
jaxsim/parsers/rod/__init__.py,sha256=G2vqlLajBLUc4gyzXwsEI2Wsi4TMOIF9bLDFeT6KrGU,92
|
47
|
+
jaxsim/parsers/rod/meshes.py,sha256=yAXefG73_zqbVKRUdlcz9yFmypjDIpiP9cO96PeAozE,2842
|
48
|
+
jaxsim/parsers/rod/parser.py,sha256=2AxRimQeYHHrdWLJrzXxPX9TUMOhuv10lqptfvG6wMQ,14405
|
49
|
+
jaxsim/parsers/rod/utils.py,sha256=Wb1TsZ2v0VgmswYqI5hHRtGQx4ttWK8luWO9cvllTEk,8117
|
50
|
+
jaxsim/rbda/__init__.py,sha256=kmy4G9aMkrqPNGdLSaSV3k15dpF52vBEUQXDFDuKIxU,337
|
51
|
+
jaxsim/rbda/aba.py,sha256=w7ciyxB0IsmueatT0C7PcBQEl9dyiH9oqJgIi3xeTUE,8983
|
52
|
+
jaxsim/rbda/collidable_points.py,sha256=0PFLzxWKtRg8-JtfNhGlSjBMv1J98tiLymOdvlvAak4,5325
|
53
|
+
jaxsim/rbda/crba.py,sha256=bXkXESnVbv-lxhU1Y_i0rViEcQA4z2t2_jHwdVj5CBo,5049
|
54
|
+
jaxsim/rbda/forward_kinematics.py,sha256=2GmEoWsrioVl_SAbKRKfhOLz57pY4aR81PKRdulqStA,3458
|
55
|
+
jaxsim/rbda/jacobian.py,sha256=L6Vn4Kf9I6wj-MYcFY6o67mgIfLFaaW4i2wNQJ2PDL0,10981
|
56
|
+
jaxsim/rbda/rnea.py,sha256=CLfqs9XFVaD-hvkLABshDAfdw5bm_AMV3UVAQ_IvURQ,7542
|
57
|
+
jaxsim/rbda/utils.py,sha256=GLt7XIl1ROkx0_fnBCKUHYdB9_IBF3Yi4OnkHSX3gxA,5365
|
58
|
+
jaxsim/rbda/contacts/__init__.py,sha256=L5MM-2pv76YPGzxExdz2EErgGBATuAjYnNHlq5QOySs,503
|
59
|
+
jaxsim/rbda/contacts/common.py,sha256=7ZveKD4ddhUaW_-7mU315zyFdCBgzo60TRK74SOdFpY,10574
|
60
|
+
jaxsim/rbda/contacts/relaxed_rigid.py,sha256=kwk1PoGtqE9e4n1ySNCIOoyZBSUkBj3BSKlgXFPZR6k,20563
|
61
|
+
jaxsim/rbda/contacts/rigid.py,sha256=ISaUwE5vk4TlcDTYWd9q3SXT215_YrG5QgFf-SRBY6A,15469
|
62
|
+
jaxsim/rbda/contacts/soft.py,sha256=XDzHVNrw0gbX8e-3uHVEOAK2OQiwlrnCur5HXsnPitc,16960
|
63
|
+
jaxsim/rbda/contacts/visco_elastic.py,sha256=3CVnZpTZPjyaVO2O5-CiFeNvK3c8Gcw304EVXCcpUvA,39935
|
64
|
+
jaxsim/terrain/__init__.py,sha256=f7lVX-iNpH_wkkjef9Qpjh19TTAUOQw76EiLYJDVizc,78
|
65
|
+
jaxsim/terrain/terrain.py,sha256=TH84r2qizMmsfW7zYLViRjacCfOkqdYHsCzD1lZEY4c,6716
|
66
|
+
jaxsim/utils/__init__.py,sha256=Y5zyoRevl3EMVQadhZ4EtSwTEkDt2vcnFoRhPJjKTZ0,215
|
67
|
+
jaxsim/utils/jaxsim_dataclass.py,sha256=Fxa555u14VUsVlKU1rBQFurrVzBp7BNsIaVoNko0lrI,11261
|
68
|
+
jaxsim/utils/tracing.py,sha256=Btwxdfhb7fJLk3r5PlQkGYj60Y2KbFT1gANGIA697FU,530
|
69
|
+
jaxsim/utils/wrappers.py,sha256=3IMwydqFgmSPqeuUQ3PRmdhDc1IoT6XC23jPC_LjWXs,4175
|
70
|
+
jaxsim-0.6.1.dev2.dist-info/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
|
71
|
+
jaxsim-0.6.1.dev2.dist-info/METADATA,sha256=3XSdNmPI49StnPnIN7LNCom_XhRxEs167ewDbkvwNx8,20199
|
72
|
+
jaxsim-0.6.1.dev2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
73
|
+
jaxsim-0.6.1.dev2.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
|
74
|
+
jaxsim-0.6.1.dev2.dist-info/RECORD,,
|
jaxsim/high_level/__init__.py
DELETED