jaxsim 0.7.1.dev18__py3-none-any.whl → 0.7.1.dev32__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
@@ -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.dev18'
21
- __version_tuple__ = version_tuple = (0, 7, 1, 'dev18')
20
+ __version__ = version = '0.7.1.dev32'
21
+ __version_tuple__ = version_tuple = (0, 7, 1, 'dev32')
@@ -910,9 +910,9 @@ class HwLinkMetadata(JaxsimDataclass):
910
910
 
911
911
  Attributes:
912
912
  shape: The shape of the link.
913
- 0 = box, 1 = sphere, 2 = cylinder, -1 = unsupported.
913
+ 0 = box, 1 = cylinder, 2 = sphere, -1 = unsupported.
914
914
  dims: The dimensions of the link.
915
- box: [lx,ly,lz], sphere: [r,0,0], cylinder: [r,l,0]
915
+ box: [lx,ly,lz], cylinder: [r,l,0], sphere: [r,0,0].
916
916
  density: The density of the link.
917
917
  L_H_G: The homogeneous transformation matrix from the link frame to the CoM frame G.
918
918
  L_H_vis: The homogeneous transformation matrix from the link frame to the visual frame.
@@ -1026,7 +1026,13 @@ class HwLinkMetadata(JaxsimDataclass):
1026
1026
  shape,
