I am running Isaac Sim (version 4.2) on a server using the container installation, in headless webrtc mode. I can see and interact with the GUI in a browser as intended.
I am trying to run python code using an external editor (VSCode) and have the necessary extensions installed to run the code remotely. I started with the standalone hello_world script shown here. I can run it partially, i.e., the ground plane and cube get added to the scene correctly. However, when I try to run the simulation, I get an error saying:
[Error] [omni.physx.tensors.plugin] Failed to create simulation view: no active physics scene found
In the VSCode output I see:
File "/isaac-sim/exts/omni.isaac.core/omni/isaac/core/world/world.py", line 388, in reset
SimulationContext.reset(self, soft=soft)
File "/isaac-sim/exts/omni.isaac.core/omni/isaac/core/simulation_context/simulation_context.py", line 619, in reset
SimulationContext.initialize_physics(self)
File "/isaac-sim/exts/omni.isaac.core/omni/isaac/core/simulation_context/simulation_context.py", line 588, in initialize_physics
self._physics_sim_view = omni.physics.tensors.create_simulation_view(self.backend)
File "/isaac-sim/extsPhysics/omni.physics.tensors/omni/physics/tensors/impl/api.py", line 12, in create_simulation_view
raise Exception("Failed to create simulation view backend")
Exception: Failed to create simulation view backend
The code I’m trying to run is:
from omni.isaac.core import World
from omni.isaac.core.objects import DynamicCuboid
import numpy as np
world = World()
world.scene.clear()
world.scene.add_default_ground_plane()
fancy_cube = world.scene.add(
DynamicCuboid(
prim_path="/World/random_cube",
name="fancy_cube",
position=np.array([0, 0, 1.0]),
scale=np.array([0.5015, 0.5015, 0.5015]),
color=np.array([0, 0, 1.0]),
)
)
# Resetting the world needs to be called before querying anything related to an articulation specifically.
# Its recommended to always do a reset after adding your assets, for physics handles to be propagated properly
world.reset()
for i in range(500):
position, orientation = fancy_cube.get_world_pose()
linear_velocity = fancy_cube.get_linear_velocity()
# will be shown on terminal
print("Cube position is : " + str(position))
print("Cube's orientation is : " + str(orientation))
print("Cube's linear velocity is : " + str(linear_velocity))
# we have control over stepping physics and rendering in this workflow
# things run in sync
world.step(render=True) # execute one physics step and one rendering step
The error occurs on the world.reset()
line. I can see the cube and ground plane loaded correctly in the GUI in the browser. The simulation runs fine if I click on the Play button in the GUI.
Any help with this error and how to fix it would be appreciated. Additionally, is there any other recommended workflow for scripting+visualisation when running Isaac Sim on a remote server?