Skip to content

Commit ff05233

Browse files
committed
[ci skip] Add test for the Coriolis matrix RBD
1 parent baa4de8 commit ff05233

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/test_api_model.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def test_coriolis_matrix(
407407
# =====
408408

409409
I_ν = data.generalized_velocity()
410-
C = js.model.free_floating_coriolis_matrix(model=model, data=data)
410+
C = js.model.free_floating_coriolis_matrix(model=model, data=data, prefer_rbd=False)
411411

412412
h = js.model.free_floating_bias_forces(model=model, data=data)
413413
g = js.model.free_floating_gravity_forces(model=model, data=data)
@@ -477,6 +477,15 @@ def compute_q̇(data: js.data.JaxSimModelData) -> jax.Array:
477477
# Ensure that (Ṁ - 2C) is skew symmetric.
478478
assert - C - C.T == pytest.approx(0)
479479

480+
M = js.model.free_floating_mass_matrix(model=model, data=data)
481+
482+
M_rbd, _, C_rbd = js.model.free_floating_coriolis_matrix(
483+
model=model, data=data, prefer_rbd=True
484+
)
485+
486+
assert C == pytest.approx(C_rbd)
487+
assert M == pytest.approx(M_rbd)
488+
480489

481490
def test_model_fd_id_consistency(
482491
jaxsim_models_types: js.model.JaxSimModel,

0 commit comments

Comments
 (0)