-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Make automatic PhysX defaults concrete and fix install hints #6849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
985c4f8
78706ab
ef48350
3c5745b
2fe507a
e997f0e
51324af
b71ff32
ace9a6b
41fc1a8
ccb31a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -652,28 +652,33 @@ when no CLI override is given. Other fields are named presets selectable with | |
|
|
||
| .. code-block:: python | ||
|
|
||
| from isaaclab_tasks.utils import PresetCfg | ||
| from isaaclab.physics import PhysxAutoCfg | ||
| from isaaclab.utils.configclass import configclass | ||
| from isaaclab_ovphysx.physics import OvPhysxCfg | ||
| from isaaclab_tasks.utils import PresetCfg | ||
|
|
||
| @configclass | ||
| class MyPhysicsCfg(PresetCfg): | ||
| default: PhysxCfg = PhysxCfg(...) # used when no override is given | ||
| physx: PhysxCfg = PhysxCfg(...) # selected by physics=physx | ||
| isaacsim_physx: PhysxCfg = PhysxCfg(...) | ||
| ovphysx: OvPhysxCfg = OvPhysxCfg() | ||
| physx: PhysxAutoCfg = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) | ||
| default: PhysxCfg = isaacsim_physx # used when no override is given | ||
| newton_mjwarp: NewtonCfg = NewtonCfg(...) # selected by physics=newton_mjwarp | ||
|
|
||
| Selecting a preset at launch | ||
| ----------------------------- | ||
|
|
||
| Pass ``physics=newton_mjwarp`` (or ``physics=physx``) on the CLI to swap the entire config section. | ||
| The legacy ``presets=NAME`` form still works for the same values. | ||
| Pass ``physics=newton_mjwarp`` on the CLI to swap the entire config section. | ||
| Use ``physics=physx`` to opt into automatic PhysX-family selection. The legacy | ||
| ``presets=NAME`` form still works for the same values. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| # Run with Newton backend | ||
| uv run --extra isaacsim isaaclab train --rl_library rsl_rl \ | ||
| --task Isaac-Open-Drawer-Franka-Direct physics=newton_mjwarp | ||
|
|
||
| # Run with default (PhysX) backend | ||
| # Run with default (concrete Isaac Sim PhysX) backend | ||
| uv run --extra isaacsim isaaclab train --rl_library rsl_rl \ | ||
| --task Isaac-Open-Drawer-Franka-Direct | ||
|
|
||
|
|
@@ -693,18 +698,30 @@ subclass that carries both a PhysX and a Newton variant. | |
| self.sim.dt = 1 / 60 | ||
| self.sim.physics = PhysxCfg(bounce_threshold_velocity=0.2) | ||
|
|
||
| .. important:: | ||
|
|
||
| The ``After`` example below mirrors the current Reach task, which intentionally | ||
| uses Newton/MJWarp as its default. The ``Before`` snippet only illustrates the | ||
| older single-backend form, so the default differs between the two snippets. | ||
| When migrating a task that should retain PhysX by default, use | ||
| ``default: PhysxCfg = isaacsim_physx`` instead. Adding backend variants should | ||
| not silently change a task's established default. | ||
|
|
||
| *After:* | ||
|
|
||
| .. code-block:: python | ||
|
|
||
| from isaaclab.physics import PhysxAutoCfg | ||
| from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg | ||
| from isaaclab_ovphysx.physics import OvPhysxCfg | ||
| from isaaclab_physx.physics import PhysxCfg | ||
| from isaaclab_tasks.utils import PresetCfg | ||
|
|
||
| @configclass | ||
| class ReachPhysicsCfg(PresetCfg): | ||
| default: PhysxCfg = PhysxCfg(bounce_threshold_velocity=0.2) | ||
| physx: PhysxCfg = PhysxCfg(bounce_threshold_velocity=0.2) | ||
| isaacsim_physx: PhysxCfg = PhysxCfg(bounce_threshold_velocity=0.2) | ||
| ovphysx: OvPhysxCfg = OvPhysxCfg() | ||
| physx: PhysxAutoCfg = PhysxAutoCfg(isaacsim_physx=isaacsim_physx, ovphysx=ovphysx) | ||
| newton_mjwarp: NewtonCfg = NewtonCfg( | ||
| solver_cfg=MJWarpSolverCfg( | ||
| njmax=20, nconmax=20, ls_iterations=20, | ||
|
|
@@ -714,6 +731,7 @@ subclass that carries both a PhysX and a Newton variant. | |
| num_substeps=1, | ||
| debug_mode=False, | ||
| ) | ||
| default: NewtonCfg = newton_mjwarp | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 Suggestion · Design Architecture — Migration recipe flips default to Newton This "Adding Multi-Backend Support" recipe has a Before of |
||
|
|
||
| # In the env cfg __post_init__: | ||
| def __post_init__(self): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, it should not list some chronology wrt the PhysxAutoCfg