Repository navigation
Fix OvPhysX scene gravity randomization - #7213
Conversation
There was a problem hiding this comment.
Isaac Lab Review Bot
The PR correctly adds live OvPhysX gravity updates through sealed OvStage control ordinals, routes scene gravity randomization through the new manager setter, and re-enables Kuka-Allegro gravity events. One API consistency issue remains: the manager’s gravity getter continues to report the configured baseline after the solver gravity changes.
- Design and architecture: The OvPhysX branch fits the existing backend dispatch, and control ordinals are reset with the OvStage lifecycle. However, the runtime gravity state now has separate write and read paths that are not synchronized.
- API: The new
set_gravity()classmethod has clear units, validation, and failure contracts. It must also keepget_gravity()consistent: that backend-agnostic accessor currently returnscls._sim.cfg.gravity, which becomes stale after a live update. Cache the applied value separately so the configuration remains the randomization baseline. - Implementation: OvStage path dictionaries, path lists, and queries are released deterministically on success and failure. The remaining implementation fix is to track the applied gravity, reset that state with the stage lifecycle, and return it from
get_gravity().
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| return cls._sim.cfg.gravity | ||
|
|
||
| @classmethod | ||
| def set_gravity(cls, gravity: tuple[float, float, float]) -> None: |
There was a problem hiding this comment.
🟡 Warning · Api — set_gravity leaves get_gravity returning stale value
get_gravity() returns cls._sim.cfg.gravity and is documented as mirroring PhysX's SimulationView.get_gravity() so backend-agnostic sensor code can read gravity through one classmethod. set_gravity() changes the running solver without recording the applied vector, so after the now-enabled variable_gravity event OvPhysX consumers read nominal gravity while physics uses the randomized value. Cache the applied vector (reset with the stage lifecycle) and return it from get_gravity(); do not overwrite cfg.gravity, which the event uses as its sampling baseline.
Greptile SummaryRoutes scene-wide gravity randomization through the OvPhysX manager and re-enables the associated Kuka-Allegro event and curriculum.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking defects identified. The new dispatch follows the documented scene-wide backend semantics, the first live ordinal follows the sealed initialization ordinal, native resources are cleaned up on failure, and focused tests cover dispatch, lifecycle, task configuration, and real-backend behavior. Important Files Changed
Sequence DiagramsequenceDiagram
participant Event as Gravity randomization event
participant Manager as OvPhysxManager
participant Stage as OvStage
participant PhysX as OvPhysX runtime
Event->>Manager: set_gravity(vector)
Manager->>Stage: write gravityDirection(ordinal)
Manager->>Stage: write gravityMagnitude(ordinal)
Manager->>Stage: advance_write_floor(ordinal)
Manager->>PhysX: update_from_ovstage(ordinal, ordinal)
Manager-->>Event: gravity update applied
Reviews (1): Last reviewed commit: "Complete OvPhysX gravity randomization s..." | Re-trigger Greptile |
marcodiiga
left a comment
There was a problem hiding this comment.
Re-reviewed at 0659722. No blocking issues found. The consolidated real-backend regression now exercises the full event dispatch, and focused CPU/CUDA validation confirms that the sealed OvStage update changes the running solver. The Kuka-Allegro reset path also runs with variable gravity and its curriculum enabled.
Two non-blocking follow-ups remain: the existing get_gravity() consistency thread, and the scene-wide PhysX/OvPhysX paths forcing non-uniform configurations through the uniform sampler. Approving.
| None, | ||
| slice(None), | ||
| operation=operation, | ||
| distribution="uniform", |
There was a problem hiding this comment.
The configured distribution is ignored here. Initialization accepts gaussian and log_uniform, but this new OvPhysX path always passes distribution="uniform", so those modes silently sample from the wrong distribution. Please preserve the configured distribution for this branch; the corresponding PhysX branch currently has the same issue. This is non-blocking for the Kuka configuration, which uses constant bounds.
## Summary Cherry-picks the following merged PRs from `develop` onto `release/3.0.0`, preserving each as an individual commit with `-x` provenance: - #7193 — Bake CI pytest deps into the built Docker image - #7077 — Add OVPhysX support to Franka deformable lift tasks - #7175 — Raise on unsupported camera renderer outputs - #7174 — Fix benchmark play inference scope - #7173 — Report resolved backend for play benchmarks - #7172 — Add video recording to play benchmarks - #7215 — Reduce GearAssembly default environment count - #7214 — Remove Kamino preset from open drawer - #7213 — Fix OvPhysX scene gravity randomization - #7212 — Fix OVPhysX material binding device selection - #7189 — Make preview surfaces renderer agnostic - #7206 — Fix OVPhysX benchmark articulation setup All cherry-picks and the final rebase onto the latest `release/3.0.0` tip completed without conflicts. ## Validation - Verified all 12 backported commits have patch IDs identical to their source squash commits and retain their `cherry picked from` footers. - `git diff --check upstream/release/3.0.0..HEAD` - Bash syntax validation for the modified CI shell scripts. - YAML parsing for the modified composite actions. - Changelog validation against `release/3.0.0`. - Targeted pytest coverage for benchmark APIs/play, video recording, GearAssembly defaults, OVPhysX presets and runtime semantics, and renderer-agnostic materials: **81 passed, 4 skipped, 1 deselected**. - The deselected case is an unchanged test that hard-codes a POSIX `/tmp` path and fails on Windows path normalization. - `uv run isaaclab -f` passed all hooks except the changelog hook's known release-branch baseline finding for `source/isaaclab/changelog.d/core-test-config-fixtures.skip`; the targeted release-base changelog check passed. --------- Co-authored-by: Matthew Taylor <[email protected]> Co-authored-by: Antoine RICHARD <[email protected]> Co-authored-by: Mike Yan Michelis <[email protected]> Co-authored-by: Maximilian Krause <[email protected]> Co-authored-by: Octi Zhang <[email protected]> Co-authored-by: Mustafa H <[email protected]>
Description
Routes scene-wide gravity randomization for the kitless OvPhysX backend through sealed OvStage control ordinals. The change adds a live
OvPhysxManager.set_gravity()path, dispatches the shared gravity event to it, and re-enables the intended variable-gravity event and ADR curriculum for Kuka-Allegro tasks.Native OvStage path/query resources are released deterministically on success and failure. No new dependencies are required.
Validation:
Isaac-Lift-KukaAllegrowithphysics=ovphysx,presets=cube, two CUDA environments completed initialization, first reset, and five steps withvariable_gravityandgravity_adractive.uv run isaaclab -fpassed.update_from_ovstagemean 1.56 ms / p95 1.75 ms; completeset_gravitymean 1.78 ms / p95 1.99 ms.Type of change
Screenshots
Not applicable.
Checklist
uv run isaaclab -fCONTRIBUTORS.md