Skip to content

Commit

Permalink
Fixes Jacobian joint indices for floating base articulations (isaac-s…
Browse files Browse the repository at this point in the history
…im#1033)

# Description

Adds `6` to the joint indices when indexing the Jacobian tensor in
floating base systems. This is required because, in floating base
articulations, the first 6 elements of the last dimensions are w.r.t
to the root pose, not the joints.

Fixes isaac-sim#1032

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
  • Loading branch information
lorenwel authored Sep 25, 2024
1 parent fcdcc73 commit 18a208e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ def __init__(self, cfg: actions_cfg.DifferentialInverseKinematicsActionCfg, env:
# this means that number of bodies is one less than the articulation's number of bodies
if self._asset.is_fixed_base:
self._jacobi_body_idx = self._body_idx - 1
self._jacobi_joint_ids = self._joint_ids
else:
self._jacobi_body_idx = self._body_idx
self._jacobi_joint_ids = [i + 6 for i in self._joint_ids]

# log info for debugging
carb.log_info(
Expand Down Expand Up @@ -176,7 +178,7 @@ def _compute_frame_jacobian(self):
the right Jacobian from the parent body Jacobian.
"""
# read the parent jacobian
jacobian = self._asset.root_physx_view.get_jacobians()[:, self._jacobi_body_idx, :, self._joint_ids]
jacobian = self._asset.root_physx_view.get_jacobians()[:, self._jacobi_body_idx, :, self._jacobi_joint_ids]
# account for the offset
if self.cfg.body_offset is not None:
# Modify the jacobian to account for the offset
Expand Down

0 comments on commit 18a208e

Please sign in to comment.