Skip to content

Commit 6c0221c

Browse files
committed
Add omni-client replacement from:
isaac-sim#4134
1 parent 19046ec commit 6c0221c

File tree

6 files changed

+798
-176
lines changed

6 files changed

+798
-176
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ def _mock_ror(self, other):
153153

154154
# Mock out modules that are not available on RTD
155155
autodoc_mock_imports = [
156+
"boto3",
157+
"botocore",
156158
"torch",
157159
"torchvision",
158160
"numpy",
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
2+
# All rights reserved.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
6+
import logging
7+
8+
import carb
9+
10+
from isaaclab.utils import client
11+
12+
logger = logging.getLogger(__name__)
13+
14+
DEFAULT_ASSET_ROOT_PATH_SETTING = "/persistent/isaac/asset_root/default"
15+
DEFAULT_ASSET_ROOT_TIMEOUT_SETTING = "/persistent/isaac/asset_root/timeout"
16+
17+
18+
def check_server(server: str, path: str, timeout: float = 10.0) -> bool:
19+
"""Check a specific server for a path
20+
21+
Args:
22+
server (str): Name of Nucleus server
23+
path (str): Path to search
24+
timeout (float): Default value: 10 seconds
25+
26+
Returns:
27+
bool: True if folder is found
28+
"""
29+
logger.info(f"Checking path: {server}{path}")
30+
result, _ = client.stat(f"{server}{path}")
31+
if result == client.Result.OK:
32+
logger.info(f"Success: {server}{path}")
33+
return True
34+
else:
35+
logger.info(f"Failure: {server}{path} not accessible")
36+
return False
37+
38+
39+
def get_assets_root_path(*, skip_check: bool = False) -> str:
40+
"""Tries to find the root path to the Isaac Sim assets on a Nucleus server
41+
42+
Args:
43+
skip_check (bool): If True, skip the checking step to verify that the resolved path exists.
44+
45+
Raises:
46+
RuntimeError: if the root path setting is not set.
47+
RuntimeError: if the root path is not found.
48+
49+
Returns:
50+
url (str): URL of Nucleus server with root path to assets folder.
51+
"""
52+
53+
# get timeout
54+
timeout = carb.settings.get_settings().get(DEFAULT_ASSET_ROOT_TIMEOUT_SETTING)
55+
if not isinstance(timeout, (int, float)):
56+
timeout = 10.0
57+
58+
# resolve path
59+
logger.info(f"Check {DEFAULT_ASSET_ROOT_PATH_SETTING} setting")
60+
default_asset_root = carb.settings.get_settings().get(DEFAULT_ASSET_ROOT_PATH_SETTING)
61+
if not default_asset_root:
62+
raise RuntimeError(f"The '{DEFAULT_ASSET_ROOT_PATH_SETTING}' setting is not set")
63+
if skip_check:
64+
return default_asset_root
65+
66+
# check path
67+
result = check_server(default_asset_root, "/Isaac", timeout)
68+
if result:
69+
result = check_server(default_asset_root, "/NVIDIA", timeout)
70+
if result:
71+
logger.info(f"Assets root found at {default_asset_root}")
72+
return default_asset_root
73+
74+
raise RuntimeError(f"Could not find assets root folder: {default_asset_root}")

source/isaaclab/isaaclab/sim/utils/stage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,10 @@ def add_reference_to_stage(usd_path: str, prim_path: str, prim_type: str = "Xfor
491491

492492
# Download remote files to local cache
493493
if file_status == 2:
494-
logger.info(f"Downloading remote USD file: {original_usd_path}")
494+
logger.debug(f"Downloading remote USD file: {original_usd_path}")
495495
try:
496496
usd_path = retrieve_file_path(usd_path, force_download=False)
497-
logger.info(f" Downloaded to: {usd_path}")
497+
logger.debug(f" Downloaded to: {usd_path}")
498498
except Exception as e:
499499
raise FileNotFoundError(f"Failed to download USD file from {original_usd_path}: {e}")
500500

0 commit comments

Comments
 (0)