Skip to content
Draft
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
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@

# Mock out modules that are not available on RTD
autodoc_mock_imports = [
"boto3",
"botocore",
"torch",
"torchvision",
"numpy",
Expand Down
74 changes: 74 additions & 0 deletions source/isaaclab/isaaclab/sim/utils/nucleus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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

from isaaclab.utils import client

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:
"""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}")
result, _ = client.stat(f"{server}{path}")
if result == client.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}")
4 changes: 2 additions & 2 deletions source/isaaclab/isaaclab/sim/utils/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@ def add_reference_to_stage(usd_path: str, prim_path: str, prim_type: str = "Xfor

# Download remote files to local cache
if file_status == 2:
logger.info(f"Downloading remote USD file: {original_usd_path}")
logger.debug(f"Downloading remote USD file: {original_usd_path}")
try:
usd_path = retrieve_file_path(usd_path, force_download=False)
logger.info(f" Downloaded to: {usd_path}")
logger.debug(f" Downloaded to: {usd_path}")
except Exception as e:
raise FileNotFoundError(f"Failed to download USD file from {original_usd_path}: {e}")

Expand Down
Loading
Loading