jaxsim 0.5.1.dev103__py3-none-any.whl → 0.5.1.dev126__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/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.5.1.dev103'
16
- __version_tuple__ = version_tuple = (0, 5, 1, 'dev103')
15
+ __version__ = version = '0.5.1.dev126'
16
+ __version_tuple__ = version_tuple = (0, 5, 1, 'dev126')
@@ -16,7 +16,7 @@ from jaxsim.utils import HashedNumpyArray, JaxsimDataclass
16
16
 
17
17
 
18
18
  @jax_dataclasses.pytree_dataclass(eq=False, unsafe_hash=False)
19
- class KynDynParameters(JaxsimDataclass):
19
+ class KinDynParameters(JaxsimDataclass):
20
20
  r"""
21
21
  Class storing the kinematic and dynamic parameters of a model.
22
22
 
@@ -59,7 +59,7 @@ class KynDynParameters(JaxsimDataclass):
59
59
  return self._support_body_array_bool.get()
60
60
 
61
61
  @staticmethod
62
- def build(model_description: ModelDescription) -> KynDynParameters:
62
+ def build(model_description: ModelDescription) -> KinDynParameters:
63
63
  """
64
64
  Construct the kinematic and dynamic parameters of the model.
65
65
 
@@ -210,10 +210,10 @@ class KynDynParameters(JaxsimDataclass):
210
210
  )
211
211
 
212
212
  # =================================
213
- # Build and return KynDynParameters
213
+ # Build and return KinDynParameters
214
214
  # =================================
215
215
 
216
- return KynDynParameters(
216
+ return KinDynParameters(
217
217
  link_names=tuple(l.name for l in ordered_links),
218
218
  _parent_array=HashedNumpyArray(array=parent_array),
219
219
  _support_body_array_bool=HashedNumpyArray(array=support_body_array_bool),
@@ -224,9 +224,9 @@ class KynDynParameters(JaxsimDataclass):
224
224
  frame_parameters=frame_parameters,
225
225
  )
226
226
 
227
- def __eq__(self, other: KynDynParameters) -> bool:
227
+ def __eq__(self, other: KinDynParameters) -> bool:
228
228
 
229
- if not isinstance(other, KynDynParameters):
229
+ if not isinstance(other, KinDynParameters):
230
230
  return False
231
231
 
232
232
  return hash(self) == hash(other)
@@ -450,7 +450,7 @@ class KynDynParameters(JaxsimDataclass):
450
450
 
451
451
  def set_link_mass(
452
452
  self, link_index: jtp.IntLike, mass: jtp.FloatLike
453
- ) -> KynDynParameters:
453
+ ) -> KinDynParameters:
454
454
  """
455
455
  Set the mass of a link.
456
456
 
@@ -470,7 +470,7 @@ class KynDynParameters(JaxsimDataclass):
470
470
 
471
471
  def set_link_inertia(
472
472
  self, link_index: jtp.IntLike, inertia: jtp.MatrixLike
473
- ) -> KynDynParameters:
473
+ ) -> KinDynParameters:
474
474
  r"""
475
475
  Set the inertia tensor of a link.
476
476
 
jaxsim/api/model.py CHANGED
@@ -45,7 +45,7 @@ class JaxSimModel(JaxsimDataclass):
45
45
  default=None, repr=False
46
46
  )
47
47
 
