jaxsim 0.6.2.dev253__py3-none-any.whl → 0.6.2.dev264__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/data.py +1 -7
- jaxsim/api/integrators.py +108 -0
- jaxsim/api/model.py +1 -0
- jaxsim/math/transform.py +1 -8
- jaxsim/rbda/aba.py +1 -1
- jaxsim/rbda/contacts/rigid.py +1 -1
- {jaxsim-0.6.2.dev253.dist-info → jaxsim-0.6.2.dev264.dist-info}/METADATA +1 -1
- {jaxsim-0.6.2.dev253.dist-info → jaxsim-0.6.2.dev264.dist-info}/RECORD +12 -12
- {jaxsim-0.6.2.dev253.dist-info → jaxsim-0.6.2.dev264.dist-info}/WHEEL +0 -0
- {jaxsim-0.6.2.dev253.dist-info → jaxsim-0.6.2.dev264.dist-info}/licenses/LICENSE +0 -0
- {jaxsim-0.6.2.dev253.dist-info → jaxsim-0.6.2.dev264.dist-info}/top_level.txt +0 -0
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.6.2.
|
21
|
-
__version_tuple__ = version_tuple = (0, 6, 2, '
|
20
|
+
__version__ = version = '0.6.2.dev264'
|
21
|
+
__version_tuple__ = version_tuple = (0, 6, 2, 'dev264')
|
jaxsim/api/data.py
CHANGED
@@ -431,13 +431,6 @@ class JaxSimModelData(common.ModelDataWithVelocityRepresentation):
|
|
431
431
|
if contact_state is None:
|
432
432
|
contact_state = self.contact_state
|
433
433
|
|
434
|
-
if isinstance(model.contact_model, jaxsim.rbda.contacts.SoftContacts):
|
435
|
-
contact_state = {
|
436
|
-
"tangential_deformation": jnp.zeros_like(
|
437
|
-
contact_state["tangential_deformation"]
|
438
|
-
)
|
439
|
-
}
|
440
|
-
|
441
434
|
# Normalize the quaternion to avoid numerical issues.
|
442
435
|
base_quaternion_norm = jaxsim.math.safe_norm(
|
443
436
|
base_quaternion, axis=-1, keepdims=True
|
@@ -525,6 +518,7 @@ class JaxSimModelData(common.ModelDataWithVelocityRepresentation):
|
|
525
518
|
_joint_transforms=joint_transforms,
|
526
519
|
_link_transforms=link_transforms,
|
527
520
|
_link_velocities=link_velocities,
|
521
|
+
contact_state=contact_state,
|
528
522
|
validate=validate,
|
529
523
|
)
|
530
524
|
|
jaxsim/api/integrators.py
CHANGED
@@ -156,9 +156,117 @@ def rk4_integration(
|
|
156
156
|
return data_tf.replace(model=model)
|
157
157
|
|
158
158
|
|
159
|
+
def rk4fast_integration(
|
160
|
+
model: js.model.JaxSimModel,
|
161
|
+
data: JaxSimModelData,
|
162
|
+
link_forces: jtp.Vector,
|
163
|
+
joint_torques: jtp.Vector,
|
164
|
+
) -> JaxSimModelData:
|
165
|
+
"""
|
166
|
+
Integrate the system state using the Runge-Kutta 4 fast method.
|
167
|
+
|
168
|
+
Note:
|
169
|
+
This method is a faster version of the RK4 method, but it may not be as accurate.
|
170
|
+
It computes the contact forces only once at the beginning of the integration step.
|
171
|
+
"""
|
172
|
+
|
173
|
+
dt = model.time_step
|
174
|
+
|
175
|
+
if len(model.kin_dyn_parameters.contact_parameters.body) > 0:
|
176
|
+
|
177
|
+
# Compute the 6D forces W_f ∈ ℝ^{n_L × 6} applied to links due to contact
|
178
|
+
# with the terrain.
|
179
|
+
W_f_L_terrain, contact_state_derivative = js.contact.link_contact_forces(
|
180
|
+
model=model,
|
181
|
+
data=data,
|
182
|
+
link_forces=link_forces,
|
183
|
+
joint_torques=joint_torques,
|
184
|
+
)
|
185
|
+
|
186
|
+
W_f_L_total = link_forces + W_f_L_terrain
|
187
|
+
|
188
|
+
# Update the contact state data. This is necessary only for the contact models
|
189
|
+
# that require propagation and integration of contact state.
|
190
|
+
contact_state = model.contact_model.update_contact_state(contact_state_derivative)
|
191
|
+
|
192
|
+
def f(x) -> dict[str, jtp.Matrix]:
|
193
|
+
|
194
|
+
with data.switch_velocity_representation(jaxsim.VelRepr.Inertial):
|
195
|
+
|
196
|
+
data_ti = data.replace(model=model, **x)
|
197
|
+
|
198
|
+
W_v̇_WB, s̈ = js.model.forward_dynamics_aba(
|
199
|
+
model=model,
|
200
|
+
data=data_ti,
|
201
|
+
joint_forces=joint_torques,
|
202
|
+
link_forces=W_f_L_total,
|
203
|
+
)
|
204
|
+
|
205
|
+
W_ṗ_B, W_Q̇_B, ṡ = js.ode.system_position_dynamics(
|
206
|
+
data=data,
|
207
|
+
baumgarte_quaternion_regularization=1.0,
|
208
|
+
)
|
209
|
+
|
210
|
+
return dict(
|
211
|
+
base_position=W_ṗ_B,
|
212
|
+
base_quaternion=W_Q̇_B,
|
213
|
+
joint_positions=ṡ,
|
214
|
+
base_linear_velocity=W_v̇_WB[0:3],
|
215
|
+
base_angular_velocity=W_v̇_WB[3:6],
|
216
|
+
joint_velocities=s̈,
|
217
|
+
# The contact state is not updated here, as it is assumed to be constant.
|
218
|
+
contact_state=data_ti.contact_state,
|
219
|
+
)
|
220
|
+
|
221
|
+
base_quaternion_norm = jaxsim.math.safe_norm(data._base_quaternion, axis=-1)
|
222
|
+
base_quaternion = data._base_quaternion / jnp.where(
|
223
|
+
base_quaternion_norm == 0, 1.0, base_quaternion_norm
|
224
|
+
)
|
225
|
+
|
226
|
+
x_t0 = dict(
|
227
|
+
base_position=data._base_position,
|
228
|
+
base_quaternion=base_quaternion,
|
229
|
+
joint_positions=data._joint_positions,
|
230
|
+
base_linear_velocity=data._base_linear_velocity,
|
231
|
+
base_angular_velocity=data._base_angular_velocity,
|
232
|
+
joint_velocities=data._joint_velocities,
|
233
|
+
contact_state=contact_state,
|
234
|
+
)
|
235
|
+
|
236
|
+
euler_mid = lambda x, dxdt: x + (0.5 * dt) * dxdt
|
237
|
+
euler_fin = lambda x, dxdt: x + dt * dxdt
|
238
|
+
|
239
|
+
k1 = f(x_t0)
|
240
|
+
k2 = f(jax.tree.map(euler_mid, x_t0, k1))
|
241
|
+
k3 = f(jax.tree.map(euler_mid, x_t0, k2))
|
242
|
+
k4 = f(jax.tree.map(euler_fin, x_t0, k3))
|
243
|
+
|
244
|
+
# Average the slopes and compute the RK4 state derivative.
|
245
|
+
average = lambda k1, k2, k3, k4: (k1 + 2 * k2 + 2 * k3 + k4) / 6
|
246
|
+
|
247
|
+
dxdt = jax.tree_util.tree_map(average, k1, k2, k3, k4)
|
248
|
+
|
249
|
+
# Integrate the dynamics
|
250
|
+
x_tf = jax.tree_util.tree_map(euler_fin, x_t0, dxdt)
|
251
|
+
|
252
|
+
data_tf = dataclasses.replace(
|
253
|
+
data,
|
254
|
+
_base_position=x_tf["base_position"],
|
255
|
+
_base_quaternion=x_tf["base_quaternion"],
|
256
|
+
_joint_positions=x_tf["joint_positions"],
|
257
|
+
_base_linear_velocity=x_tf["base_linear_velocity"],
|
258
|
+
_base_angular_velocity=x_tf["base_angular_velocity"],
|
259
|
+
_joint_velocities=x_tf["joint_velocities"],
|
260
|
+
contact_state=x_tf["contact_state"],
|
261
|
+
)
|
262
|
+
|
263
|
+
return data_tf.replace(model=model)
|
264
|
+
|
265
|
+
|
159
266
|
_INTEGRATORS_MAP: dict[
|
160
267
|
js.model.IntegratorType, Callable[..., js.data.JaxSimModelData]
|
161
268
|
] = {
|
162
269
|
js.model.IntegratorType.SemiImplicitEuler: semi_implicit_euler_integration,
|
163
270
|
js.model.IntegratorType.RungeKutta4: rk4_integration,
|
271
|
+
js.model.IntegratorType.RungeKutta4Fast: rk4fast_integration,
|
164
272
|
}
|
jaxsim/api/model.py
CHANGED
jaxsim/math/transform.py
CHANGED
@@ -92,11 +92,4 @@ class Transform:
|
|
92
92
|
The 4x4 inverse transformation matrix.
|
93
93
|
"""
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
return (
|
98
|
-
jaxlie.SE3.from_matrix(matrix=A_H_B)
|
99
|
-
.inverse()
|
100
|
-
.as_matrix()
|
101
|
-
.reshape(transform.shape[:-2] + (4, 4))
|
102
|
-
)
|
95
|
+
return jaxlie.SE3.from_matrix(matrix=transform).inverse().as_matrix()
|
jaxsim/rbda/aba.py
CHANGED
jaxsim/rbda/contacts/rigid.py
CHANGED
@@ -357,7 +357,7 @@ class RigidContacts(ContactModel):
|
|
357
357
|
# G x ≤ h
|
358
358
|
#
|
359
359
|
# TODO: add possibility to notify if the QP problem did not converge.
|
360
|
-
solution, _, _, _, converged, _ = qpax.solve_qp( # noqa:
|
360
|
+
solution, _, _, _, converged, _ = qpax.solve_qp( # noqa: RUF059
|
361
361
|
Q=Q, q=q, A=A, b=b, G=G, h=h_bounds, **self.solver_options
|
362
362
|
)
|
363
363
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: jaxsim
|
3
|
-
Version: 0.6.2.
|
3
|
+
Version: 0.6.2.dev264
|
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=b8dYoVXqtHxHcF56iM2xgKk78lsvmGrfDlvdwaGasgs,3388
|
2
|
-
jaxsim/_version.py,sha256=
|
2
|
+
jaxsim/_version.py,sha256=oLeHDsqsLO5VnFp4ZF6v3W6PavO6GfFRTiLMYRl3wOg,528
|
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
|
@@ -8,13 +8,13 @@ jaxsim/api/actuation_model.py,sha256=GgLi-yhEpsczwhMNYIlMvet8tirmmED6S7AumbSbk4U
|
|
8
8
|
jaxsim/api/com.py,sha256=47a9SSaXY540RCkVnHodwLNUrodIfJIkguIYdSEQVwQ,13697
|
9
9
|
jaxsim/api/common.py,sha256=yTaRXDYkXmISBOhZ93f9TssR0p4wq7qj7B6OsvYzRME,6942
|
10
10
|
jaxsim/api/contact.py,sha256=dlKKDQUG-KQ5qQaYBv2NmZLDb1OnJdltZv8MWXkD_W0,20969
|
11
|
-
jaxsim/api/data.py,sha256=
|
11
|
+
jaxsim/api/data.py,sha256=9pxug2gFIZPwqi9kNYXhEziA5IQBB9KNNwIfPfc_kAU,23249
|
12
12
|
jaxsim/api/frame.py,sha256=4wg6GsyBQgYhSvc-ry_31JsaL66sZt3TtgwjB7NrHmk,14583
|
13
|
-
jaxsim/api/integrators.py,sha256=
|
13
|
+
jaxsim/api/integrators.py,sha256=sHdTWw2Z-Q7jggA8zRkA1KYYd4HNIozXPwNvFwt0YBs,9011
|
14
14
|
jaxsim/api/joint.py,sha256=AnqlNWmBOay-gsoo0y4AbfFQ2OCJm-8T1E0IMhZeLoY,7457
|
15
15
|
jaxsim/api/kin_dyn_parameters.py,sha256=v1ZDb-Eqn552Zb344sJYy9e5sQT--_SYGIdtNC2JVSg,29828
|
16
16
|
jaxsim/api/link.py,sha256=bSZOYJDY9HJMgY25VzevTTsdFZTJc6yRRpslc5FhGHE,12782
|
17
|
-
jaxsim/api/model.py,sha256=
|
17
|
+
jaxsim/api/model.py,sha256=Do5q7vSyml854wFyN21qJtNfJfFo7TlEfxx_FoTxOW0,69948
|
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
|
@@ -25,7 +25,7 @@ jaxsim/math/joint_model.py,sha256=mV6F3SVHUxHcXMIw-hc4fG341R4rkK8MvRPn53HcEpg,69
|
|
25
25
|
jaxsim/math/quaternion.py,sha256=MSaZywzJDxs2te1ZELeIcupKSFIA9q_pdXy7fDAEqM4,4539
|
26
26
|
jaxsim/math/rotation.py,sha256=TEUtT3X2tFieNxdlccup1pfaTgCTtfX-hTNotd8-nNk,1892
|
27
27
|
jaxsim/math/skew.py,sha256=z_9YN-NDHL3n4KXWNbzTSMkFDZ0SDpz4RUcwwYFOaao,1402
|
28
|
-
jaxsim/math/transform.py,sha256=
|
28
|
+
jaxsim/math/transform.py,sha256=d0_m_obmUOmnI8Bte0ktvibR9Hv9M9qpg8tVuLON2g0,3192
|
29
29
|
jaxsim/math/utils.py,sha256=IiH01iN54BtLnULC04pDfYe8Av99p3FGdYp2jJInm30,1166
|
30
30
|
jaxsim/mujoco/__init__.py,sha256=1kAWzYOS7nP29S5FGyWPqiAnPf4yPSoaPW-WBGBjVV0,214
|
31
31
|
jaxsim/mujoco/__main__.py,sha256=GBmB7J-zj75ZnFyuAAmpSOpbxi_HhHhWJeot3ljGDJY,5291
|
@@ -45,7 +45,7 @@ jaxsim/parsers/rod/meshes.py,sha256=yAXefG73_zqbVKRUdlcz9yFmypjDIpiP9cO96PeAozE,
|
|
45
45
|
jaxsim/parsers/rod/parser.py,sha256=vaOlvlvgQCEGbymFc21praHKEVq_LqqlKeRJNv7tZiE,14398
|
46
46
|
jaxsim/parsers/rod/utils.py,sha256=wmD-wCF1lLO8pknX7A3a8CGt9wDlTS_xCqQulcZ_XlM,8242
|
47
47
|
jaxsim/rbda/__init__.py,sha256=ksfupKZzeJyysxrbyMyEfszUdBH6LfCfkSz3KLfODhY,328
|
48
|
-
jaxsim/rbda/aba.py,sha256=
|
48
|
+
jaxsim/rbda/aba.py,sha256=jxvss3XL8pBaT40bWG5pHcH9f1DDl3LoRqdnpFSlCWo,9030
|
49
49
|
jaxsim/rbda/collidable_points.py,sha256=XyeV1I43GL22j03rkNVocaIPOGYirt3PiDHrFMndziQ,2070
|
50
50
|
jaxsim/rbda/crba.py,sha256=DC9kBXMG1qXaoAdo8K7OCnVHT_YUaL_t6Li56sRf8ro,5093
|
51
51
|
jaxsim/rbda/forward_kinematics.py,sha256=qem7Yp-B2oNVOsU3Q2CWV2tbfZKJOCAdDozFgaPB8tg,3838
|
@@ -57,7 +57,7 @@ jaxsim/rbda/actuation/common.py,sha256=aGFqO4VTgQLsTJyOtVuoa_otT_RbkckmG3rq7wjOy
|
|
57
57
|
jaxsim/rbda/contacts/__init__.py,sha256=resrBkTdOA-1YMdcdUH2RATEhAf_Ye6MQNtjG3ClMYQ,371
|
58
58
|
jaxsim/rbda/contacts/common.py,sha256=qVm3Ghoytg1HAeykNrYw5-4rQJ4Mv7h0Pk75ETzGXyc,9045
|
59
59
|
jaxsim/rbda/contacts/relaxed_rigid.py,sha256=RjeLF06Pp19qio447U9z5EdhdM6nyMh-ISQX_2-vdaE,21349
|
60
|
-
jaxsim/rbda/contacts/rigid.py,sha256=
|
60
|
+
jaxsim/rbda/contacts/rigid.py,sha256=gHOpNQ_sk7nQcpGAE_nFOSq8fza2yFv_Mqqs-e118q8,17603
|
61
61
|
jaxsim/rbda/contacts/soft.py,sha256=Ac9aWDdjAm55Mv9LLnEs3nj7hX_NvJMnicV35SbFLSY,15282
|
62
62
|
jaxsim/terrain/__init__.py,sha256=f7lVX-iNpH_wkkjef9Qpjh19TTAUOQw76EiLYJDVizc,78
|
63
63
|
jaxsim/terrain/terrain.py,sha256=so8kqVsUlPXqOKQ_UaYW6HE4XS8nTZRdFdXQyhB2tG4,6725
|
@@ -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.6.2.
|
69
|
-
jaxsim-0.6.2.
|
70
|
-
jaxsim-0.6.2.
|
71
|
-
jaxsim-0.6.2.
|
72
|
-
jaxsim-0.6.2.
|
68
|
+
jaxsim-0.6.2.dev264.dist-info/licenses/LICENSE,sha256=eaYdFmdeMbiIoIiPzEK0MjP1S9wtFXjXNR5er49uLR0,1546
|
69
|
+
jaxsim-0.6.2.dev264.dist-info/METADATA,sha256=KJmAE7MbfhUFSsRrMFTrHJTD3GUdaUPXVMuEFWU-HiU,19658
|
70
|
+
jaxsim-0.6.2.dev264.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
71
|
+
jaxsim-0.6.2.dev264.dist-info/top_level.txt,sha256=LxGMA8FLtXjQ6oI7N5gd_R_oSUHxpXxUEOfT1xS_ni0,7
|
72
|
+
jaxsim-0.6.2.dev264.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|