Cannot load Hello World

This is the error I get when trying to load Hello World
Using Isaac Sim 2022.2.1

2023-06-12 17:29:23 [42,131ms] [Error] [asyncio] Task exception was never retrieved
future: <Task finished coro=<BaseSampleExtension._on_load_world.<locals>._on_load_world_async() done, defined at c:\users\linca\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\base_sample\base_sample_extension.py:150> exception=AttributeError("'NoneType' object has no attribute 'GetPath'")>
Traceback (most recent call last):
  File "c:\users\linca\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\base_sample\base_sample_extension.py", line 151, in _on_load_world_async
    await self._sample.load_world_async()
  File "c:\users\linca\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\base_sample\base_sample.py", line 43, in load_world_async
    self.setup_scene()
  File "c:\users\linca\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.examples\omni\isaac\examples\hello_world\hello_world.py", line 22, in setup_scene
    world.scene.add_default_ground_plane()
  File "c:\users\linca\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.core\omni\isaac\core\scenes\scene.py", line 223, in add_default_ground_plane
    plane = GroundPlane(prim_path=prim_path, name=name, z_position=z_position, physics_material=physics_material)
  File "c:\users\linca\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.core\omni\isaac\core\objects\ground_plane.py", line 94, in __init__
    get_first_matching_child_prim(prim_path=prim_path, predicate=lambda x: get_prim_type_name(x) == "Plane")
  File "c:\users\linca\appdata\local\ov\pkg\isaac_sim-2022.2.1\exts\omni.isaac.core\omni\isaac\core\utils\prims.py", line 304, in get_prim_path
    return prim.GetPath().pathString
AttributeError: 'NoneType' object has no attribute 'GetPath'

Hi @candy.lin - It seems that code is trying to call the GetPath method on object that is None . This usually happens when property of an object is accessed before it has been properly initialized.

In your case, prim object is None when code is trying to call prim.Gethpath().pathString. This could be because the get_first_matching_child_prim function didn’t find a matching child prim and returned None .

Please check following things:

  1. Make sure that the prim_path argument you’re passing to the GroundPlane constructor is correct.
  2. The get_first_matching_child_prim function uses a predicate function to find the first child prim that matches certain criteria. In this case, it’s looking for a prim with a type name of “Plane”. Make sure that there is a prim in your scene that matches this criteria.
  3. Modify your code to handle the case where get_first_matching_child_prim returns None . You can do this by checking if prim is None before trying to call GetPath on it.