Skip to content

Commit

Permalink
Handle joint computation for jointless models
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Ferigo <[email protected]>
  • Loading branch information
flferretti and diegoferigo committed May 15, 2024
1 parent a6ddcd2 commit 453ea09
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/jaxsim/api/kin_dyn_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,14 @@ def joint_transforms_and_motion_subspaces(
)

# Compute the transforms and motion subspaces of the joints.
pre_H_suc_J, S_J = jax.vmap(supported_joint_motion)(
jnp.array(self.joint_model.joint_types[1:]),
jnp.array(self.joint_model.joint_axis),
jnp.array(joint_positions).astype(float),
)
if self.number_of_joints() == 0:
pre_H_suc_J, S_J = jnp.empty((0, 4, 4)), jnp.empty((0, 6, 1))
else:
pre_H_suc_J, S_J = jax.vmap(supported_joint_motion)(
jnp.array(self.joint_model.joint_types[1:]).astype(int),
jnp.array(self.joint_model.joint_axis),
jnp.array(joint_positions),
)

# Extract the transforms and motion subspaces of the joints.
# We stack the base transform W_H_B at index 0, and a dummy motion subspace
Expand Down

0 comments on commit 453ea09

Please sign in to comment.