Repository navigation
Conversation
…controllers-unified-codex
…controllers-unified-codex
…controllers-unified-codex # Conflicts: # pyproject.toml
|
| motion_selection_axes=( | ||
| wp.spatial_vector(*self.cfg.motion_control_axes_task) if self._wrench_control else None | ||
| ), | ||
| wrench_selection_axes=( | ||
| wp.spatial_vector(*self.cfg.contact_wrench_control_axes_task) if self._wrench_control else None | ||
| ), |
There was a problem hiding this comment.
The new pre-inertia motion-axis selection is not compatible with the retained OSC configurations. test_franka_hybrid_variable_kp_impedance, test_franka_taskframe_hybrid, and test_franka_taskframe_hybrid_with_nullspace_centering pass with the original controller but fail with this adapter. These hybrid and task-frame paths therefore produce incorrect tracking or force-control behavior until the Newton mapping or affected configurations are corrected.
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.
The force-tracking limitation remains; it has not been fixed by the adapter cleanup. Lab is now the default and Newton is explicitly selected with cfg.use_newton=True. The three Newton hybrid cases still execute as strict xfails, with unchanged convergence thresholds and active Lab counterparts. The task-frame convergence metric was also corrected. This keeps the unsupported Newton behavior visible while preserving the default Lab path; the PR description documents the limitation.
…controllers-unified-codex
|
run-ci |
Write controller targets in place on both paths so the Newton branch no longer needs special handling in set_command. Drop tests that checked private buffers or the convergence test helper, fold the late-limit check into the existing feature test, and condense the docs and changelog.
Replace the use_newton flag with implementation: Literal["native", "newton"] on the differential IK, joint impedance, and operational-space controller configurations, and shorten the config docstrings to one line. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The differential IK and operational-space controllers take an optional num_joints argument, required for the Newton implementation, so the Newton solver is built once in __init__ instead of lazily on the first compute call. compute() now only dispatches to _compute_lab() or _compute_newton(), and joint-limit avoidance no longer requires limits before the first compute call. The Newton path binds the caller's tensors to Newton's input ports with wp.from_torch on each call instead of copying them into port buffers. Only data Isaac Lab must transform, such as packed poses and gain diagonals, is staged. The action terms, SO-101 controller, and keyboard reset IK pass num_joints, and the tests, docs, and changelog are updated.
When no task frame was given, set_command built an identity pose from a num_envs-row Python list and uploaded it on every call, so its cost grew with the number of environments. It now reuses a preallocated identity root-frame pose, which also replaces the per-call fallback quaternion upload. The gains and selection matrices are block diagonal, so rotating each 3x3 block into the root frame is one 6x6 rotation. They are now rotated together in one batched product instead of 16 separate block products. set_command drops from 1.0/2.5/8.5 ms to about 0.4 ms at 1k/4k/16k environments, for both implementations.
Merge the feature and Newton integration tests into test_differential_ik.py. Numerical tests now run both implementations on the same inputs and check isaaclab == newton == reference; the sim convergence tests compare both controllers every step. Drop tests of private helpers already covered by the reference comparison, store joint limits as float32 so the Isaac Lab implementation accepts float64 limits like Newton, and re-enable the file in CI. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge the OSC feature and Newton integration tests into test_operational_space.py and rename the joint impedance Newton test to test_joint_impedance.py. Tests now run both implementations and check them against each other and a reference. OSC sim tests compare both controllers every step where the laws agree. The per-step comparison showed that Newton OSC ignores inertia_conditioning_thresholds and diverges near singularities under full inertial decoupling. Keep those sim tests per implementation, mark the conditioning unit tests as strict xfail for Newton, and document the difference in the config docstring and changelog. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
run-ci |
# Description `DifferentialInverseKinematicsAction._compute_frame_jacobian` and `OperationalSpaceControllerAction._compute_ee_jacobian` shift the body-origin Jacobian to the `body_offset` frame. `jacobian_b` is the body-origin geometric Jacobian expressed in the **root** frame. The previous correction had two problems: 1. **Translational rows.** The correction used `-[r]× J_w` with `r = body_offset.pos` in the **body** frame. The offset point moves with `v + w × (R_body_b r)`, so the lever arm has to be rotated into the root frame first. The two only coincide when the body's orientation in the root frame is identity. For the Franka IK tasks (`pos=(0, 0, 0.107)`, hand pointing down), the lever arm's sign is effectively flipped. 2. **Angular rows.** They were multiplied by `R(body_offset.rot)`. The offset frame is rigidly attached to the body, so its angular velocity in the root frame equals the body's, and the angular rows must stay unchanged. The same terms already compute the offset frame's **pose** correctly (`combine_frame_transforms(link_pose_b, offset)`). The OSC term also computes its **velocity** correctly (`v + w × quat_apply(link_quat_b, offset_pos)`, with a comment that angular velocity is unaffected). So the Jacobian was inconsistent with both. Both action terms apply the correction inline. They compute the body orientation in the root frame directly from the asset data, so the result does not depend on whether `_compute_ee_pose` ran earlier in the step: the OSC `apply_actions` computes the Jacobian before the pose. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Tests - Extended `source/isaaclab/test/envs/test_diffik_jacobian_aliasing.py` with the body-offset regression (kit-free `unit`, parametrized over DiffIK and OSC), reusing its existing stub. - Setup: one revolute joint about z, with the body rotated 90° about z. - With offset `(1, 0, 0)`, the expected linear column is `z × (0, 1, 0) = (-1, 0, 0)`. With a 90° offset rotation about x, the angular column must stay `(0, 0, 1)`. - **Updated** `test_diffik_jacobian_aliasing.py::test_compute_frame_jacobian_applies_offset_once`. - Its out-of-place reference encoded the previous formula. It now uses non-trivial root and body orientations and the rigid-offset formula. - The idempotence and owned-buffer tests are unchanged and still pass. ``` pytest -q source/isaaclab/test/envs/test_diffik_jacobian_aliasing.py # without the fix: 3 failed, 2 passed # with the fix: 5 passed ``` **Finite-difference check** (script not included in the PR): - Setup: random 7-joint serial chain in float64, offset `(0, 0, 0.107)`, 0.7 rad offset rotation. - Comparison: the Jacobian of the offset frame against finite differences of its pose. | | max linear error | max angular error | |---|---|---| | previous formula | 7.9e-2 | 6.1e-1 | | this PR | 4.7e-7 | 2.4e-7 | ## Notes for reviewers - **Changed behavior for existing tasks.** Tasks that set `body_offset` (e.g. the Franka lift/stack/cabinet IK tasks) will now use the correct Jacobian. DiffIK is closed-loop, so the previous error mostly degraded convergence rather than causing outright failures. For OSC with inertial decoupling, the mismatch between `J` and the (correct) EE velocity is removed. - **Scope.** I kept the change local to the two action terms. It should not overlap with the controller consolidation in #7854, which does not touch these methods. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the `pre-commit` checks with `./isaaclab.sh --format` - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/isaaclab/changelog.d/` - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Lynn <[email protected]> Co-authored-by: Octi Zhang <[email protected]>
Replace the implementation switch on the Isaac Lab controller configs with separate Newton controllers. NewtonDifferentialIKController, NewtonJointImpedanceController, and NewtonOperationalSpaceController wrap the model-free controllers in newton.controllers and expose their full configuration. NewtonDifferentialInverseKinematicsActionCfg and NewtonOperationalSpaceControllerActionCfg drive them from manager-based environments. Move isaaclab_newton.ik to isaaclab_newton.controllers.ik. Restore the Isaac Lab controllers and action terms to their previous interface, keeping the controller fixes and the set_command speedup, and make the controller tests Isaac Lab only.
|
run-ci |
… OSC (#7854) (#8013) ## Description Backports #7854 to `release/3.0.0` from merged commit `481a676a993b4054f46556ebd2c14a155b87602f`. 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.ik` and 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 - **170 focused tests passed** against Newton 1.6.0: Newton controller wrappers and IK solver, Lab joint impedance, differential IK and OSC numerical regressions (including available CUDA cases), SO101 IK, and Reach presets. - `isaaclab -f`: all formatting, lint, changelog, and other pre-commit checks passed. - Audited the moved/deleted paths and checked for stale `isaaclab_newton.ik` imports. - Full robot simulation tests and a documentation build were not run locally for this backport. Existing TorchScript deprecation warnings remain. The initial combined test harness crashed after importing Newton before Kit; isolated core runs with Kit loaded first passed. Signed-off-by: Octi Zhang <[email protected]> Co-authored-by: hujc <[email protected]> Co-authored-by: Mustafa H <[email protected]> Co-authored-by: Mustafa Haiderbhai <[email protected]>
Description
Added Newton 1.6 model-free differential IK, joint impedance, and OSC through
cfg.use_newton=True; the original Lab controllers remain the default. Consolidates #6693, #7482, and the differential-IK portion of #6654. Ackermann remains in its separate draft.Both paths share constructor, command, and compute signatures and return independent results. Controller selection is independent of the physics backend. Newton initializes from compute inputs, or from supplied DiffIK limits when avoidance is enabled. Existing callers and tutorials retain their setup; SO101 retains its wrist-orientation mask through a Newton-only Jacobian adaptation.
Newton uses float32 computation. Its OSC selects motion before inertia decoupling, requires at least six joints for decoupling, and retains motion-force coupling that fails three hybrid force-tracking cases. Those Newton cases run as strict expected failures; Lab cases remain active, and thresholds are unchanged. Convergence checks now apply masks in the actual control frame.
Newton DiffIK requires joint limits before the first compute when avoidance is enabled; later limit updates retain its buffers. Its
pinvalso rejects fewer controlled joints than active task axes. These differences prevent blanket replacement of the Lab path. Joint impedance retains the same control law, subject to Newton's precision boundary. Includes the position-only SVD and joint-impedance gain-clamping/batched-inertia fixes.Type of change
Release backport
Validation
Checklist
uv run isaaclab -f