Skip to content

Commit

Permalink
Extract generalized force targets from high-level model
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Jun 9, 2023
1 parent 7d33e05 commit 706f5d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/jaxsim/high_level/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,14 @@ def joint_velocities(self, joint_names: List[str] = None) -> jtp.Vector:
self._joint_indices(joint_names=joint_names)
]

def joint_generalized_forces_targets(
self, joint_names: List[str] = None
) -> jtp.Vector:
if self.dofs() == 0 and (joint_names is None or len(joint_names) == 0):
return jnp.array([])

return self.data.model_input.tau[self._joint_indices(joint_names=joint_names)]

def joint_limits(
self, joint_names: List[str] = None
) -> Tuple[jtp.Vector, jtp.Vector]:
Expand Down

0 comments on commit 706f5d2

Please sign in to comment.