Repository navigation
[Backport release/3.0.0] Newton differential IK, joint impedance, and OSC (#7854) - #8013
Conversation
Backport the merged differential IK, joint impedance, and operational-space controller change without release-specific modifications. (cherry picked from commit 481a676) Co-authored-by: Mustafa H <[email protected]> Co-authored-by: Mustafa Haiderbhai <[email protected]> Signed-off-by: Octi Zhang <[email protected]>
|
run-ci |
|
| self._jacobian_b[:, :3] += torch.bmm( | ||
| -math_utils.skew_symmetric_matrix(self._offset_pos), self._jacobian_b[:, 3:] | ||
| ) | ||
| self._jacobian_b[:, 3:] = torch.bmm(math_utils.matrix_from_quat(self._offset_rot), self._jacobian_b[:, 3:]) |
There was a problem hiding this comment.
Offset uses wrong frame When the body is rotated relative to the robot root and
body_offset.pos is nonzero, the Jacobian rows have already been rotated into the root frame, but this offset is still in the body frame. The linear Jacobian is therefore wrong, so either new task-space action can compute incorrect joint targets or efforts. Rotate the offset into the root frame before applying it.
| ) | ||
| else: | ||
| self._ee_pose_des[:, :3] = command[:, :3] | ||
| self._ee_pose_des[:, 3:] = math_utils.normalize(command[:, 3:]) |
There was a problem hiding this comment.
Zero quaternion remains invalid For an absolute-pose OSC action, an initial or policy command can contain an all-zero quaternion.
normalize leaves it at zero, and the action sends that invalid orientation to the controller, which can produce incorrect efforts. Fall back to a valid orientation, as the differential-IK action in this file does.
| cfg = self._controller.cfg | ||
| data = self._asset.data | ||
| ee_pose = self._compute_ee_pose() | ||
| ee_wrench_des = self._processed_actions[:, self._slices["wrench"]] if self._use_wrench else None |
There was a problem hiding this comment.
Wrench frame is inconsistent When wrench control uses a non-identity operational frame, the action passes the wrench command directly to the controller's
desired_wrench_world input. Unlike the pose target, it is not converted from the action's operational frame. A commanded force can therefore act along the wrong axis. Convert the wrench into the controller input frame, or make the action's wrench-frame contract explicit and consistent.
| self._asset.set_joint_position_target_index(target=joint_pos_des, joint_ids=self._joint_ids) | ||
|
|
||
|
|
||
| class NewtonOperationalSpaceControllerAction(_NewtonTaskSpaceAction): |
There was a problem hiding this comment.
Action integration lacks tests The added tests check the controllers directly, but not these new actions driving an articulation. Add action-level coverage for body offsets, non-identity operational frames, wrench feedback, and initialization; otherwise regressions in the frame and sensor integration can go unnoticed.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Isaac Lab Review Bot
The backport adds Newton differential IK, joint impedance, and operational-space controllers with manager action integrations, but it introduces an inconsistent body-offset Jacobian, removes the documented isaaclab_newton.ik API without deprecation, risks overwriting the hand-written controllers API page during autosummary generation, and exposes an ineffective absolute-pose orientation scale.
- Design and architecture: The Newton controller package and shared task-space action base are coherent overall, but
_NewtonTaskSpaceActiondoes not express the body offset consistently: pose and velocity paths rotate the offset into the root frame, while the Jacobian shift uses the body-frame vector directly. This produces incorrect offset-point kinematics when the body and root orientations differ. - API: The documented public
isaaclab_newton.ikpackage is removed without the deprecation and compatibility period required by repository policy. A temporary re-exporting shim is needed. In addition,orientation_scaleis documented as scaling orientation targets but is cancelled by quaternion normalization for the default absolute-pose mode; its supported scope should be corrected or explicitly documented. - Implementation: The Lab controller fixes and batched OSC frame rotations are internally consistent, but documentation integration and offset kinematics need correction. Listing the hand-written controllers page under autosummary can cause Sphinx to regenerate that path and discard its custom IK section; it should be integrated through the hidden toctree like the other hand-authored Newton API pages.
Significant concerns. Posted 4 actionable findings inline.
Automated review; human maintainers own approval decisions.
|
|
||
| assets | ||
| cloner | ||
| controllers |
There was a problem hiding this comment.
🟡 Warning · Implementation — Hand-written page listed under autosummary
controllers is added to the autosummary block with :toctree: lab_newton, so Sphinx generates lab_newton/isaaclab_newton.controllers.rst and (with autosummary_generate_overwrite defaulting to true) replaces the hand-written page added here, losing its ik section that replaced the deleted isaaclab_newton.ik page. Other hand-written lab_newton pages (isaaclab_newton.envs.mdp, formerly isaaclab_newton.ik) are listed in the hidden toctree instead; do the same.
| Removed | ||
| ^^^^^^^ | ||
|
|
||
| * **Breaking:** Moved :mod:`isaaclab_newton.ik` to :mod:`isaaclab_newton.controllers.ik` without an alias. Replace |
There was a problem hiding this comment.
🟡 Warning · Api — Public ik module removed without deprecation
isaaclab_newton.ik was documented as public (the deleted isaaclab_newton.ik.rst said so) and this fragment states it was moved "without an alias", so external from isaaclab_newton.ik import NewtonIKSolver breaks immediately on a release branch. Repository rules require a prior deprecation plus migration path. Keep a thin isaaclab_newton/ik package re-exporting controllers.ik with a deprecation warning for one release.
| self._jacobian_b[:, 3:] = torch.bmm(root_rot, jacobian_w[:, 3:]) | ||
| if self._offset_pos is not None: | ||
| # v_ee = v_link + w_link x r_link_ee, then rotate into the target frame | ||
| self._jacobian_b[:, :3] += torch.bmm( |
There was a problem hiding this comment.
🟡 Warning · Implementation — Offset Jacobian uses body-frame offset
_jacobian_b is already rotated into the root frame, but the offset shift applies self._offset_pos in the body frame. _compute_ee_velocity (line 356) rotates the same offset via quat_apply(body_quat_b, self._offset_pos) before its cross product, and _compute_ee_pose applies it through the body rotation, so the Jacobian disagrees with both whenever the body orientation differs from the root. Rotate the offset into root coordinates here.
| self._processed_actions = torch.zeros_like(self._raw_actions) | ||
| self._scale = torch.ones(self.num_envs, dim, device=self.device) | ||
| self._scale[:, :3] = self.cfg.position_scale | ||
| self._scale[:, 3:pose_dim] = self.cfg.orientation_scale |
There was a problem hiding this comment.
🔵 Suggestion · Api — orientation_scale inert for pose_abs targets
With the default target_type="pose_abs", pose_dim is 7, so this scales all four quaternion components uniformly; process_actions then calls math_utils.normalize(command[:, 3:]), cancelling any scale. The cfg documents orientation_scale as scaling orientation targets, yet it is silently a no-op in the default mode. Either apply it only for pose_rel or document the restriction on the field.
Description
Backports #7854 to
release/3.0.0from merged commit481a676a993b4054f46556ebd2c14a155b87602f. The cherry-pick applied cleanly; every changed or deleted file matches the merged source commit exactly.Adds Newton differential IK, joint impedance, and operational-space controllers and their task-space actions. Moves the Newton IK package to
isaaclab_newton.controllers.ikand updates its callers and API documentation. Includes the original Lab controller fixes, consolidated tests, and changelog fragments. Newton remains pinned to 1.6.0.Validation
isaaclab -f: all formatting, lint, changelog, and other pre-commit checks passed.isaaclab_newton.ikimports.