[Question] Spawn USD File in orbit
Question
I'm working on the custom code in the same position with source/standalone/demos/arms.py, since I'm also working on the task with franka panda arm robot. I have constructed my own usd file externally, and I was to import this usd file in 'arms.py'.
# -- Table
cfg = sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Mounts/Stand/stand_instanceable.usd", scale=(2.0, 2.0, 2.0)
)
cfg.func("/World/Origin2/Table", cfg, translation=(0.0, 0.0, 1.03))
this is the codes for importing table USD, but this one is built in isaac nucleus. So I put the local file directory in the variable 'usd_path.'
# -- Valve
valve_cfg = sim_utils.UsdFileCfg(
usd_path="/home/vision/Downloads/valves/round_valve/round_valve_1.usd", scale=(1.0, 1.0, 1.0))
valve_cfg.func("/World/Origin2/Valve*", valve_cfg, translation=(0.0, 0.0, 1.03))
`
2024-03-14 08:27:54 [12,068ms] [Error] [main]
Error in 'pxrInternal_v0_22__pxrReserved__::UsdStage::_IsValidPathForCreatingPrim' at line 3340 in file /buildAgent/work/ac88d7d902b57417/USD/pxr/usd/usd/stage.cpp : 'Path must be an absolute path: <>'
2024-03-14 08:27:54 [12,068ms] [Error] [main] Traceback (most recent call last):
File "/home/vision/orbit/source/standalone/demos/valve_try.py", line 169, in
` I keep getting this kind of error.
Also, I tadded my custom usd.file in Isaac Assets (Beta) to import this, but everytime I open the isaacSIM nucleus via python interpreter, this updated Isaac Assets isn't being directly implemented. I guess it because it works from different root folder.
I really want to know if there are other solutions to import my usd file in this demo file. Thank you.
The prim path you are setting is "/World/Origin2/Valve*". However, supported SDF paths are alpha-numeric with special characters "_" and "/" . Can you check if this resolves the issue?
Thanks for your response. I deleted * and put /World/Origin2/Valve instead. However, since my USD file includes two parts of body, I got this kind of error. The reason I put * was to include entire parts of the USD file.
[Error] [omni.physicsschema.plugin] Rigid Body of (/World/Origin2/Valve/round_valve/body/body) missing xformstack reset when child of rigid body (/World/Origin2/Valve/round_valve/body) in hierarchy. Simulation of multiple RigidBodyAPI's in a hierarchy will cause unpredicted results. Please fix the hierarchy or use XformStack reset.
In this case, how can I handle the hierarchy of the multiple bodies? Thank you.
` def design_scene() -> tuple[dict, list[list[float]]]: """Designs the scene.""" # Ground-plane cfg = sim_utils.GroundPlaneCfg() cfg.func("/World/defaultGroundPlane", cfg) # Lights cfg = sim_utils.DomeLightCfg(intensity=2000.0, color=(0.75, 0.75, 0.75)) cfg.func("/World/Light", cfg)
# Create separate groups called "Origin1", "Origin2", "Origin3"
# Each group will have a mount and a robot on top of it
origins = [[0.0, -1.0, 0.0], [0.0, 1.0, 0.0]]
# Origin 1 with Franka Panda
prim_utils.create_prim("/World/Origin1", "Xform", translation=origins[0])
# -- Table
cfg = sim_utils.UsdFileCfg(usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Mounts/SeattleLabTable/table_instanceable.usd")
cfg.func("/World/Origin1/Table", cfg, translation=(0.55, 0.0, 1.05))
# -- Robot
franka_arm_cfg = FRANKA_PANDA_CFG.replace(prim_path="/World/Origin1/Robot")
franka_arm_cfg.init_state.pos = (0.0, 0.0, 1.05)
robot_franka = Articulation(cfg=franka_arm_cfg)
# Origin 2 with Valve
prim_utils.create_prim("/World/Origin2", "Xform", translation=origins[1])
# -- Table
cfg = sim_utils.UsdFileCfg(
usd_path=f"{ISAAC_NUCLEUS_DIR}/Props/Mounts/Stand/stand_instanceable.usd", scale=(2.0, 2.0, 2.0)
)
cfg.func("/World/Origin2/Table", cfg, translation=(0.0, 0.0, 1.03))
# -- Valve
valve_cfg = sim_utils.UsdFileCfg(
usd_path="/home/vision/Downloads/valves/round_valve/round_valve_1.usd", scale=(1.0, 1.0, 1.0))
valve_cfg.func("/World/Origin2/Valve/.*", valve_cfg, translation=(0.0, 0.0, 1.03))
# return the scene information
scene_entities = {"robot_franka": robot_franka}
# scene_entities = {"robot_franka": robot_franka, "valve": valve}
return scene_entities, origins
`
This is the entire code about the function of 'design_scene'.
Hi @nowionlyseedaylight, you should make sure that your USD has the default prim attribute at the correct location.
The code should work with /World/Origin2/Valve.