Skip to content

Commit

Permalink
Speed up parent link indexes extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Oct 23, 2024
1 parent c8d6b53 commit 4c631fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jaxsim/api/references.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ def apply_frame_forces(

# Extract the frame indices.
frame_idxs = js.frame.names_to_idxs(frame_names=frame_names, model=model)
parent_link_idxs = jax.vmap(js.frame.idx_of_parent_link, in_axes=(None,))(
model, frame_index=frame_idxs
)
parent_link_idxs = model.kin_dyn_parameters.frame_parameters.body[
frame_idxs - model.number_of_links
]

exceptions.raise_value_error_if(
condition=~data.valid(model=model),
Expand Down

0 comments on commit 4c631fa

Please sign in to comment.