jaxsim 0.5.1.dev4__py3-none-any.whl → 0.5.1.dev15__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 +2 -2
- jaxsim/api/frame.py +52 -2
- jaxsim/api/kin_dyn_parameters.py +10 -0
- jaxsim/api/model.py +11 -0
- {jaxsim-0.5.1.dev4.dist-info → jaxsim-0.5.1.dev15.dist-info}/METADATA +1 -1
- {jaxsim-0.5.1.dev4.dist-info → jaxsim-0.5.1.dev15.dist-info}/RECORD +9 -9
- {jaxsim-0.5.1.dev4.dist-info → jaxsim-0.5.1.dev15.dist-info}/LICENSE +0 -0
- {jaxsim-0.5.1.dev4.dist-info → jaxsim-0.5.1.dev15.dist-info}/WHEEL +0 -0
- {jaxsim-0.5.1.dev4.dist-info → jaxsim-0.5.1.dev15.dist-info}/top_level.txt +0 -0
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.
|
16
|
-
__version_tuple__ = version_tuple = (0, 5, 1, '
|
15
|
+
__version__ = version = '0.5.1.dev15'
|
16
|
+
__version_tuple__ = version_tuple = (0, 5, 1, 'dev15')
|
jaxsim/api/frame.py
CHANGED
@@ -58,7 +58,7 @@ def name_to_idx(model: js.model.JaxSimModel, *, frame_name: str) -> jtp.Int:
|
|
58
58
|
The index of the frame.
|
59
59
|
"""
|
60
60
|
|
61
|
-
if frame_name not in model.
|
61
|
+
if frame_name not in model.frame_names():
|
62
62
|
raise ValueError(f"Frame '{frame_name}' not found in the model.")
|
63
63
|
|
64
64
|
return (
|
@@ -180,6 +180,56 @@ def transform(
|
|
180
180
|
return W_H_L @ L_H_F
|
181
181
|
|
182
182
|
|
183
|
+
@functools.partial(jax.jit, static_argnames=["output_vel_repr"])
|
184
|
+
def velocity(
|
185
|
+
model: js.model.JaxSimModel,
|
186
|
+
data: js.data.JaxSimModelData,
|
187
|
+
*,
|
188
|
+
frame_index: jtp.IntLike,
|
189
|
+
output_vel_repr: VelRepr | None = None,
|
190
|
+
) -> jtp.Vector:
|
191
|
+
"""
|
192
|
+
Compute the 6D velocity of the frame.
|
193
|
+
|
194
|
+
Args:
|
195
|
+
model: The model to consider.
|
196
|
+
data: The data of the considered model.
|
197
|
+
frame_index: The index of the frame.
|
198
|
+
output_vel_repr:
|
199
|
+
The output velocity representation of the frame velocity.
|
200
|
+
|
201
|
+
Returns:
|
202
|
+
The 6D velocity of the frame in the specified velocity representation.
|
203
|
+
"""
|
204
|
+
n_l = model.number_of_links()
|
205
|
+
n_f = model.number_of_frames()
|
206
|
+
|
207
|
+
exceptions.raise_value_error_if(
|
208
|
+
condition=jnp.array([frame_index < n_l, frame_index >= n_l + n_f]).any(),
|
209
|
+
msg="Invalid frame index '{idx}'",
|
210
|
+
idx=frame_index,
|
211
|
+
)
|
212
|
+
|
213
|
+
output_vel_repr = (
|
214
|
+
output_vel_repr if output_vel_repr is not None else data.velocity_representation
|
215
|
+
)
|
216
|
+
|
217
|
+
# Get the frame jacobian having I as input representation (taken from data)
|
218
|
+
# and O as output representation, specified by the user (or taken from data).
|
219
|
+
O_J_WF_I = jacobian(
|
220
|
+
model=model,
|
221
|
+
data=data,
|
222
|
+
frame_index=frame_index,
|
223
|
+
output_vel_repr=output_vel_repr,
|
224
|
+
)
|
225
|
+
|
226
|
+
# Get the generalized velocity in the input velocity representation.
|
227
|
+
I_ν = data.generalized_velocity()
|
228
|
+
|
229
|
+
# Compute the frame velocity in the output velocity representation.
|
230
|
+
return O_J_WF_I @ I_ν
|
231
|
+
|
232
|
+
|
183
233
|
@functools.partial(jax.jit, static_argnames=["output_vel_repr"])
|
184
234
|
def jacobian(
|
185
235
|
model: js.model.JaxSimModel,
|
@@ -207,7 +257,7 @@ def jacobian(
|
|
207
257
|
"""
|
208
258
|
|
209
259
|
n_l = model.number_of_links()
|
210
|
-
n_f =
|
260
|
+
n_f = model.number_of_frames()
|
211
261
|
|
212
262
|
exceptions.raise_value_error_if(
|
213
263
|
condition=jnp.array([frame_index < n_l, frame_index >= n_l + n_f]).any(),
|
jaxsim/api/kin_dyn_parameters.py
CHANGED
@@ -268,6 +268,16 @@ class KynDynParameters(JaxsimDataclass):
|
|
268
268
|
|
269
269
|
return len(self.joint_model.joint_names) - 1
|
270
270
|
|
271
|
+
def number_of_frames(self) -> int:
|
272
|
+
"""
|
273
|
+
Return the number of frames of the model.
|
274
|
+
|
275
|
+
Returns:
|
276
|
+
The number of frames of the model.
|
277
|
+
"""
|
278
|
+
|
279
|
+
return len(self.frame_parameters.name)
|
280
|
+
|
271
281
|
def support_body_array(self, link_index: jtp.IntLike) -> jtp.Vector:
|
272
282
|
r"""
|
273
283
|
Return the support parent array :math:`\kappa(i)` of a link.
|
jaxsim/api/model.py
CHANGED
@@ -327,6 +327,17 @@ class JaxSimModel(JaxsimDataclass):
|
|
327
327
|
|
328
328
|
return self.kin_dyn_parameters.number_of_joints()
|
329
329
|
|
330
|
+
def number_of_frames(self) -> int:
|
331
|
+
"""
|
332
|
+
Return the number of frames in the model.
|
333
|
+
|
334
|
+
Returns:
|
335
|
+
The number of frames in the model.
|
336
|
+
|
337
|
+
"""
|
338
|
+
|
339
|
+
return self.kin_dyn_parameters.number_of_frames()
|
340
|
+
|
330
341
|
# =================
|
331
342
|
# Base link methods
|
332
343
|
# =================
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: jaxsim
|
3
|
-
Version: 0.5.1.
|
3
|
+
Version: 0.5.1.dev15
|
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>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
jaxsim/__init__.py,sha256=opgtbhhd1kDsHI4H1vOd3loMPDRi884yQ3tohfFGfNc,3382
|
2
|
-
jaxsim/_version.py,sha256=
|
2
|
+
jaxsim/_version.py,sha256=vZ6osR5S31orbH9k8WCF49p5y80vE01iHuobXco_4wQ,426
|
3
3
|
jaxsim/exceptions.py,sha256=vSoScaRD4nvh6jltgK9Ry5pKnE0O5hb4_yI_pk_fvR8,2175
|
4
4
|
jaxsim/logging.py,sha256=STI-D_upXZYX-ZezLrlJJ0UlD5YspST0vZ_DcIwkzO4,1553
|
5
5
|
jaxsim/typing.py,sha256=2HXy9hgazPXjofi1vLQ09ZubPtgVmg80U9NKmZ6NYiI,761
|
@@ -8,11 +8,11 @@ jaxsim/api/com.py,sha256=m-p3EJDhpnMTlXKplfbZE_aH9NqX_VyLlAE3vUhc6l4,13642
|
|
8
8
|
jaxsim/api/common.py,sha256=SNgxq42r6eF_-aPszvOjUYkGwXOzz4hKmhDwEUkscFQ,6650
|
9
9
|
jaxsim/api/contact.py,sha256=cPE7FIUycGzmmNW4Zh9w7qsWd4cQYowo_Tg3mL2evL0,25657
|
10
10
|
jaxsim/api/data.py,sha256=ThRpoBlbdwf1N3xs8SWrY5d8RbfdYRwFcmkdIPgtee4,29004
|
11
|
-
jaxsim/api/frame.py,sha256=
|
11
|
+
jaxsim/api/frame.py,sha256=MT6Qpg5uJDnhik899QNpHskZMijgjMSOw-2v-t-kul4,14434
|
12
12
|
jaxsim/api/joint.py,sha256=8rCIxRMeAidsaBbw7kkGp6z3-UmBPtqmYmV_arHDQJ8,7365
|
13
|
-
jaxsim/api/kin_dyn_parameters.py,sha256=
|
13
|
+
jaxsim/api/kin_dyn_parameters.py,sha256=wnto0nzzEJ_M8tH2PUdldEyxQwQdsStYUoQFu696uuw,29897
|
14
14
|
jaxsim/api/link.py,sha256=nHjffhNdi_xGkteMsqdb_hC9mdV9rNw7k3pl89Uhw_8,12798
|
15
|
-
jaxsim/api/model.py,sha256=
|
15
|
+
jaxsim/api/model.py,sha256=pNO-m7ZbHFvuGftu-ngvj05z8Fo0WOT69dU71fl_hA8,79801
|
16
16
|
jaxsim/api/ode.py,sha256=_t18avoCJngQk6eMFTGpaeahbpchQP20qJnUOCPkz8s,15360
|
17
17
|
jaxsim/api/ode_data.py,sha256=1SD-x-lYk_YSEnVpxTLd69uOKC0mFUj44ZqpSmEDOxw,20190
|
18
18
|
jaxsim/api/references.py,sha256=eIOk3MAOc9LJSKfI8M4WA8gGD-meo50vRfhXdea4sNI,20539
|
@@ -66,8 +66,8 @@ jaxsim/utils/__init__.py,sha256=Y5zyoRevl3EMVQadhZ4EtSwTEkDt2vcnFoRhPJjKTZ0,215
|
|
66
66
|
jaxsim/utils/jaxsim_dataclass.py,sha256=TGmTQV2Lq7Q-2nLoAEaeNtkPa_qj0IKkdBm4COj46Os,11312
|
67
67
|
jaxsim/utils/tracing.py,sha256=eEY28MZW0Lm_jJNt1NkFqZz0ek01tvhR46OXZYCo7tc,532
|
68
68
|
jaxsim/utils/wrappers.py,sha256=ZY7olSORzZRvSzkdeNLj8yjwUIAt9L0Douwl7wItjpk,4008
|
69
|
-
jaxsim-0.5.1.
|
70
|
-
jaxsim-0.5.1.
|
71
|
-
jaxsim-0.5.1.
|
72
|
-
jaxsim-0.5.1.
|
73
|
-
jaxsim-0.5.1.
|
69
|
+
jaxsim-0.5.1.dev15.dist-info/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
|
70
|
+
jaxsim-0.5.1.dev15.dist-info/METADATA,sha256=FWiRQPtrY025jPRO9quPaPPI8QVR6FT8EB16P5Nr0E8,17535
|
71
|
+
jaxsim-0.5.1.dev15.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
72
|
+
jaxsim-0.5.1.dev15.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
|
73
|
+
jaxsim-0.5.1.dev15.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|