Hello,
I have a Python application that needs to run in Docker’s headless mode. However, I’ve encountered an issue where the application can only be accessed via a Streaming Client rather than through WebRTC. Are there any configurations I need to adjust in order to enable WebRTC connections via a web browser?
Thank you
Below is an example that I’ve been using for testing purposes, which currently only connects through the Streaming Client.
my_application.py
from omni.isaac.kit import SimulationApp
simulation_app = SimulationApp({"headless": True}) # we can also run as headless.
from omni.isaac.core import World
from omni.isaac.core.objects import DynamicCuboid
import numpy as np
import time
world = World()
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]),
))
world.reset()
for i in range(5000):
time.sleep(0.1)
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))
world.step(render=True) # execute one physics step and one rendering step
simulation_app.close()
docker-compose.yml
version: "3.8"
services:
isaac-sim:
container_name: isaac-sim
image: nvcr.io/nvidia/isaac-sim:2023.1.1
environment:
- ACCEPT_EULA=Y
- PRIVACY_CONSENT=Y
- OMNI_KIT_ALLOW_ROOT=1
volumes:
- ./store/cache/kit:/isaac-sim/kit/cache:rw
- ./store/cache/ov:/root/.cache/ov:rw
- ./store/cache/pip:/root/.cache/pip:rw
- ./store/cache/glcache:/root/.cache/nvidia/GLCache:rw
- ./store/cache/computecache:/root/.nv/ComputeCache:rw
- ./store/logs:/root/.nvidia-omniverse/logs:rw
- ./store/data:/root/.local/share/ov/data:rw
- ./store/documents:/root/Documents:rw
- ./tm-apps/omni.isaac.sim.headless.webrtc.kit:/isaac-sim/apps/omni.isaac.sim.headless.webrtc.kit
- ./tm-exts:/isaac-sim/exts
- ./python-apps:/root/python-apps
entrypoint: ["bash", "./python.sh", "/root/python-apps/my_application.py"]
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
network_mode: host