Repository navigation
Description
Describe the bug
_NewtonTaskSpaceAction._compute_ee_jacobian (shared by NewtonDifferentialInverseKinematicsAction and
NewtonOperationalSpaceControllerAction) shifts the body Jacobian to the body_offset frame with the formula that
#7989 removed from the core task-space terms:
- the lever arm
skew(body_offset.pos)uses the offset in body axes, although the Jacobian is expressed in root
axes. It must first be rotated by the body orientation in the root frame; - the angular rows are multiplied by
R(body_offset.rot). The offset frame is rigid on the body, so its angular
velocity equals the body's and these rows must stay unchanged.
The same class computes the offset frame's pose (combine_frame_transforms) and velocity
(_compute_ee_velocity, lever arm rotated by the body orientation) correctly, so the Jacobian disagrees with both.
In general they only coincide when the body is aligned with the root and the offset rotation is identity. For the usual
Franka hand offset (0, 0, 0.107) with the hand pointing down, the lever arm's sign is effectively flipped.
Steps to reproduce
Kit-free, one revolute joint about z, body yawed 90 degrees from the root, offset (1, 0, 0) rotated 90 degrees
about x:
import math
from types import SimpleNamespace
import torch
from isaaclab_newton.envs.mdp.actions.newton_task_space_actions import _NewtonTaskSpaceAction
s = math.sin(math.pi / 4.0)
data = SimpleNamespace(
body_link_jacobian_w=SimpleNamespace(torch=torch.tensor([0.0, 0, 0, 0, 0, 1]).reshape(1, 1, 6, 1)),
root_quat_w=SimpleNamespace(torch=torch.tensor([[0.0, 0, 0, 1]])),
body_quat_w=SimpleNamespace(torch=torch.tensor([[[0.0, 0, s, s]]])),
)
term = SimpleNamespace(
_asset=SimpleNamespace(data=data), _body_idx=0, _jacobi_body_idx=0, _jacobi_joint_ids=[0],
_jacobian_b=torch.zeros(1, 6, 1), _offset_pos=torch.tensor([[1.0, 0, 0]]), _offset_rot=torch.tensor([[s, 0, 0, s]]),
)
print(_NewtonTaskSpaceAction._compute_ee_jacobian(term).flatten())
# expected (-1, 0, 0, 0, 0, 1); actual (0, 1, 0, 0, -1, 0)On the official FRANKA_PANDA_HIGH_PD_CFG (fixed base, rotated root, 4 envs, random joint velocities), comparing
J @ qdot with the offset-frame twist built from the simulator body velocities:
| offset | backend | Newton term lin / ang error [m/s, rad/s] | core term lin / ang error |
|---|---|---|---|
(0, 0, 0.107) |
Newton (MJWarp) | 0.26 / 1e-7 | 2e-6 / 1e-7 |
(0.03, -0.02, 0.107), 0.7 rad about x |
Newton (MJWarp) | 0.28 / 0.95 | 2e-6 / 1e-7 |
(0.03, -0.02, 0.107), 0.7 rad about x |
PhysX | 0.27 / 0.94 | 1e-4 / 4e-4 |
The twist norm is about 1.5, so the linear error is about 18 % of it. DiffIK is closed-loop and still
converges, but more slowly. With the rotated offset, the position error after 100 steps is 1.7e-3 m instead of
3.7e-4 m on Newton. OSC maps its wrench and task-space inertia through the same wrong Jacobian.
System Info
- Commit: develop 3791c0f (release/3.0.0 7767e24 has the same code)
- Isaac Sim Version: 6.1.0
- OS: Ubuntu 24.04
- GPU: RTX PRO 5000 Blackwell
- CUDA: 13.0
- GPU Driver: 580.126.20
Additional context
The Newton terms were added in #7854, which merged the same day as #7989 and kept the previous formula.
Checklist
- I have checked that there is no similar issue in the repo (required)
- I have checked that the issue is not in running Isaac Sim itself and is related to the repo
Acceptance Criteria
- The Newton task-space Jacobian with
body_offsetmatches the offset frame's velocity, as in the core terms.
Activity
Fix Newton body-offset Jacobian and streamline core offset math (isaa…
Fix Newton body-offset Jacobian and streamline core offset math (isaa…