jaxsim 0.7.1.dev67__tar.gz → 0.7.1.dev74__tar.gz
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-0.7.1.dev67 → jaxsim-0.7.1.dev74}/PKG-INFO +77 -137
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/README.md +76 -136
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/_version.py +2 -2
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim.egg-info/PKG-INFO +77 -137
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.devcontainer/Dockerfile +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.devcontainer/devcontainer.json +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.gitattributes +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.github/CODEOWNERS +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.github/dependabot.yml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.github/release.yml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.github/workflows/ci_cd.yml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.github/workflows/gpu_benchmark.yml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.github/workflows/pixi.yml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.github/workflows/read_the_docs.yml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.gitignore +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.pre-commit-config.yaml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/.readthedocs.yaml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/CONTRIBUTING.md +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/LICENSE +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/Makefile +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/conf.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/examples.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/guide/configuration.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/guide/install.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/index.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/make.bat +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/modules/api.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/modules/math.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/modules/mujoco.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/modules/parsers.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/modules/rbda.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/modules/typing.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/docs/modules/utils.rst +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/environment.yml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/.gitattributes +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/.gitignore +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/README.md +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/assets/build_cartpole_urdf.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/assets/cartpole.urdf +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/jaxsim_as_multibody_dynamics_library.ipynb +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/jaxsim_as_physics_engine.ipynb +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/jaxsim_as_physics_engine_advanced.ipynb +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/examples/jaxsim_for_robot_controllers.ipynb +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/pixi.lock +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/pyproject.toml +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/setup.cfg +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/actuation_model.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/com.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/common.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/contact.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/data.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/frame.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/integrators.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/joint.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/kin_dyn_parameters.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/link.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/model.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/ode.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/api/references.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/exceptions.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/logging.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/adjoint.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/cross.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/inertia.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/joint_model.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/quaternion.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/rotation.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/skew.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/transform.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/math/utils.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/mujoco/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/mujoco/__main__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/mujoco/loaders.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/mujoco/model.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/mujoco/utils.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/mujoco/visualizer.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/descriptions/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/descriptions/collision.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/descriptions/joint.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/descriptions/link.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/descriptions/model.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/kinematic_graph.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/rod/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/rod/meshes.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/rod/parser.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/parsers/rod/utils.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/aba.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/actuation/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/actuation/common.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/collidable_points.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/contacts/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/contacts/common.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/contacts/relaxed_rigid.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/contacts/rigid.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/contacts/soft.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/crba.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/forward_kinematics.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/jacobian.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/kinematic_constraints.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/rnea.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/rbda/utils.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/terrain/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/terrain/terrain.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/typing.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/utils/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/utils/jaxsim_dataclass.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/utils/tracing.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim/utils/wrappers.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim.egg-info/SOURCES.txt +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim.egg-info/dependency_links.txt +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim.egg-info/requires.txt +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/src/jaxsim.egg-info/top_level.txt +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/__init__.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/assets/double_pendulum.sdf +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/conftest.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_actuation.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_com.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_contact.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_data.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_frame.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_joint.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_link.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_model.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_api_model_hw_parametrization.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_automatic_differentiation.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_benchmark.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_exceptions.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_meshes.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_pytree.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_simulations.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/test_visualizer.py +0 -0
- {jaxsim-0.7.1.dev67 → jaxsim-0.7.1.dev74}/tests/utils_idyntree.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: jaxsim
|
3
|
-
Version: 0.7.1.
|
3
|
+
Version: 0.7.1.dev74
|
4
4
|
Summary: A differentiable physics engine and multibody dynamics library for control and robot learning.
|
5
5
|
Author-email: Diego Ferigo <dgferigo@gmail.com>, Filippo Luca Ferretti <filippoluca.ferretti@outlook.com>
|
6
6
|
Maintainer-email: Filippo Luca Ferretti <filippo.ferretti@iit.it>, Alessandro Croci <alessandro.croci@iit.it>
|
@@ -63,31 +63,44 @@ Dynamic: license-file
|
|
63
63
|
|
64
64
|
# JaxSim
|
65
65
|
|
66
|
-
**JaxSim** is a **differentiable physics engine**
|
66
|
+
**JaxSim** is a **differentiable physics engine** built with JAX, tailored for co-design and robotic learning applications.
|
67
67
|
|
68
68
|
<div align="center">
|
69
69
|
<br/>
|
70
70
|
<table>
|
71
71
|
<tr>
|
72
|
-
<th><img src="https://github.com/user-attachments/assets/
|
73
|
-
<th><img src="https://github.com/user-attachments/assets/
|
72
|
+
<th><img src="https://github.com/user-attachments/assets/89d0b4ca-7e0c-4f58-bf3e-9540e35b9a01" style="height:300px; width:400px; object-fit:cover;"></th>
|
73
|
+
<th><img src="https://github.com/user-attachments/assets/a909e388-d7b4-4b58-89f1-035da8636d94" style="height:300px; width:400px; object-fit:cover;"></th>
|
74
|
+
</tr>
|
75
|
+
<tr>
|
76
|
+
<th><img src="https://github.com/user-attachments/assets/3692bc06-18ed-406d-80bd-480780346224" style="height:300px; width:400px; object-fit:cover;"></th>
|
77
|
+
<th><img src="https://github.com/user-attachments/assets/3356f332-4710-4946-9a82-a8c2305dab88" style="height:300px; width:400px; object-fit:cover;"></th>
|
74
78
|
</tr>
|
75
79
|
</table>
|
76
80
|
<br/>
|
77
81
|
</div>
|
78
82
|
|
83
|
+
|
84
|
+
|
79
85
|
## Features
|
86
|
+
|
87
|
+
- Physically consistent differentiability w.r.t. hardware parameters.
|
88
|
+
- Closed chain dynamics support.
|
80
89
|
- Reduced-coordinate physics engine for **fixed-base** and **floating-base** robots.
|
81
|
-
- Multibody dynamics library for model-based control algorithms.
|
82
90
|
- Fully Python-based, leveraging [jax][jax] following a functional programming paradigm.
|
83
91
|
- Seamless execution on CPUs, GPUs, and TPUs.
|
84
92
|
- Supports JIT compilation and automatic vectorization for high performance.
|
85
93
|
- Compatible with SDF models and URDF (via [sdformat][sdformat] conversion).
|
86
94
|
|
87
|
-
## Usage
|
88
95
|
|
89
|
-
|
96
|
+
> [!WARNING]
|
97
|
+
> This project is still experimental, APIs could change between releases without notice.
|
90
98
|
|
99
|
+
> [!NOTE]
|
100
|
+
> JaxSim currently focuses on locomotion applications.
|
101
|
+
> Only contacts between bodies and smooth ground surfaces are supported.
|
102
|
+
|
103
|
+
## How to use it
|
91
104
|
|
92
105
|
```python
|
93
106
|
import pathlib
|
@@ -136,82 +149,13 @@ for _ in T:
|
|
136
149
|
)
|
137
150
|
```
|
138
151
|
|
139
|
-
|
140
|
-
``` python
|
141
|
-
import pathlib
|
142
|
-
|
143
|
-
import icub_models
|
144
|
-
import jax.numpy as jnp
|
145
|
-
|
146
|
-
import jaxsim.api as js
|
147
|
-
|
148
|
-
# Load the iCub model
|
149
|
-
model_path = icub_models.get_model_file("iCubGazeboV2_5")
|
150
|
-
|
151
|
-
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
|
152
|
-
'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
|
153
|
-
'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
|
154
|
-
'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
|
155
|
-
'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
|
156
|
-
'r_ankle_roll')
|
157
|
-
|
158
|
-
# Build and reduce the model
|
159
|
-
model_description = pathlib.Path(model_path)
|
160
|
-
|
161
|
-
full_model = js.model.JaxSimModel.build_from_model_description(
|
162
|
-
model_description=model_description, time_step=0.0001, is_urdf=True
|
163
|
-
)
|
164
|
-
|
165
|
-
model = js.model.reduce(model=full_model, considered_joints=joints)
|
166
|
-
|
167
|
-
# Initialize model data
|
168
|
-
data = js.data.JaxSimModelData.build(
|
169
|
-
model=model,
|
170
|
-
base_position=jnp.array([0.0, 0.0, 1.0]),
|
171
|
-
)
|
172
|
-
|
173
|
-
# Frame and dynamics computations
|
174
|
-
frame_index = js.frame.name_to_idx(model=model, frame_name="l_foot")
|
175
|
-
|
176
|
-
# Frame transformation
|
177
|
-
W_H_F = js.frame.transform(
|
178
|
-
model=model, data=data, frame_index=frame_index
|
179
|
-
)
|
180
|
-
|
181
|
-
# Frame Jacobian
|
182
|
-
W_J_F = js.frame.jacobian(
|
183
|
-
model=model, data=data, frame_index=frame_index
|
184
|
-
)
|
185
|
-
|
186
|
-
# Dynamics properties
|
187
|
-
M = js.model.free_floating_mass_matrix(model=model, data=data) # Mass matrix
|
188
|
-
h = js.model.free_floating_bias_forces(model=model, data=data) # Bias forces
|
189
|
-
g = js.model.free_floating_gravity_forces(model=model, data=data) # Gravity forces
|
190
|
-
C = js.model.free_floating_coriolis_matrix(model=model, data=data) # Coriolis matrix
|
191
|
-
|
192
|
-
# Print dynamics results
|
193
|
-
print(f"{M.shape=} \n{h.shape=} \n{g.shape=} \n{C.shape=}")
|
194
|
-
```
|
195
|
-
|
196
|
-
### Additional features
|
197
|
-
|
198
|
-
- Full support for automatic differentiation of RBDAs (forward and reverse modes) with JAX.
|
199
|
-
- Support for automatically differentiating against kinematics and dynamics parameters.
|
200
|
-
- All fixed-step integrators are forward and reverse differentiable.
|
201
|
-
- Check the example folder for additional use cases!
|
152
|
+
Check the example folder for additional use cases!
|
202
153
|
|
203
154
|
[jax]: https://github.com/google/jax/
|
204
155
|
[sdformat]: https://github.com/gazebosim/sdformat
|
205
156
|
[notation]: https://research.tue.nl/en/publications/multibody-dynamics-notation-version-2
|
206
157
|
[passive_viewer_mujoco]: https://mujoco.readthedocs.io/en/stable/python.html#passive-viewer
|
207
158
|
|
208
|
-
> [!WARNING]
|
209
|
-
> This project is still experimental, APIs could change between releases without notice.
|
210
|
-
|
211
|
-
> [!NOTE]
|
212
|
-
> JaxSim currently focuses on locomotion applications.
|
213
|
-
> Only contacts between bodies and smooth ground surfaces are supported.
|
214
|
-
|
215
159
|
## Installation
|
216
160
|
|
217
161
|
<details>
|
@@ -335,70 +279,66 @@ The JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs
|
|
335
279
|
|
336
280
|
[readthedocs]: https://jaxsim.readthedocs.io/
|
337
281
|
|
282
|
+
## Additional features
|
283
|
+
Jaxsim can also be used as a multi-body dynamic library! With full support for automatic differentiation of RBDAs (forwards and reverse mode) and automatic differentiation against both kinematic and dynamic parameters.
|
338
284
|
|
339
|
-
## Overview
|
340
285
|
|
341
|
-
|
342
|
-
|
286
|
+
### Using JaxSim as a multibody dynamics library
|
287
|
+
``` python
|
288
|
+
import pathlib
|
343
289
|
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
src/jaxsim
|
348
|
-
|-- api..........................# Package containing the main functional APIs.
|
349
|
-
| |-- actuation_model.py.......# |-- APIs for computing quantities related to the actuation model.
|
350
|
-
| |-- common.py................# |-- Common utilities used in the current package.
|
351
|
-
| |-- com.py...................# |-- APIs for computing quantities related to the center of mass.
|
352
|
-
| |-- contact_model.py.........# |-- APIs for computing quantities related to the contact model.
|
353
|
-
| |-- contact.py...............# |-- APIs for computing quantities related to the collidable points.
|
354
|
-
| |-- data.py..................# |-- Class storing the data of a simulated model.
|
355
|
-
| |-- frame.py.................# |-- APIs for computing quantities related to additional frames.
|
356
|
-
| |-- integrators.py...........# |-- APIs for integrating the system dynamics.
|
357
|
-
| |-- joint.py.................# |-- APIs for computing quantities related to the joints.
|
358
|
-
| |-- kin_dyn_parameters.py....# |-- Class storing kinematic and dynamic parameters of a model.
|
359
|
-
| |-- link.py..................# |-- APIs for computing quantities related to the links.
|
360
|
-
| |-- model.py.................# |-- Class defining a simulated model and APIs for computing related quantities.
|
361
|
-
| |-- ode.py...................# |-- APIs for computing quantities related to the system dynamics.
|
362
|
-
| `-- references.py............# `-- Helper class to create references (link forces and joint torques).
|
363
|
-
|-- exceptions.py................# Module containing functions to raise exceptions from JIT-compiled functions.
|
364
|
-
|-- logging.py...................# Module containing logging utilities.
|
365
|
-
|-- math.........................# Package containing mathematical utilities.
|
366
|
-
| |-- adjoint.py...............# |-- APIs for creating and manipulating 6D transformations.
|
367
|
-
| |-- cross.py.................# |-- APIs for computing cross products of 6D quantities.
|
368
|
-
| |-- inertia.py...............# |-- APIs for creating and manipulating 6D inertia matrices.
|
369
|
-
| |-- joint_model.py...........# |-- APIs defining the supported joint model and the corresponding transformations.
|
370
|
-
| |-- quaternion.py............# |-- APIs for creating and manipulating quaternions.
|
371
|
-
| |-- rotation.py..............# |-- APIs for creating and manipulating rotation matrices.
|
372
|
-
| |-- skew.py..................# |-- APIs for creating and manipulating skew-symmetric matrices.
|
373
|
-
| |-- transform.py.............# |-- APIs for creating and manipulating homogeneous transformations.
|
374
|
-
| |-- utils.py.................# |-- Common utilities used in the current package.
|
375
|
-
|-- mujoco.......................# Package containing utilities to interact with the Mujoco passive viewer.
|
376
|
-
| |-- loaders.py...............# |-- Utilities for converting JaxSim models to Mujoco models.
|
377
|
-
| |-- model.py.................# |-- Class providing high-level methods to compute quantities using Mujoco.
|
378
|
-
| `-- visualizer.py............# `-- Class that simplifies opening the passive viewer and recording videos.
|
379
|
-
|-- parsers......................# Package containing utilities to parse model descriptions (SDF and URDF models).
|
380
|
-
| |-- descriptions/............# |-- Package containing the intermediate representation of a model description.
|
381
|
-
| |-- kinematic_graph.py.......# |-- Definition of the kinematic graph associated with a parsed model description.
|
382
|
-
| `-- rod/.....................# `-- Package to create the intermediate representation from model descriptions using ROD.
|
383
|
-
|-- rbda.........................# Package containing the low-level rigid body dynamics algorithms.
|
384
|
-
| |-- aba.py...................# |-- The Articulated Body Algorithm.
|
385
|
-
| |-- collidable_points.py.....# |-- Kinematics of collidable points.
|
386
|
-
| |-- contacts/................# |-- Package containing the supported contact models.
|
387
|
-
| |-- crba.py..................# |-- The Composite Rigid Body Algorithm.
|
388
|
-
| |-- forward_kinematics.py....# |-- Forward kinematics of the model.
|
389
|
-
| |-- jacobian.py..............# |-- Full Jacobian and full Jacobian derivative.
|
390
|
-
| |-- rnea.py..................# |-- The Recursive Newton-Euler Algorithm.
|
391
|
-
| `-- utils.py.................# `-- Common utilities used in the current package.
|
392
|
-
|-- terrain......................# Package containing resources to specify the terrain.
|
393
|
-
| `-- terrain.py...............# `-- Classes defining the supported terrains.
|
394
|
-
|-- typing.py....................# Module containing type hints.
|
395
|
-
`-- utils........................# Package of common utilities.
|
396
|
-
|-- jaxsim_dataclass.py......# |-- Utilities to operate on pytree dataclasses.
|
397
|
-
|-- tracing.py...............# |-- Utilities to use when JAX is tracing functions.
|
398
|
-
`-- wrappers.py..............# `-- Utilities to wrap objects for specific use cases on pytree dataclass attributes.
|
399
|
-
```
|
290
|
+
import icub_models
|
291
|
+
import jax.numpy as jnp
|
400
292
|
|
401
|
-
|
293
|
+
import jaxsim.api as js
|
294
|
+
|
295
|
+
# Load the iCub model
|
296
|
+
model_path = icub_models.get_model_file("iCubGazeboV2_5")
|
297
|
+
|
298
|
+
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
|
299
|
+
'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
|
300
|
+
'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
|
301
|
+
'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
|
302
|
+
'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
|
303
|
+
'r_ankle_roll')
|
304
|
+
|
305
|
+
# Build and reduce the model
|
306
|
+
model_description = pathlib.Path(model_path)
|
307
|
+
|
308
|
+
full_model = js.model.JaxSimModel.build_from_model_description(
|
309
|
+
model_description=model_description, time_step=0.0001, is_urdf=True
|
310
|
+
)
|
311
|
+
|
312
|
+
model = js.model.reduce(model=full_model, considered_joints=joints)
|
313
|
+
|
314
|
+
# Initialize model data
|
315
|
+
data = js.data.JaxSimModelData.build(
|
316
|
+
model=model,
|
317
|
+
base_position=jnp.array([0.0, 0.0, 1.0]),
|
318
|
+
)
|
319
|
+
|
320
|
+
# Frame and dynamics computations
|
321
|
+
frame_index = js.frame.name_to_idx(model=model, frame_name="l_foot")
|
322
|
+
|
323
|
+
# Frame transformation
|
324
|
+
W_H_F = js.frame.transform(
|
325
|
+
model=model, data=data, frame_index=frame_index
|
326
|
+
)
|
327
|
+
|
328
|
+
# Frame Jacobian
|
329
|
+
W_J_F = js.frame.jacobian(
|
330
|
+
model=model, data=data, frame_index=frame_index
|
331
|
+
)
|
332
|
+
|
333
|
+
# Dynamics properties
|
334
|
+
M = js.model.free_floating_mass_matrix(model=model, data=data) # Mass matrix
|
335
|
+
h = js.model.free_floating_bias_forces(model=model, data=data) # Bias forces
|
336
|
+
g = js.model.free_floating_gravity_forces(model=model, data=data) # Gravity forces
|
337
|
+
C = js.model.free_floating_coriolis_matrix(model=model, data=data) # Coriolis matrix
|
338
|
+
|
339
|
+
# Print dynamics results
|
340
|
+
print(f"{M.shape=} \n{h.shape=} \n{g.shape=} \n{C.shape=}")
|
341
|
+
```
|
402
342
|
|
403
343
|
## Credits
|
404
344
|
|
@@ -1,30 +1,43 @@
|
|
1
1
|
# JaxSim
|
2
2
|
|
3
|
-
**JaxSim** is a **differentiable physics engine**
|
3
|
+
**JaxSim** is a **differentiable physics engine** built with JAX, tailored for co-design and robotic learning applications.
|
4
4
|
|
5
5
|
<div align="center">
|
6
6
|
<br/>
|
7
7
|
<table>
|
8
8
|
<tr>
|
9
|
-
<th><img src="https://github.com/user-attachments/assets/
|
10
|
-
<th><img src="https://github.com/user-attachments/assets/
|
9
|
+
<th><img src="https://github.com/user-attachments/assets/89d0b4ca-7e0c-4f58-bf3e-9540e35b9a01" style="height:300px; width:400px; object-fit:cover;"></th>
|
10
|
+
<th><img src="https://github.com/user-attachments/assets/a909e388-d7b4-4b58-89f1-035da8636d94" style="height:300px; width:400px; object-fit:cover;"></th>
|
11
|
+
</tr>
|
12
|
+
<tr>
|
13
|
+
<th><img src="https://github.com/user-attachments/assets/3692bc06-18ed-406d-80bd-480780346224" style="height:300px; width:400px; object-fit:cover;"></th>
|
14
|
+
<th><img src="https://github.com/user-attachments/assets/3356f332-4710-4946-9a82-a8c2305dab88" style="height:300px; width:400px; object-fit:cover;"></th>
|
11
15
|
</tr>
|
12
16
|
</table>
|
13
17
|
<br/>
|
14
18
|
</div>
|
15
19
|
|
20
|
+
|
21
|
+
|
16
22
|
## Features
|
23
|
+
|
24
|
+
- Physically consistent differentiability w.r.t. hardware parameters.
|
25
|
+
- Closed chain dynamics support.
|
17
26
|
- Reduced-coordinate physics engine for **fixed-base** and **floating-base** robots.
|
18
|
-
- Multibody dynamics library for model-based control algorithms.
|
19
27
|
- Fully Python-based, leveraging [jax][jax] following a functional programming paradigm.
|
20
28
|
- Seamless execution on CPUs, GPUs, and TPUs.
|
21
29
|
- Supports JIT compilation and automatic vectorization for high performance.
|
22
30
|
- Compatible with SDF models and URDF (via [sdformat][sdformat] conversion).
|
23
31
|
|
24
|
-
## Usage
|
25
32
|
|
26
|
-
|
33
|
+
> [!WARNING]
|
34
|
+
> This project is still experimental, APIs could change between releases without notice.
|
27
35
|
|
36
|
+
> [!NOTE]
|
37
|
+
> JaxSim currently focuses on locomotion applications.
|
38
|
+
> Only contacts between bodies and smooth ground surfaces are supported.
|
39
|
+
|
40
|
+
## How to use it
|
28
41
|
|
29
42
|
```python
|
30
43
|
import pathlib
|
@@ -73,82 +86,13 @@ for _ in T:
|
|
73
86
|
)
|
74
87
|
```
|
75
88
|
|
76
|
-
|
77
|
-
``` python
|
78
|
-
import pathlib
|
79
|
-
|
80
|
-
import icub_models
|
81
|
-
import jax.numpy as jnp
|
82
|
-
|
83
|
-
import jaxsim.api as js
|
84
|
-
|
85
|
-
# Load the iCub model
|
86
|
-
model_path = icub_models.get_model_file("iCubGazeboV2_5")
|
87
|
-
|
88
|
-
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
|
89
|
-
'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
|
90
|
-
'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
|
91
|
-
'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
|
92
|
-
'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
|
93
|
-
'r_ankle_roll')
|
94
|
-
|
95
|
-
# Build and reduce the model
|
96
|
-
model_description = pathlib.Path(model_path)
|
97
|
-
|
98
|
-
full_model = js.model.JaxSimModel.build_from_model_description(
|
99
|
-
model_description=model_description, time_step=0.0001, is_urdf=True
|
100
|
-
)
|
101
|
-
|
102
|
-
model = js.model.reduce(model=full_model, considered_joints=joints)
|
103
|
-
|
104
|
-
# Initialize model data
|
105
|
-
data = js.data.JaxSimModelData.build(
|
106
|
-
model=model,
|
107
|
-
base_position=jnp.array([0.0, 0.0, 1.0]),
|
108
|
-
)
|
109
|
-
|
110
|
-
# Frame and dynamics computations
|
111
|
-
frame_index = js.frame.name_to_idx(model=model, frame_name="l_foot")
|
112
|
-
|
113
|
-
# Frame transformation
|
114
|
-
W_H_F = js.frame.transform(
|
115
|
-
model=model, data=data, frame_index=frame_index
|
116
|
-
)
|
117
|
-
|
118
|
-
# Frame Jacobian
|
119
|
-
W_J_F = js.frame.jacobian(
|
120
|
-
model=model, data=data, frame_index=frame_index
|
121
|
-
)
|
122
|
-
|
123
|
-
# Dynamics properties
|
124
|
-
M = js.model.free_floating_mass_matrix(model=model, data=data) # Mass matrix
|
125
|
-
h = js.model.free_floating_bias_forces(model=model, data=data) # Bias forces
|
126
|
-
g = js.model.free_floating_gravity_forces(model=model, data=data) # Gravity forces
|
127
|
-
C = js.model.free_floating_coriolis_matrix(model=model, data=data) # Coriolis matrix
|
128
|
-
|
129
|
-
# Print dynamics results
|
130
|
-
print(f"{M.shape=} \n{h.shape=} \n{g.shape=} \n{C.shape=}")
|
131
|
-
```
|
132
|
-
|
133
|
-
### Additional features
|
134
|
-
|
135
|
-
- Full support for automatic differentiation of RBDAs (forward and reverse modes) with JAX.
|
136
|
-
- Support for automatically differentiating against kinematics and dynamics parameters.
|
137
|
-
- All fixed-step integrators are forward and reverse differentiable.
|
138
|
-
- Check the example folder for additional use cases!
|
89
|
+
Check the example folder for additional use cases!
|
139
90
|
|
140
91
|
[jax]: https://github.com/google/jax/
|
141
92
|
[sdformat]: https://github.com/gazebosim/sdformat
|
142
93
|
[notation]: https://research.tue.nl/en/publications/multibody-dynamics-notation-version-2
|
143
94
|
[passive_viewer_mujoco]: https://mujoco.readthedocs.io/en/stable/python.html#passive-viewer
|
144
95
|
|
145
|
-
> [!WARNING]
|
146
|
-
> This project is still experimental, APIs could change between releases without notice.
|
147
|
-
|
148
|
-
> [!NOTE]
|
149
|
-
> JaxSim currently focuses on locomotion applications.
|
150
|
-
> Only contacts between bodies and smooth ground surfaces are supported.
|
151
|
-
|
152
96
|
## Installation
|
153
97
|
|
154
98
|
<details>
|
@@ -272,70 +216,66 @@ The JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs
|
|
272
216
|
|
273
217
|
[readthedocs]: https://jaxsim.readthedocs.io/
|
274
218
|
|
219
|
+
## Additional features
|
220
|
+
Jaxsim can also be used as a multi-body dynamic library! With full support for automatic differentiation of RBDAs (forwards and reverse mode) and automatic differentiation against both kinematic and dynamic parameters.
|
275
221
|
|
276
|
-
## Overview
|
277
222
|
|
278
|
-
|
279
|
-
|
223
|
+
### Using JaxSim as a multibody dynamics library
|
224
|
+
``` python
|
225
|
+
import pathlib
|
280
226
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
src/jaxsim
|
285
|
-
|-- api..........................# Package containing the main functional APIs.
|
286
|
-
| |-- actuation_model.py.......# |-- APIs for computing quantities related to the actuation model.
|
287
|
-
| |-- common.py................# |-- Common utilities used in the current package.
|
288
|
-
| |-- com.py...................# |-- APIs for computing quantities related to the center of mass.
|
289
|
-
| |-- contact_model.py.........# |-- APIs for computing quantities related to the contact model.
|
290
|
-
| |-- contact.py...............# |-- APIs for computing quantities related to the collidable points.
|
291
|
-
| |-- data.py..................# |-- Class storing the data of a simulated model.
|
292
|
-
| |-- frame.py.................# |-- APIs for computing quantities related to additional frames.
|
293
|
-
| |-- integrators.py...........# |-- APIs for integrating the system dynamics.
|
294
|
-
| |-- joint.py.................# |-- APIs for computing quantities related to the joints.
|
295
|
-
| |-- kin_dyn_parameters.py....# |-- Class storing kinematic and dynamic parameters of a model.
|
296
|
-
| |-- link.py..................# |-- APIs for computing quantities related to the links.
|
297
|
-
| |-- model.py.................# |-- Class defining a simulated model and APIs for computing related quantities.
|
298
|
-
| |-- ode.py...................# |-- APIs for computing quantities related to the system dynamics.
|
299
|
-
| `-- references.py............# `-- Helper class to create references (link forces and joint torques).
|
300
|
-
|-- exceptions.py................# Module containing functions to raise exceptions from JIT-compiled functions.
|
301
|
-
|-- logging.py...................# Module containing logging utilities.
|
302
|
-
|-- math.........................# Package containing mathematical utilities.
|
303
|
-
| |-- adjoint.py...............# |-- APIs for creating and manipulating 6D transformations.
|
304
|
-
| |-- cross.py.................# |-- APIs for computing cross products of 6D quantities.
|
305
|
-
| |-- inertia.py...............# |-- APIs for creating and manipulating 6D inertia matrices.
|
306
|
-
| |-- joint_model.py...........# |-- APIs defining the supported joint model and the corresponding transformations.
|
307
|
-
| |-- quaternion.py............# |-- APIs for creating and manipulating quaternions.
|
308
|
-
| |-- rotation.py..............# |-- APIs for creating and manipulating rotation matrices.
|
309
|
-
| |-- skew.py..................# |-- APIs for creating and manipulating skew-symmetric matrices.
|
310
|
-
| |-- transform.py.............# |-- APIs for creating and manipulating homogeneous transformations.
|
311
|
-
| |-- utils.py.................# |-- Common utilities used in the current package.
|
312
|
-
|-- mujoco.......................# Package containing utilities to interact with the Mujoco passive viewer.
|
313
|
-
| |-- loaders.py...............# |-- Utilities for converting JaxSim models to Mujoco models.
|
314
|
-
| |-- model.py.................# |-- Class providing high-level methods to compute quantities using Mujoco.
|
315
|
-
| `-- visualizer.py............# `-- Class that simplifies opening the passive viewer and recording videos.
|
316
|
-
|-- parsers......................# Package containing utilities to parse model descriptions (SDF and URDF models).
|
317
|
-
| |-- descriptions/............# |-- Package containing the intermediate representation of a model description.
|
318
|
-
| |-- kinematic_graph.py.......# |-- Definition of the kinematic graph associated with a parsed model description.
|
319
|
-
| `-- rod/.....................# `-- Package to create the intermediate representation from model descriptions using ROD.
|
320
|
-
|-- rbda.........................# Package containing the low-level rigid body dynamics algorithms.
|
321
|
-
| |-- aba.py...................# |-- The Articulated Body Algorithm.
|
322
|
-
| |-- collidable_points.py.....# |-- Kinematics of collidable points.
|
323
|
-
| |-- contacts/................# |-- Package containing the supported contact models.
|
324
|
-
| |-- crba.py..................# |-- The Composite Rigid Body Algorithm.
|
325
|
-
| |-- forward_kinematics.py....# |-- Forward kinematics of the model.
|
326
|
-
| |-- jacobian.py..............# |-- Full Jacobian and full Jacobian derivative.
|
327
|
-
| |-- rnea.py..................# |-- The Recursive Newton-Euler Algorithm.
|
328
|
-
| `-- utils.py.................# `-- Common utilities used in the current package.
|
329
|
-
|-- terrain......................# Package containing resources to specify the terrain.
|
330
|
-
| `-- terrain.py...............# `-- Classes defining the supported terrains.
|
331
|
-
|-- typing.py....................# Module containing type hints.
|
332
|
-
`-- utils........................# Package of common utilities.
|
333
|
-
|-- jaxsim_dataclass.py......# |-- Utilities to operate on pytree dataclasses.
|
334
|
-
|-- tracing.py...............# |-- Utilities to use when JAX is tracing functions.
|
335
|
-
`-- wrappers.py..............# `-- Utilities to wrap objects for specific use cases on pytree dataclass attributes.
|
336
|
-
```
|
227
|
+
import icub_models
|
228
|
+
import jax.numpy as jnp
|
337
229
|
|
338
|
-
|
230
|
+
import jaxsim.api as js
|
231
|
+
|
232
|
+
# Load the iCub model
|
233
|
+
model_path = icub_models.get_model_file("iCubGazeboV2_5")
|
234
|
+
|
235
|
+
joints = ('torso_pitch', 'torso_roll', 'torso_yaw', 'l_shoulder_pitch',
|
236
|
+
'l_shoulder_roll', 'l_shoulder_yaw', 'l_elbow', 'r_shoulder_pitch',
|
237
|
+
'r_shoulder_roll', 'r_shoulder_yaw', 'r_elbow', 'l_hip_pitch',
|
238
|
+
'l_hip_roll', 'l_hip_yaw', 'l_knee', 'l_ankle_pitch', 'l_ankle_roll',
|
239
|
+
'r_hip_pitch', 'r_hip_roll', 'r_hip_yaw', 'r_knee', 'r_ankle_pitch',
|
240
|
+
'r_ankle_roll')
|
241
|
+
|
242
|
+
# Build and reduce the model
|
243
|
+
model_description = pathlib.Path(model_path)
|
244
|
+
|
245
|
+
full_model = js.model.JaxSimModel.build_from_model_description(
|
246
|
+
model_description=model_description, time_step=0.0001, is_urdf=True
|
247
|
+
)
|
248
|
+
|
249
|
+
model = js.model.reduce(model=full_model, considered_joints=joints)
|
250
|
+
|
251
|
+
# Initialize model data
|
252
|
+
data = js.data.JaxSimModelData.build(
|
253
|
+
model=model,
|
254
|
+
base_position=jnp.array([0.0, 0.0, 1.0]),
|
255
|
+
)
|
256
|
+
|
257
|
+
# Frame and dynamics computations
|
258
|
+
frame_index = js.frame.name_to_idx(model=model, frame_name="l_foot")
|
259
|
+
|
260
|
+
# Frame transformation
|
261
|
+
W_H_F = js.frame.transform(
|
262
|
+
model=model, data=data, frame_index=frame_index
|
263
|
+
)
|
264
|
+
|
265
|
+
# Frame Jacobian
|
266
|
+
W_J_F = js.frame.jacobian(
|
267
|
+
model=model, data=data, frame_index=frame_index
|
268
|
+
)
|
269
|
+
|
270
|
+
# Dynamics properties
|
271
|
+
M = js.model.free_floating_mass_matrix(model=model, data=data) # Mass matrix
|
272
|
+
h = js.model.free_floating_bias_forces(model=model, data=data) # Bias forces
|
273
|
+
g = js.model.free_floating_gravity_forces(model=model, data=data) # Gravity forces
|
274
|
+
C = js.model.free_floating_coriolis_matrix(model=model, data=data) # Coriolis matrix
|
275
|
+
|
276
|
+
# Print dynamics results
|
277
|
+
print(f"{M.shape=} \n{h.shape=} \n{g.shape=} \n{C.shape=}")
|
278
|
+
```
|
339
279
|
|
340
280
|
## Credits
|
341
281
|
|
@@ -17,5 +17,5 @@ __version__: str
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
18
18
|
version_tuple: VERSION_TUPLE
|
19
19
|
|
20
|
-
__version__ = version = '0.7.1.
|
21
|
-
__version_tuple__ = version_tuple = (0, 7, 1, '
|
20
|
+
__version__ = version = '0.7.1.dev74'
|
21
|
+
__version_tuple__ = version_tuple = (0, 7, 1, 'dev74')
|