Commit 9f65e3d
Fix backend factory fallback before simulator initialization (#7121)
# Description
`FactoryBase._get_backend()` can be called before a `SimulationContext`
has been created, but it previously dereferenced
`SimulationContext.instance().physics_manager` unconditionally.
`SimulationContext.instance()` returns `None` before initialization, so
backend resolution could fail before any fallback was applied.
Following maintainer confirmation, the pre-context fallback is now
`newton`. Initialized backend resolution remains unchanged for Newton,
PhysX, and OV PhysX contexts.
A separate follow-up should update `SimulationCfg(physics=None)` to
default to Newton as well; that broader configuration-default change is
intentionally outside this PR.
## Validation
Adds unit coverage for backend resolution with
`SimulationContext._instance` unset and verifies the `newton` fallback.
## Type of change
- Bug fix
---------
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Co-authored-by: ooctipus <zhengyuz@nvidia.com>1 parent 90600e1 commit 9f65e3d
4 files changed
Lines changed: 22 additions & 3 deletions
File tree
- source/isaaclab
- changelog.d
- isaaclab
- utils
- visualizers
- test/utils
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
| 159 | + | |
| 160 | + | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments