Commit ad7d644
committed
fix(get_started): example 0 handles missing camera frames gracefully
Newton's SensorTiledCamera init can fail silently in environments
without the required GL / Warp context (Newton already logs a
"Cameras disabled. Error: ..." warning at handler launch). The
example then crashed with an opaque ``StopIteration`` on:
next(iter(obs_tensor.cameras.values()))
because the cameras dict was empty.
Guard the save: when ``obs_tensor.cameras`` is empty, log a
human-readable warning pointing the user at the earlier backend-
side init failure and skip the imageio call. Same example body
across all other backends (mujoco / sapien3 / pybullet / isaacsim)
is unaffected.
Verified by running get_started/0_static_scene.py across mujoco,
sapien3, pybullet, newton (newton now exits cleanly with the new
'No camera frames available' warning instead of the StopIteration).1 parent 8322a18 commit ad7d644
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
177 | 186 | | |
0 commit comments