-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Computes Jacobian in the root frame inside the DifferentialInverseKinematicsAction
class
#967
base: main
Are you sure you want to change the base?
Conversation
@property | ||
def get_jacobian_w(self) -> torch.Tensor: | ||
return self._asset.root_physx_view.get_jacobians()[:, self._jacobi_body_idx, :, self._joint_ids] | ||
|
||
@property | ||
def get_jacobian_b(self) -> torch.Tensor: | ||
jacobian = self.get_jacobian_w | ||
base_rot = self._asset.data.root_quat_w | ||
base_rot_matrix = math_utils.matrix_from_quat(math_utils.quat_inv(base_rot)) | ||
jacobian[:, :3, :] = torch.bmm(base_rot_matrix, jacobian[:, :3, :]) | ||
jacobian[:, 3:, :] = torch.bmm(base_rot_matrix, jacobian[:, 3:, :]) | ||
return jacobian |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to make these properties? If it is only used at one place then you can just keep it there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jtigue suggested that the physx's get_jacobians() is not clear that the returned is in world frame, and keep it there solves the issue but introduced unstated feature, so I instead used property. I understand that use property in only one place is a bit overkill, and I can change it back if that makes more sense
source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/actions/task_space_actions.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zoctipus Thanks a lot for the fix!
Could the unit test here be adapted to make sure the feature works as expected?
Also, you don't need to post a screenshot of the git diff. The screenshot is only for showing results in behavior (not code).
DifferentialInverseKinematicsAction
class
@Mayankm96 I have added tests for checking the implement, all tests are passing!
Will not populates UR10's links and joints into stage. Only an empty /World/envs/env_0/Robot will be created Upon further investigation, it seems like this is an issue when ISAACLAB_NUCLEUS_DIR points to 4.2. Changing 4.2 to 4.1 resolves import issue. Buggy usd path: with OK usd path, both tests can pass |
source/extensions/omni.isaac.lab/omni/isaac/lab/envs/mdp/actions/task_space_actions.py
Outdated
Show resolved
Hide resolved
Thanks for the fix! |
I just rebased the branch to track the newest Isaac Iab and fixed the versioning, |
I have updated versioning in CHANGE LOG and extension.toml, please take a look when you have time! Thanks! @jsmith-bdai @Mayankm96 |
Description
This pull request fix the bug where jacobian returned by DifferentialInverseKinematicsAction._compute_fame_jacobian are not truly in robot base frame because it did not consider robot's base rotation. After the change, _compute_fame_jacobian returns the correct local frame jacobian. In addition, properties get_jacobian_w and get_jacobian_b is added to differentiate frame differences
Fixes #911
Type of change
Screenshots
Checklist
pre-commit
checks with./isaaclab.sh --format
config/extension.toml
fileCONTRIBUTORS.md
or my name already exists there