Skip to content

Commit

Permalink
Speed up js.link.idxs_to_names
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Nov 14, 2024
1 parent f00c3d4 commit 6e097d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/jaxsim/api/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jax
import jax.numpy as jnp
import jax.scipy.linalg
import numpy as np

import jaxsim.api as js
import jaxsim.rbda
Expand Down Expand Up @@ -96,7 +97,7 @@ def idxs_to_names(
The names of the links.
"""

return tuple(idx_to_name(model=model, link_index=idx) for idx in link_indices)
return tuple(np.array(model.kin_dyn_parameters.link_names)[list(link_indices)])


# =========
Expand Down

0 comments on commit 6e097d5

Please sign in to comment.