Repository navigation
[Core] Refactor and cleanup core subpackage for 3.0 [5C/N] - #7991
Conversation
|
| ) -> Sequence[int] | torch.Tensor | wp.array | slice: | ||
| """Resolve the bodies of a mask writer, accepting the deprecated ``body_ids`` in place of ``body_mask``.""" | ||
| if body_ids is None: | ||
| return self._resolve_body_mask(body_mask) | ||
| if body_mask is not None: | ||
| raise ValueError("Pass either 'body_mask' or the deprecated 'body_ids', not both.") | ||
| warnings.warn( | ||
| "The 'body_ids' argument of the rigid object collection mask writers is deprecated. Please use" | ||
| " 'body_mask' instead.", | ||
| DeprecationWarning, | ||
| stacklevel=3, | ||
| ) |
There was a problem hiding this comment.
Compatibility branches lack coverage
This helper adds two public behaviors: it emits a deprecation warning when only body_ids is supplied, and raises ValueError when both body_ids and body_mask are supplied. The updated interface tests exercise only the body_mask path, so regressions in the warning category, deprecated forwarding, or conflict handling could go unnoticed. Please add tests for both compatibility branches.
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 PR consistently repairs two backend-specific API mismatches: Newton now inherits the functional base implementation for deprecated joint-friction writers, and four PhysX rigid-object collection mask writers accept the shared body_mask contract while retaining body_ids through a documented deprecation path. Targeted regression coverage and package changelog fragments accompany both fixes.
- Design and architecture: Removing the broken Newton override restores the shared base-class forwarding path. PhysX keeps mask conversion localized at the backend boundary through
_resolve_mask_writer_body_ids, consistent with its existing environment/body mask helpers and index-based implementation. - API: The four PhysX writers remain keyword-only, accept the base API's
body_mask, preserve existingbody_idscallers with aDeprecationWarning, and reject ambiguous use of both arguments. The Newton deprecated methods retain their public surface through inheritance. Changelog entries document both user-visible corrections and migration guidance. - Implementation: The PhysX helper resolves masks before forwarding to the existing index writers with
full_data=True, preserving the established data-shape and simulation-write paths. Tests now exercisebody_maskacross all relevant backends and both deprecated Newton friction writers. The existing narrowwp.array | Nonemask annotation remains a minor typing limitation because the implementation also handles torch masks, but this is consistent with surrounding APIs and does not block the fix.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
|
run-ci |
(cherry picked from commit 2b62263)
…#7941, #7977, #7983, #7991, #8003) (#8002) ## Description Backports the rendering changes and related release fixes: - #7941 — routes rigid rendering transforms through `SceneDataProvider` and preserves shared Fabric bindings. - #7977 — batches due camera captures by renderer and fixes moving and cloned camera updates. This supersedes #8001. - #7983 — removes `CameraRenderSpec.camera_path_relative_to_env_0` and derives and validates the OVRTX source camera path from `camera_prim_paths`. The rendering changes were developed with this interface, so it is required by their OVRTX tests. - #7991 — fixes Newton's deprecated joint friction writers and the PhysX rigid object collection `body_mask` writer signatures. - #8003 — consolidates redundant Newton tests to shorten the Newton CI job without changing runtime code. #7941 required conflict resolution in the OVRTX legacy and OvStage transform binding functions: the release branch's Newton model path collection was replaced by SDP-published paths. #7983 was then integrated with those SDP paths. Each added commit records its source commit. Custom scene-data backends must follow the `transforms_version` publication contract described in the included migration documentation. Direct callers of `BaseRenderer.render()` must pass a sequence, for example `render([data])`. Callers constructing `CameraRenderSpec` must remove the `camera_path_relative_to_env_0` argument; OVRTX now derives it from `camera_prim_paths`. ## Validation - Rendering and scene-data focused tests from the original backport passed locally: 27 renderer tests and 50 scene-data / PhysX renderer tests. OVRTX runtime cases were skipped locally because the optional `ovrtx` module is unavailable. - #7991: the Newton deprecated friction writer test passed, and 72 rigid object collection mask writer cases passed. The new friction test fails without the fix and passes with it. - #8003: all 8 revised contact lifecycle cases passed. Kit-based Newton asset tests remain for CI. - `uv run isaaclab -f` passed after all additions with the changelog base set to `release/3.0.0`, as did `git diff --check`. - The original backport's documentation build passed with warnings treated as errors. Full GPU and Kit CI is running on the updated PR. ## Type of change - Rendering bug fixes and performance improvement - Backend API bug fixes and breaking renderer / scene-data interface changes with migration guidance - Newton test consolidation - Documentation and changelog fragments for affected source packages ## Release backport This PR targets `release/3.0.0`; no further backport is needed. ## Checklist - [x] Contribution guidance reviewed - [x] Focused local tests and formatting checks passed - [x] Public documentation and package changelog fragments included - [ ] Full GPU and Kit CI passed --------- Co-authored-by: ooctipus <[email protected]> Co-authored-by: Piotr Barejko <[email protected]>
# Description Part of the series that splits the core cleanup in #7949 into small, reviewable pieces. Following #7985, event terms and task code should not branch on the physics manager's class name; they should call the asset API and let each backend handle (or reject) what it supports. An audit found the remaining places that branched on the backend name, plus one Newton solver gap. This PR fixes them. It is independent of #7985 / #7990 / #7991. ## Changes - **`randomize_joint_parameters`** chose the friction write path with `"newton" in manager_name`, treating every other backend (including OVPhysX) as PhysX. It now randomizes dynamic friction whenever the asset data exposes `joint_dynamic_friction_coeff` (PhysX, OVPhysX; not Newton), and makes one `write_joint_friction_coefficient_to_sim_index` call on every backend. Newton's writer already applies the viscous part and ignores dynamic friction. Its invalid-operation error also named `'randomize_fixed_tendon_parameters'`; it now names the right term. - **`randomize_rigid_body_com`** sliced the pose to a position on Newton (`"newton" in manager_name`) because Newton's `set_coms_*` accepted positions only, unlike the base API, PhysX, and OVPhysX, which take poses. Newton's `set_coms_index` / `set_coms_mask` (articulation, rigid object, rigid object collection) now also accept poses (trailing dimension 7 or `wp.transformf`) and ignore the orientation, since Newton models the center of mass as a position. The event passes poses on every backend. - **`randomize_rigid_body_scale`** detected articulations with `cls.__name__ == "Articulation"` over the MRO; it now uses `isinstance(asset, BaseArticulation)`. - **NIST `reset_end_effector_around_asset`** (`isaaclab_tasks` contrib) no longer performs a backend-specific Jacobian refresh. Joint writes invalidate articulation data, and subsequent body-pose reads refresh forward kinematics on demand. This also removes the invalid `root_physx_view` access on OVPhysX. - **Newton Featherstone inertia changes.** `SolverFeatherstone` derives its inertia data (`body_I_m`, `body_X_com`) from the model only in its constructor, and its `notify_model_changed` ignores `ModelFlags.BODY_INERTIAL_PROPERTIES`. So `set_masses_*`, `set_coms_*`, `set_inertias_*`, and the mass/CoM/inertia randomization events silently had no effect on Featherstone. The real fix is upstream in Newton. Until then, a manager can declare model changes its solver does not apply (`NewtonManager._ignored_model_changes`). Featherstone declares `BODY_INERTIAL_PROPERTIES`, and the manager logs a warning the first time such a change is flushed. - **Pretrained checkpoints** (`isaaclab_rl`): OVPhysX configs resolve to the PhysX checkpoints through the `"physx"` substring match. This is intended, since they run the same PhysX engine, so it is only documented. Not changed: Newton ignores `joint_velocity_limit` on MJWarp (documented by Newton). A warning was considered, but actuator setup writes velocity limits for every articulation, so it would fire on every MJWarp run. ## Tests - `isaaclab_physx/test/assets/test_articulation.py`: the two CUDA cases of `test_write_joint_state_data_consistency` pass, verifying fresh body state after manual joint writes without a simulation step or explicit Jacobian read. - `test/envs/test_articulation_ordering_events.py`: the Newton joint-parameter randomization test no longer gives the term a physics manager. It fails on `develop`, where the term reads `env.sim`. The fake Newton articulation now forwards viscous friction the way Newton's writer does. - `isaaclab_newton/test/assets/test_articulation.py`: `test_randomize_rigid_body_com` also sets CoMs from full poses (fails on `develop` with a shape mismatch). - `isaaclab_newton/test/physics/test_newton_manager_abstraction.py`: `test_initialize_solver_populates_canonical_state` checks that only Featherstone registers `BODY_INERTIAL_PROPERTIES` as ignored (8 solver variants). - Also passing: the full Newton manager abstraction tests (199) and the Newton articulation / rigid object / collection CoM and friction tests. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [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/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump `extension.toml` — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Octi Zhang <[email protected]> Co-authored-by: Octi Zhang <[email protected]>
# Description Part of the series that splits the core cleanup in #7949 into small, reviewable pieces. Following #7985, event terms and task code should not branch on the physics manager's class name; they should call the asset API and let each backend handle (or reject) what it supports. An audit found the remaining places that branched on the backend name, plus one Newton solver gap. This PR fixes them. It is independent of #7985 / #7990 / #7991. ## Changes - **`randomize_joint_parameters`** chose the friction write path with `"newton" in manager_name`, treating every other backend (including OVPhysX) as PhysX. It now randomizes dynamic friction whenever the asset data exposes `joint_dynamic_friction_coeff` (PhysX, OVPhysX; not Newton), and makes one `write_joint_friction_coefficient_to_sim_index` call on every backend. Newton's writer already applies the viscous part and ignores dynamic friction. Its invalid-operation error also named `'randomize_fixed_tendon_parameters'`; it now names the right term. - **`randomize_rigid_body_com`** sliced the pose to a position on Newton (`"newton" in manager_name`) because Newton's `set_coms_*` accepted positions only, unlike the base API, PhysX, and OVPhysX, which take poses. Newton's `set_coms_index` / `set_coms_mask` (articulation, rigid object, rigid object collection) now also accept poses (trailing dimension 7 or `wp.transformf`) and ignore the orientation, since Newton models the center of mass as a position. The event passes poses on every backend. - **`randomize_rigid_body_scale`** detected articulations with `cls.__name__ == "Articulation"` over the MRO; it now uses `isinstance(asset, BaseArticulation)`. - **NIST `reset_end_effector_around_asset`** (`isaaclab_tasks` contrib) no longer performs a backend-specific Jacobian refresh. Joint writes invalidate articulation data, and subsequent body-pose reads refresh forward kinematics on demand. This also removes the invalid `root_physx_view` access on OVPhysX. - **Newton Featherstone inertia changes.** `SolverFeatherstone` derives its inertia data (`body_I_m`, `body_X_com`) from the model only in its constructor, and its `notify_model_changed` ignores `ModelFlags.BODY_INERTIAL_PROPERTIES`. So `set_masses_*`, `set_coms_*`, `set_inertias_*`, and the mass/CoM/inertia randomization events silently had no effect on Featherstone. The real fix is upstream in Newton. Until then, a manager can declare model changes its solver does not apply (`NewtonManager._ignored_model_changes`). Featherstone declares `BODY_INERTIAL_PROPERTIES`, and the manager logs a warning the first time such a change is flushed. - **Pretrained checkpoints** (`isaaclab_rl`): OVPhysX configs resolve to the PhysX checkpoints through the `"physx"` substring match. This is intended, since they run the same PhysX engine, so it is only documented. Not changed: Newton ignores `joint_velocity_limit` on MJWarp (documented by Newton). A warning was considered, but actuator setup writes velocity limits for every articulation, so it would fire on every MJWarp run. ## Tests - `isaaclab_physx/test/assets/test_articulation.py`: the two CUDA cases of `test_write_joint_state_data_consistency` pass, verifying fresh body state after manual joint writes without a simulation step or explicit Jacobian read. - `test/envs/test_articulation_ordering_events.py`: the Newton joint-parameter randomization test no longer gives the term a physics manager. It fails on `develop`, where the term reads `env.sim`. The fake Newton articulation now forwards viscous friction the way Newton's writer does. - `isaaclab_newton/test/assets/test_articulation.py`: `test_randomize_rigid_body_com` also sets CoMs from full poses (fails on `develop` with a shape mismatch). - `isaaclab_newton/test/physics/test_newton_manager_abstraction.py`: `test_initialize_solver_populates_canonical_state` checks that only Featherstone registers `BODY_INERTIAL_PROPERTIES` as ignored (8 solver variants). - Also passing: the full Newton manager abstraction tests (199) and the Newton articulation / rigid object / collection CoM and friction tests. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [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/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump `extension.toml` — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Octi Zhang <[email protected]> Co-authored-by: Octi Zhang <[email protected]> (cherry picked from commit 8835a34)
Description
Part of the series that splits the core cleanup in #7949 into small, reviewable pieces. An audit of the backend asset classes (after the tendon issues in #7985 / #7990) found two public API signatures that always fail on one backend. This PR fixes both. It is independent of #7985 / #7990.
Fixes
Articulation.write_joint_friction_coefficient_to_sim(deprecated) was overridden in Newton to passjoint_friction_coeffpositionally to the keyword-onlywrite_joint_friction_coefficient_to_sim_index, and to forwardfull_data, which that method does not accept. It always raisedTypeError, and so did the deprecatedwrite_joint_friction_to_sim, which the base class routes through it. The override is removed, so Newton uses the base class implementation that PhysX and OVPhysX match (keyword forwarding to the index writer).RigidObjectCollectionmask writers.write_body_link_pose_to_sim_mask,write_body_com_pose_to_sim_mask,write_body_com_velocity_to_sim_mask, andwrite_body_link_velocity_to_sim_masktookbody_idsinstead of thebody_maskthat the base class, OVPhysX, and Newton declare, sobody_mask=raisedTypeErroron PhysX. They now takebody_mask.body_idsstill works but emits aDeprecationWarning(passing both raisesValueError).Tests
test/assets/test_articulation_iface.py: newtest_deprecated_joint_friction_writerscalls both deprecated friction writers on every backend; it fails for Newton ondevelop.test/assets/test_rigid_object_collection_iface.py: the mask writer tests skippedbody_maskfor the link/com variants (with a note about this mismatch). The workaround and note are removed, sobody_maskis exercised for all six mask writers on every backend. PhysX is only available in these tests with Kit; I confirmed under Kit that all four PhysX writers rejectbody_mask=ondevelopand accept it here. The full file passes locally for Newton and OVPhysX (1276 passed).Type of change
Release backport
developChecklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there