Skip to content

Commit 3d8218a

Browse files
committed
Use Nucleus path for MPM teapot asset
1 parent 6bd6182 commit 3d8218a

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

scripts/demos/newton_cup_pour_mpm.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@
132132
CUP_ASSET_PATH = f"{CUP_BODY_PATH}/Asset"
133133
GROUND_PATH = "/World/Ground"
134134
VISUALS_PATH = "/World/Visuals"
135-
TEAPOT_USD_PATH = (
136-
"/home/maximiliank/Work/IsaacLab/source/isaaclab_assets/isaaclab_assets/rand/teapot_hollow_separate_lid.usdc"
137-
)
135+
TEAPOT_USD_REL_PATH = "Mimic/nut_pour_task/nut_pour_assets/teapot_hollow_separate_lid.usdc"
138136

139137
TABLE_TOP_Z = 0.85
140138
TABLE_HALF_EXTENTS = (0.85, 0.55, 0.03)
@@ -248,14 +246,18 @@ def cup_pose_at_time(sim_time: float) -> tuple[np.ndarray, np.ndarray, np.ndarra
248246

249247

250248
def get_teapot_usd_path() -> str:
251-
"""Return the local hollow teapot USD asset path."""
249+
"""Return a local path for the hollow teapot USD asset."""
250+
251+
from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR, retrieve_file_path
252252

253-
usd_path = os.path.abspath(args_cli.teapot_usd or TEAPOT_USD_PATH)
254-
if not os.path.exists(usd_path):
253+
usd_path = args_cli.teapot_usd or f"{ISAACLAB_NUCLEUS_DIR}/{TEAPOT_USD_REL_PATH}"
254+
try:
255+
return retrieve_file_path(usd_path)
256+
except FileNotFoundError as exc:
255257
raise FileNotFoundError(
256-
f"Teapot USD not found: {usd_path}. Pass --teapot-usd with the local hollow teapot asset path."
257-
)
258-
return usd_path
258+
f"Teapot USD not found: {usd_path}. Upload the hollow teapot asset to the IsaacLab Nucleus path "
259+
"or pass --teapot-usd with a local/Nucleus asset path."
260+
) from exc
259261

260262

261263
def _prune_mesh_to_largest_connected_component(mesh_prim) -> bool:

0 commit comments

Comments
 (0)