Unverified Commit d282255c authored by Lorenz Wellhausen's avatar Lorenz Wellhausen Committed by GitHub

Fixes Jacobian joint indices for floating base articulations (#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 #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
parent 361578f2
......@@ -64,8 +64,10 @@ class DifferentialInverseKinematicsAction(ActionTerm):
# 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(
......@@ -176,7 +178,7 @@ class DifferentialInverseKinematicsAction(ActionTerm):
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment