Skip to content

Commit

Permalink
Test output representation of link jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Jun 4, 2024
1 parent b3577ba commit eb5b327
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_api_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@ def test_link_jacobians(
v_WL_js = js.link.velocity(model=model, data=data, link_index=link_idx)
assert v_WL_js == pytest.approx(v_WL_idt), link_name

# Test conversion to a different output velocity representation.
for other_repr in {VelRepr.Inertial, VelRepr.Body, VelRepr.Mixed}.difference(
{data.velocity_representation}
):

with data.switch_velocity_representation(other_repr):
kin_dyn_other_repr = (
utils_idyntree.build_kindyncomputations_from_jaxsim_model(
model=model, data=data
)
)

for link_name, link_idx in zip(
model.link_names(),
js.link.names_to_idxs(model=model, link_names=model.link_names()),
):
v_WL_idt = kin_dyn_other_repr.frame_velocity(frame_name=link_name)
v_WL_js = js.link.velocity(
model=model, data=data, link_index=link_idx, output_vel_repr=other_repr
)
assert v_WL_js == pytest.approx(v_WL_idt), link_name


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

0 comments on commit eb5b327

Please sign in to comment.