1027
1027
  branches=[
1028
1028
  # Box
1029
- lambda: scaling_factors,
1029
+ lambda: jnp.array(
1030
+ [
1031
+ scaling_factors[0],
1032
+ scaling_factors[1],
1033
+ scaling_factors[2],
1034
+ ]
1035
+ ),
1030
1036
  # Cylinder
1031
1037
  lambda: jnp.array(
1032
1038
  [
jaxsim/api/model.py CHANGED
@@ -387,7 +387,7 @@ class JaxSimModel(JaxsimDataclass):
387
387
  L_H_Gs = []
388
388
  L_H_vises = []
389
389
  L_H_pre_masks = []
390
- L_H_pres = []
390
+ L_H_pre = []
391
391
 
392
392
  # Process each link
393
393
  for link_description in ordered_links:
@@ -454,17 +454,17 @@ class JaxSimModel(JaxsimDataclass):
454
454
  L_H_pre_masks.append(
455
455
  [
456
456
  int(joint_index in child_joints_indices)
457
- for joint_index in range(self.number_of_joints())
457
+ for joint_index in range(0, self.number_of_joints())
458
458
  ]
459
459
  )
460
- L_H_pres.append(
460
+ L_H_pre.append(
461
461
  [
462
462
  (
463
463
  self.kin_dyn_parameters.joint_model.λ_H_pre[joint_index + 1]
464
464
  if joint_index in child_joints_indices
465
465
  else jnp.eye(4)
466
466
  )
467
- for joint_index in range(self.number_of_joints())
467
+ for joint_index in range(0, self.number_of_joints())
468
468
  ]
469
469
  )
470
470
 
@@ -476,7 +476,7 @@ class JaxSimModel(JaxsimDataclass):
476
476
  L_H_G=jnp.array(L_H_Gs, dtype=float),
477
477
  L_H_vis=jnp.array(L_H_vises, dtype=float),
478
478
  L_H_pre_mask=jnp.array(L_H_pre_masks, dtype=bool),
479
- L_H_pre=jnp.array(L_H_pres, dtype=float),
479
+ L_H_pre=jnp.array(L_H_pre, dtype=float),
480
480
  )
481
481
 
482
482
  def export_updated_model(self) -> str:
@@ -777,10 +777,17 @@ def reduce(
777
777
  integrator=model.integrator,
778
778
  )
779
779
 
780
- # Store the origin of the model, in case downstream logic needs it.
781
780
  with reduced_model.mutable_context(mutability=Mutability.MUTABLE_NO_VALIDATION):
781
+ # Store the origin of the model, in case downstream logic needs it.
782
782
  reduced_model.built_from = model.built_from
783
783
 
784
+ # Compute the hw parametrization metadata of the reduced model
785
+ # TODO: move the building of the metadata to KinDynParameters.build()
786
+ # and use the model_description instead of model.built_from.
787
+ reduced_model.kin_dyn_parameters.hw_link_metadata = (
788
+ reduced_model.compute_hw_link_metadata()
789
+ )
790
+
784
791
  return reduced_model
785
792
 
786
793
 
@@ -2373,15 +2380,22 @@ def update_hw_parameters(
2373
2380
  return jax.lax.cond(
2374
2381
  jnp.any(L_H_pre_mask_for_joint),
2375
2382
  lambda: selected_transform,
2376
- lambda: kin_dyn_params.joint_model.λ_H_pre[joint_index],
2383
+ lambda: kin_dyn_params.joint_model.λ_H_pre[joint_index + 1],
2377
2384
  )
2378
2385
 
2379
2386
  # Apply the update function to all joint indices
2380
2387
  updated_λ_H_pre = jax.vmap(update_λ_H_pre)(
2381
- jnp.arange(kin_dyn_params.number_of_joints() + 1)
2388
+ jnp.arange(kin_dyn_params.number_of_joints())
2389
+ )
2390
+ # NOTE: λ_H_pre should be of len (1+n_joints) with the 0-th element equal
2391
+ # to identity to represent the world-to-base tree transform. See JointModel class
2392
+ updated_λ_H_pre_with_base = jnp.concatenate(
2393
+ (jnp.eye(4).reshape(1, 4, 4), updated_λ_H_pre), axis=0
2382
2394
  )
2383
2395
  # Replace the joint model with the updated transforms
2384
- updated_joint_model = kin_dyn_params.joint_model.replace(λ_H_pre=updated_λ_H_pre)
2396
+ updated_joint_model = kin_dyn_params.joint_model.replace(
2397
+ λ_H_pre=updated_λ_H_pre_with_base
2398
+ )
2385
2399
 
2386
2400
  # Replace the kin_dyn_parameters with updated values
2387
2401
  updated_kin_dyn_params = kin_dyn_params.replace(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jaxsim
3
- Version: 0.7.1.dev18
3
+ Version: 0.7.1.dev32
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=EKeysKN-7UswwJLCl7n6qIBKQIVUtYsCMYu_tCoFn7g,3628
2
- jaxsim/_version.py,sha256=TLs9huVO9q-y4NJCdgDEyChpVIXEhTeSUWBiVJbQ3AU,526
2
+ jaxsim/_version.py,sha256=CRJMS8F-10dpwjKoRwLGUghZ4-YrOJ9deKAbdUr0Q9g,526
3
3
  jaxsim/exceptions.py,sha256=MQ3LRMfVMX2-g3qYj7mUVNV9OLlIA48TANJegbcQyXI,2641
4
4
  jaxsim/logging.py,sha256=STI-D_upXZYX-ZezLrlJJ0UlD5YspST0vZ_DcIwkzO4,1553
5
5
  jaxsim/typing.py,sha256=7msl8t5Jt09RNYfKdPJtpjLfWurldcycDappb045Eso,761
@@ -12,9 +12,9 @@ jaxsim/api/data.py,sha256=9pxug2gFIZPwqi9kNYXhEziA5IQBB9KNNwIfPfc_kAU,23249
12
12
  jaxsim/api/frame.py,sha256=4wg6GsyBQgYhSvc-ry_31JsaL66sZt3TtgwjB7NrHmk,14583
13
13
  jaxsim/api/integrators.py,sha256=sHdTWw2Z-Q7jggA8zRkA1KYYd4HNIozXPwNvFwt0YBs,9011
14
14
  jaxsim/api/joint.py,sha256=AnqlNWmBOay-gsoo0y4AbfFQ2OCJm-8T1E0IMhZeLoY,7457
15
- jaxsim/api/kin_dyn_parameters.py,sha256=r1rOjKfe7Qg7xBWyCNtlAi_Wg1WTzToQrUdbZ7PO10Q,39073
15
+ jaxsim/api/kin_dyn_parameters.py,sha256=VrQvH5MXxyiZRkUtXrm99bAZ8bs9Ry02uWMYc-5ZL9Q,39263
16
16
  jaxsim/api/link.py,sha256=bSZOYJDY9HJMgY25VzevTTsdFZTJc6yRRpslc5FhGHE,12782
17
- jaxsim/api/model.py,sha256=ppdriJBHWJ-qXey9Vjqnd7IjqdEE0R6W9ZG9Y7KuS2s,85460
17
+ jaxsim/api/model.py,sha256=Yhcf2ktTO8Ja3XLDCuh8Xc88FXI92801xiSMHCIFv1o,86126
18
18
  jaxsim/api/ode.py,sha256=fp20_LK9lXw2DfNkQgrfJmtd_iBXDNzZkOn0u5Pm8Qw,6190
19
19
  jaxsim/api/references.py,sha256=-vd50y3v-jkXAsILS432etIKV6e2EUE2oOeLHuUrfuQ,20399
20
20
  jaxsim/math/__init__.py,sha256=dNozvtm8WsB7nxw4uK29yQQKPcDUEczr2zcHoZfMItc,383
@@ -65,8 +65,8 @@ jaxsim/utils/__init__.py,sha256=Y5zyoRevl3EMVQadhZ4EtSwTEkDt2vcnFoRhPJjKTZ0,215
65
65
  jaxsim/utils/jaxsim_dataclass.py,sha256=XzmZeIibcaOzaxpprsGSxH3UrM66PAO456rFV91sNXg,11453
66
66
  jaxsim/utils/tracing.py,sha256=Btwxdfhb7fJLk3r5PlQkGYj60Y2KbFT1gANGIA697FU,530
67
67
  jaxsim/utils/wrappers.py,sha256=3IMwydqFgmSPqeuUQ3PRmdhDc1IoT6XC23jPC_LjWXs,4175
68
- jaxsim-0.7.1.dev18.dist-info/licenses/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
69
- jaxsim-0.7.1.dev18.dist-info/METADATA,sha256=I0xiLffISlyNbHD7sMWPYHeQbxaA3dHG1FCVLAGZW5I,17851
70
- jaxsim-0.7.1.dev18.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
71
- jaxsim-0.7.1.dev18.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
72
- jaxsim-0.7.1.dev18.dist-info/RECORD,,
68
+ jaxsim-0.7.1.dev32.dist-info/licenses/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
69
+ jaxsim-0.7.1.dev32.dist-info/METADATA,sha256=Jf7hLqf34wgxQaT7ZNW74eNpTpYo3Hr2fXEwPro1o1w,17851
70
+ jaxsim-0.7.1.dev32.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
71
+ jaxsim-0.7.1.dev32.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
72
+ jaxsim-0.7.1.dev32.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5