Skip to content
Open
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
1 change: 1 addition & 0 deletions source/isaaclab/isaaclab/sim/_impl/newton_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def start_simulation(cls) -> None:
NewtonManager._builder.up_axis = Axis.from_string(NewtonManager._up_axis)
with Timer(name="newton_finalize_builder", msg="Finalize builder took:", enable=True, format="ms"):
NewtonManager._model = NewtonManager._builder.finalize(device=NewtonManager._device)
NewtonManager._model.num_envs = NewtonManager._num_envs
NewtonManager._state_0 = NewtonManager._model.state()
NewtonManager._state_1 = NewtonManager._model.state()
NewtonManager._state_temp = NewtonManager._model.state()
Expand Down
76 changes: 76 additions & 0 deletions source/isaaclab/isaaclab/sim/utils/nucleus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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

import logging

import carb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one could be an issue too.

import omni.client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these omni.client imports could also be a problem

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need to implement our own verison, with hardcoded url....

from omni.client import Result

logger = logging.getLogger(__name__)

DEFAULT_ASSET_ROOT_PATH_SETTING = "/persistent/isaac/asset_root/default"
DEFAULT_ASSET_ROOT_TIMEOUT_SETTING = "/persistent/isaac/asset_root/timeout"


def check_server(server: str, path: str, timeout: float = 10.0) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: timeout parameter is defined but never used in the function

Suggested change
def check_server(server: str, path: str, timeout: float = 10.0) -> bool:
def check_server(server: str, path: str) -> bool:

"""Check a specific server for a path
Args:
server (str): Name of Nucleus server
path (str): Path to search
timeout (float): Default value: 10 seconds
Returns:
bool: True if folder is found
"""
logger.info(f"Checking path: {server}{path}")
# Increase hang detection timeout
omni.client.set_hang_detection_time_ms(20000)
result, _ = omni.client.stat(f"{server}{path}")
if result == Result.OK:
logger.info(f"Success: {server}{path}")
return True
else:
logger.info(f"Failure: {server}{path} not accessible")
return False


def get_assets_root_path(*, skip_check: bool = False) -> str:
"""Tries to find the root path to the Isaac Sim assets on a Nucleus server
Args:
skip_check (bool): If True, skip the checking step to verify that the resolved path exists.
Raises:
RuntimeError: if the root path setting is not set.
RuntimeError: if the root path is not found.
Returns:
url (str): URL of Nucleus server with root path to assets folder.
"""

# get timeout
timeout = carb.settings.get_settings().get(DEFAULT_ASSET_ROOT_TIMEOUT_SETTING)
if not isinstance(timeout, (int, float)):
timeout = 10.0

# resolve path
logger.info(f"Check {DEFAULT_ASSET_ROOT_PATH_SETTING} setting")
default_asset_root = carb.settings.get_settings().get(DEFAULT_ASSET_ROOT_PATH_SETTING)
if not default_asset_root:
raise RuntimeError(f"The '{DEFAULT_ASSET_ROOT_PATH_SETTING}' setting is not set")
if skip_check:
return default_asset_root

# check path
result = check_server(default_asset_root, "/Isaac", timeout)
if result:
result = check_server(default_asset_root, "/NVIDIA", timeout)
if result:
logger.info(f"Assets root found at {default_asset_root}")
return default_asset_root

raise RuntimeError(f"Could not find assets root folder: {default_asset_root}")
7 changes: 2 additions & 5 deletions source/isaaclab/test/deps/isaacsim/check_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
import os
import random

try:
import isaacsim.storage.native as nucleus_utils
except ModuleNotFoundError:
import isaacsim.core.utils.nucleus as nucleus_utils

import isaacsim.core.utils.prims as prim_utils
import omni.replicator.core as rep
from isaacsim.core.api.world import World
Expand All @@ -59,6 +54,8 @@
from PIL import Image, ImageChops
from pxr import Gf, UsdGeom

import isaaclab.sim.utils.nucleus as nucleus_utils

# check nucleus connection
if nucleus_utils.get_assets_root_path() is None:
msg = (
Expand Down
10 changes: 3 additions & 7 deletions source/isaaclab/test/deps/isaacsim/check_legged_robot_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,16 @@
import os
import torch

import omni.log

try:
import isaacsim.storage.native as nucleus_utils
except ModuleNotFoundError:
import isaacsim.core.utils.nucleus as nucleus_utils

import isaacsim.core.utils.prims as prim_utils
import omni.log
from isaacsim.core.api.world import World
from isaacsim.core.cloner import GridCloner
from isaacsim.core.prims import Articulation
from isaacsim.core.utils.carb import set_carb_setting
from isaacsim.core.utils.viewports import set_camera_view

import isaaclab.sim.utils.nucleus as nucleus_utils

# check nucleus connection
if nucleus_utils.get_assets_root_path() is None:
msg = (
Expand Down
10 changes: 3 additions & 7 deletions source/isaaclab/test/deps/isaacsim/check_ref_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,14 @@
import gc
import torch # noqa: F401

import omni.log

try:
import isaacsim.storage.native as nucleus_utils
except ModuleNotFoundError:
import isaacsim.core.utils.nucleus as nucleus_utils

import isaacsim.core.utils.prims as prim_utils
import omni.log
from isaacsim.core.api.simulation_context import SimulationContext
from isaacsim.core.prims import Articulation
from isaacsim.core.utils.carb import set_carb_setting

import isaaclab.sim.utils.nucleus as nucleus_utils

# check nucleus connection
if nucleus_utils.get_assets_root_path() is None:
msg = (
Expand Down