Physics Context scene path is invalid

Hello,
I am trying to load a scene and add a few things to it from an extension in isaac sim.

    def setup_scene(self):
        open_stage(usd_path=<usd_path>)
        my_world = World(stage_units_in_meters=1.0)

This opens the scene which has its physics scene under /World/PhysicsScene. When trying to reset the world, it generates:
await self.world_object.reset_async()
File “/home/simulation/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/world/world.py”, line 520, in reset_async
await self.reset_async_no_set_up_scene(soft=soft)
File “/home/simulation/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/world/world.py”, line 480, in reset_async_no_set_up_scene
await SimulationContext.reset_async(self, soft=soft)
File “/home/simulation/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/simulation_context/simulation_context.py”, line 653, in reset_async
await self.play_async()
File “/home/simulation/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/simulation_context/simulation_context.py”, line 869, in play_async
self.get_physics_context().warm_start()
AttributeError: ‘NoneType’ object has no attribute ‘warm_start’

I tried to check the name of the physics scene in the world script, and it still is /physicsScene.
I also tried to change that to /World/PhysicsScene but I got more errors.
Any idea how to proceed here?

PS: I also used the async function to reset the world since I’m working in an extension

Hi @younesshadi101 - It looks like the error you’re encountering is related to the physics context not being properly initialized or referenced—hence the ‘NoneType’ object error when the code is trying to call the warm_start() method on it.

To proceed with resolving this issue, let’s go through a few steps to ensure everything is set up correctly:

  1. Ensure correct USD path: Verify that the USD path you are providing to open_stage is correct. If the path is incorrect, the stage might not open as expected, and the scene setup could fail.
  2. Proper Scene Initialization: When you’re loading a scene, make sure that the physics scene is initialized correctly in the USD stage. You might need to double-check if the physics scene is set up properly within the USD hierarchy. The path to the physics scene should accurately reflect its position in the hierarchy.
  3. Correct Physics Scene Path: If you have verified that the physics scene is named “/World/PhysicsScene” in your USD file, ensure that the path used in the script matches this exactly—including capitalization and any leading slashes.
  4. Proper Object References: Ensure that your references to self.world_object and other objects are correctly initialized. If the world object is not set up properly before you call reset_async, you might face this error.
  5. Python Environment: Double-check that your Python environment is properly configured with all the necessary Isaac Sim dependencies and that the Isaac Sim extensions are correctly enabled.

Also, refer to this doc as well: 1.2. Isaac Sim Workflows — Omniverse IsaacSim latest documentation

1 Like