Skip to content

Commit

Permalink
fix tests on frame and check on frame idx
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlottaSartore committed Nov 27, 2024
1 parent 5fdbe5b commit 436fde6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jaxsim/api/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ def velocity(
Returns:
The 6D velocity of the frame in the specified velocity representation.
"""
n_l = model.number_of_links()
n_f = model.number_of_frames()

exceptions.raise_value_error_if(
condition=jnp.array(
[frame_index < 0, frame_index >= model.number_of_frames()]
).any(),
condition=jnp.array([frame_index < n_l, frame_index >= n_l + n_f]).any(),
msg="Invalid frame index '{idx}'",
idx=frame_index,
)
Expand Down Expand Up @@ -257,7 +257,7 @@ def jacobian(
"""

n_l = model.number_of_links()
n_f = len(model.frame_names())
n_f = model.number_of_frames()

exceptions.raise_value_error_if(
condition=jnp.array([frame_index < n_l, frame_index >= n_l + n_f]).any(),
Expand Down

0 comments on commit 436fde6

Please sign in to comment.