Skip to content

Commit

Permalink
[ci skip] Add test for the Coriolis matrix RBD
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Sep 11, 2024
1 parent baa4de8 commit ff05233
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_api_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def test_coriolis_matrix(
# =====

I_ν = data.generalized_velocity()
C = js.model.free_floating_coriolis_matrix(model=model, data=data)
C = js.model.free_floating_coriolis_matrix(model=model, data=data, prefer_rbd=False)

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

M = js.model.free_floating_mass_matrix(model=model, data=data)

M_rbd, _, C_rbd = js.model.free_floating_coriolis_matrix(
model=model, data=data, prefer_rbd=True
)

assert C == pytest.approx(C_rbd)
assert M == pytest.approx(M_rbd)


def test_model_fd_id_consistency(
jaxsim_models_types: js.model.JaxSimModel,
Expand Down

0 comments on commit ff05233

Please sign in to comment.