Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions source/isaaclab/test/app/test_non_headless_launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

"""
This script checks if the app can be launched with non-headless app and start the simulation.
"""

"""Launch Isaac Sim Simulator first."""


import pytest

from isaaclab.app import AppLauncher

# launch omniverse app
app_launcher = AppLauncher(experience="isaaclab.python.kit", headless=True)
simulation_app = app_launcher.app

"""Rest everything follows."""

import isaaclab.sim as sim_utils
from isaaclab.assets import AssetBaseCfg
from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
from isaaclab.utils import configclass


@configclass
class SensorsSceneCfg(InteractiveSceneCfg):
"""Design the scene with sensors on the robot."""

# ground plane
ground = AssetBaseCfg(prim_path="/World/defaultGroundPlane", spawn=sim_utils.GroundPlaneCfg())


def run_simulator(
sim: sim_utils.SimulationContext,
):
"""Run the simulator."""

count = 0

# Simulate physics
while simulation_app.is_running() and count < 100:
# perform step
sim.step()
count += 1


@pytest.mark.isaacsim_ci
def test_non_headless_launch():
# Initialize the simulation context
sim_cfg = sim_utils.SimulationCfg(dt=0.005)
sim = sim_utils.SimulationContext(sim_cfg)
# design scene
scene_cfg = SensorsSceneCfg(num_envs=1, env_spacing=2.0)
scene = InteractiveScene(scene_cfg)
print(scene)
# Play the simulator
sim.reset()
# Now we are ready!
print("[INFO]: Setup complete...")
# Run the simulator
run_simulator(sim)
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@

import time

import pytest

from isaaclab.app import AppLauncher


@pytest.mark.isaacsim_ci
def test_kit_start_up_time():
"""Test kit start-up time."""
start_time = time.time()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
({"name": "Anymal_D", "robot_cfg": ANYMAL_D_CFG, "expected_load_time": 40.0}, "cpu"),
],
)
@pytest.mark.isaacsim_ci
def test_robot_load_performance(test_config, device):
"""Test robot load time."""
with build_simulation_context(device=device) as sim:
Expand Down