48
- kin_dyn_parameters: js.kin_dyn_parameters.KynDynParameters | None = (
48
+ kin_dyn_parameters: js.kin_dyn_parameters.KinDynParameters | None = (
49
49
  dataclasses.field(default=None, repr=False)
50
50
  )
51
51
 
@@ -271,7 +271,7 @@ class JaxSimModel(JaxsimDataclass):
271
271
  # Build the model.
272
272
  model = cls(
273
273
  model_name=model_name,
274
- kin_dyn_parameters=js.kin_dyn_parameters.KynDynParameters.build(
274
+ kin_dyn_parameters=js.kin_dyn_parameters.KinDynParameters.build(
275
275
  model_description=model_description
276
276
  ),
277
277
  time_step=time_step,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jaxsim
3
- Version: 0.5.1.dev103
3
+ Version: 0.5.1.dev126
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>
@@ -81,6 +81,7 @@ Requires-Dist: pytest>=6.0; extra == "testing"
81
81
  Requires-Dist: pytest-benchmark; extra == "testing"
82
82
  Requires-Dist: pytest-icdiff; extra == "testing"
83
83
  Requires-Dist: robot-descriptions; extra == "testing"
84
+ Requires-Dist: icub-models; extra == "testing"
84
85
  Provides-Extra: viz
85
86
  Requires-Dist: lxml; extra == "viz"
86
87
  Requires-Dist: mediapy; extra == "viz"
@@ -91,9 +92,7 @@ Requires-Dist: jaxsim[style,testing,viz]; extra == "all"
91
92
 
92
93
  # JaxSim
93
94
 
94
- JaxSim is a **differentiable physics engine** and **multibody dynamics library** designed for applications in control and robot learning, implemented with JAX.
95
-
96
- Its design facilitates research and accelerates prototyping in the intersection of robotics and artificial intelligence.
95
+ **JaxSim** is a **differentiable physics engine** and **multibody dynamics library** built with JAX, tailored for control and robotic learning applications.
97
96
 
98
97
  <div align="center">
99
98
  <br/>
@@ -108,41 +107,105 @@ Its design facilitates research and accelerates prototyping in the intersection
108
107
  </div>
109
108
 
110
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)
111
155
 
112
- - Physics engine in reduced coordinates supporting fixed-base and floating-base robots.
113
- - Multibody dynamics library providing all the necessary components for developing model-based control algorithms.
114
- - Completely developed in Python with [`google/jax`][jax] following a functional programming paradigm.
115
- - Transparent support for running on CPUs, GPUs, and TPUs.
116
- - Full support for JIT compilation for increased performance.
117
- - Full support for automatic vectorization for massive parallelization of open-loop and closed-loop architectures.
118
- - Support for SDF models and, upon conversion with [sdformat][sdformat], URDF models.
119
- - Visualization based on the [passive viewer][passive_viewer_mujoco] of Mujoco.
120
-
121
- ### JaxSim as a simulator
122
-
123
- - Wide range of fixed-step explicit Runge-Kutta integrators.
124
- - Support for variable-step integrators implemented as embedded Runge-Kutta schemes.
125
- - Improved stability by optionally integrating the base orientation on the $\text{SO}(3)$ manifold.
126
- - Soft contacts model supporting full friction cone and sticking-slipping transition.
127
- - Collision detection between points rigidly attached to bodies and uneven ground surfaces.
128
-
129
- ### JaxSim as a multibody dynamics library
156
+ ```
130
157
 
131
- - Provides rigid body dynamics algorithms (RBDAs) like RNEA, ABA, CRBA, and Jacobians.
132
- - Provides all the quantities included in the Euler-Poincarè formulation of the equations of motion.
133
- - Supports body-fixed, inertial-fixed, and mixed [velocity representations][notation].
134
- - Exposes all the necessary quantities to develop controllers in centroidal coordinates.
135
- - Supports running open-loop and full closed-loop control architectures on hardware accelerators.
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}")
136
200
 
137
- ### JaxSim for robot learning
201
+ ```
202
+ ### Additional features
138
203
 
139
- - Being developed with JAX, all the RBDAs support automatic differentiation both in forward and reverse modes.
204
+ - Full support for automatic differentiation of RBDAs (forward and reverse modes) with JAX.
140
205
  - Support for automatically differentiating against kinematics and dynamics parameters.
141
206
  - All fixed-step integrators are forward and reverse differentiable.
142
207
  - All variable-step integrators are forward differentiable.
143
- - Ideal for sampling synthetic data for reinforcement learning (RL).
144
- - Ideal for designing physics-informed neural networks (PINNs) with loss functions requiring model-based quantities.
145
- - Ideal for combining model-based control with learning-based components.
208
+ - Check the example folder for additional usecase !
146
209
 
147
210
  [jax]: https://github.com/google/jax/
148
211
  [sdformat]: https://github.com/gazebosim/sdformat
@@ -156,12 +219,6 @@ Its design facilitates research and accelerates prototyping in the intersection
156
219
  > JaxSim currently focuses on locomotion applications.
157
220
  > Only contacts between bodies and smooth ground surfaces are supported.
158
221
 
159
- ## Documentation
160
-
161
- The JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs].
162
-
163
- [readthedocs]: https://jaxsim.readthedocs.io/
164
-
165
222
  ## Installation
166
223
 
167
224
  <details>
@@ -233,6 +290,13 @@ pip install --no-deps -e .
233
290
  [venv]: https://docs.python.org/3/tutorial/venv.html
234
291
  [jax_gpu]: https://github.com/google/jax/#installation
235
292
 
293
+ ## Documentation
294
+
295
+ The JaxSim API documentation is available at [jaxsim.readthedocs.io][readthedocs].
296
+
297
+ [readthedocs]: https://jaxsim.readthedocs.io/
298
+
299
+
236
300
  ## Overview
237
301
 
238
302
  <details>
@@ -1,5 +1,5 @@
1
1
  jaxsim/__init__.py,sha256=OQcCxXn4BXiSvGjAatqvw5fAEVfXbxyavQZN25NEyBo,3675
2
- jaxsim/_version.py,sha256=zdHXFLMTP9gf9Mb93H_-kwqd5cnJDwjqSFX1iUItBJ4,428
2
+ jaxsim/_version.py,sha256=bAv6NfT-OBMQj4lZTyEZMgzn5y6eYEzIt7UYpdG1hHU,428
3
3
  jaxsim/exceptions.py,sha256=5rYd0kGrIaq1e0WK0qMVTCkoGJtMWz_uWlVtxHbjH_A,2322
4
4
  jaxsim/logging.py,sha256=STI-D_upXZYX-ZezLrlJJ0UlD5YspST0vZ_DcIwkzO4,1553
5
5
  jaxsim/typing.py,sha256=7msl8t5Jt09RNYfKdPJtpjLfWurldcycDappb045Eso,761
@@ -10,9 +10,9 @@ jaxsim/api/contact.py,sha256=vfW-HEvQcAUHl7dOOwI-ndRxgMeAtkKT7tTaMDFlh7k,25421
10
10
  jaxsim/api/data.py,sha256=AFp1sDNRIkwpBom6ZlW6L7vJBtf4D9woVRJ8bGICr3s,30189
11
11
  jaxsim/api/frame.py,sha256=d6pa6vywGDqfaJU76F_-yjLJs6R3mrjZ6B-KXPu6f3Q,14595
12
12
  jaxsim/api/joint.py,sha256=AnqlNWmBOay-gsoo0y4AbfFQ2OCJm-8T1E0IMhZeLoY,7457
13
- jaxsim/api/kin_dyn_parameters.py,sha256=wnto0nzzEJ_M8tH2PUdldEyxQwQdsStYUoQFu696uuw,29897
13
+ jaxsim/api/kin_dyn_parameters.py,sha256=uFDFv13mtaOvhG1BHiwn6LRKhL__u9miutOz4a7aqkg,29897
14
14
  jaxsim/api/link.py,sha256=nHjffhNdi_xGkteMsqdb_hC9mdV9rNw7k3pl89Uhw_8,12798
15
- jaxsim/api/model.py,sha256=9c3Cw8SitS6-yLNrlWEa7zygacn4Yf2Y1zp8Dlg7SFE,80176
15
+ jaxsim/api/model.py,sha256=bDds8iog-6Ug2cwGjBBkBd7ENqdCE5Y-jc4cweF9wxU,80176
16
16
  jaxsim/api/ode.py,sha256=SIg7UKDkJxhS0FlMH6iqipn7WoQWjpQP6EFdvEBkdts,15429
17
17
  jaxsim/api/ode_data.py,sha256=ggF1AVaLW5QuXrfpNsFs-voVcW6gZkxK2Xe9GiDmou0,13755
18
18
  jaxsim/api/references.py,sha256=YkdZhRv8NoBC94qvpwn1w9_alVuxrfiZV5w5NHQIt-g,20737
@@ -67,8 +67,8 @@ jaxsim/utils/__init__.py,sha256=Y5zyoRevl3EMVQadhZ4EtSwTEkDt2vcnFoRhPJjKTZ0,215
67
67
  jaxsim/utils/jaxsim_dataclass.py,sha256=TGmTQV2Lq7Q-2nLoAEaeNtkPa_qj0IKkdBm4COj46Os,11312
68
68
  jaxsim/utils/tracing.py,sha256=eEY28MZW0Lm_jJNt1NkFqZz0ek01tvhR46OXZYCo7tc,532
69
69
  jaxsim/utils/wrappers.py,sha256=ZY7olSORzZRvSzkdeNLj8yjwUIAt9L0Douwl7wItjpk,4008
70
- jaxsim-0.5.1.dev103.dist-info/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
71
- jaxsim-0.5.1.dev103.dist-info/METADATA,sha256=QWMkkVWOPO0aedePnBihvUEV395YxLafSFGzxnYVmVE,17938
72
- jaxsim-0.5.1.dev103.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
73
- jaxsim-0.5.1.dev103.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
74
- jaxsim-0.5.1.dev103.dist-info/RECORD,,
70
+ jaxsim-0.5.1.dev126.dist-info/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
71
+ jaxsim-0.5.1.dev126.dist-info/METADATA,sha256=nq12YotcPlItsQiynF8x5TOyNrtm50LSg-AkuAawn8E,19484
72
+ jaxsim-0.5.1.dev126.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
73
+ jaxsim-0.5.1.dev126.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
74
+ jaxsim-0.5.1.dev126.dist-info/RECORD,,