-
Notifications
You must be signed in to change notification settings - Fork 3k
Initial Support for Multiple Simulation Backends #4472
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
base: develop
Are you sure you want to change the base?
Initial Support for Multiple Simulation Backends #4472
Conversation
Greptile OverviewGreptile SummaryThis PR introduces a multi-backend architecture to Isaac Lab 3.0, separating simulation backend-specific code (PhysX) from the core API. This is a foundational refactoring that enables future support for different physics backends. Key Changes
Architecture QualityThe refactoring follows solid software engineering principles with clear separation of concerns. The factory pattern implementation is clean, though the backend selection is currently hardcoded to Backward CompatibilityGood backward compatibility support through:
Testing & Documentation
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Articulation as Articulation(Factory)
participant FactoryBase
participant Module as isaaclab_physx.assets.articulation
participant PhysXArticulation as PhysXArticulation
participant BaseArticulation
User->>Articulation: Articulation(cfg)
Articulation->>FactoryBase: __new__(cls, cfg)
FactoryBase->>FactoryBase: backend = "physx" (hardcoded)
alt Backend not in registry
FactoryBase->>Module: importlib.import_module("isaaclab_physx.assets.articulation")
Module->>FactoryBase: Return module
FactoryBase->>Module: getattr(module, "Articulation")
Module->>FactoryBase: Return PhysXArticulation class
FactoryBase->>FactoryBase: register("physx", PhysXArticulation)
end
FactoryBase->>PhysXArticulation: __init__(cfg)
PhysXArticulation->>BaseArticulation: super().__init__(cfg)
BaseArticulation-->>PhysXArticulation: Initialized
PhysXArticulation-->>User: PhysXArticulation instance
Note over User,PhysXArticulation: User code sees Articulation but gets PhysXArticulation
Note over FactoryBase: Backend selection currently hardcoded to "physx"
|
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.
6 files reviewed, 1 comment
| # TODO: Make the backend configurable. | ||
| backend = "physx" |
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.
Backend selection is hardcoded to "physx". Consider adding a configuration mechanism (e.g., environment variable, config file, or function parameter) to make the backend selectable before the 3.0 release.
| # TODO: Make the backend configurable. | |
| backend = "physx" | |
| # TODO: Make the backend configurable via environment variable or config | |
| backend = os.environ.get("ISAACLAB_BACKEND", "physx") |
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!
Description
This PR introduces a multi-backend architecture for Isaac Lab asset classes, separating simulation backend-specific code from the core API. This enables future support for different physics backends while maintaining a consistent user-facing API.
Key Changes:
New isaaclab_physx Extension
A new extension containing PhysX-specific implementations of asset classes:
Abstract Base Classes in isaaclab
Deprecations
Migration Guide
Added comprehensive migration guide at docs/source/migration/migrating_to_isaaclab_3-0.rst with:
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there