Isaac Sim Version
4.2.0
Isaac Lab Version
omni-isaac-lab 0.30.1
omni.isaac-lab_assets 0.1.4
omni-isaac-lab_tasks 0.10.17
Operating System
Ubuntu 22.04
Topic Description
Detailed Description
I am trying to create a new scene, with custom USDs.
I want to add a human using a USD file as an object with physics properties (mass, collisions, etc). Thus, I tried loading the human as a RigidBody. However, I cannot load the human using a USD path by using the RigidObjectCfg.
Steps to Reproduce
- Setup a scene - Use the Rigid Object tutorial to set up a scene. Instead of loading objects with a predefined configuration, please load any USD from a custom path using UsdFileCfg.
In my case, I am using the create_scene.py from the standalone tutorial. Apart from the ground and dome_light, I have added the human rigid body code using a USD path.
@configclass
class HumanSceneCfg(InteractiveSceneCfg):
# ground plane
ground = AssetBaseCfg(prim_path="/World/defaultGroundPlane", spawn=sim_utils.GroundPlaneCfg())
# lights
dome_light = AssetBaseCfg(
prim_path="/World/Light", spawn=sim_utils.DomeLightCfg(intensity=3000.0, color=(0.75, 0.75, 0.75))
)
human = RigidObjectCfg(
prim_path="/World/Human",
spawn=sim_utils.UsdFileCfg(
usd_path="/<path_to_usd>/USD/male_adult_police_04.usd",
),
init_state=RigidObjectCfg.InitialStateCfg(),
)
def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
"""Runs the simulation loop."""
# Extract scene entities
# note: we only do this here for readability.
human = scene["human"]
# Define simulation stepping
sim_dt = sim.get_physics_dt()
count = 0
# Simulation loop
while simulation_app.is_running():
sim.step()
# Increment counter
count += 1
# Update buffers
scene.update(sim_dt)
def main():
"""Main function."""
# Load kit helper
sim_cfg = sim_utils.SimulationCfg(device=args_cli.device)
sim = SimulationContext(sim_cfg)
# Set main camera
sim.set_camera_view([2.5, 0.0, 4.0], [0.0, 0.0, 2.0])
# Design scene
scene_cfg = HumanSceneCfg(num_envs=args_cli.num_envs, env_spacing=2.0)
scene = InteractiveScene(scene_cfg)
# Play the simulator
sim.reset()
# Now we are ready!
print("[INFO]: Setup complete...")
# Run the simulator
run_simulator(sim, scene)
if __name__ == "__main__":
# run the main function
main()
# close sim app
simulation_app.close()
Error Messages
When I try to run this, I get the following warning.
And then the following error message -
[INFO]: Setup complete…
Traceback (most recent call last):
File “/root/miniconda3/envs/isaacplan/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/root/miniconda3/envs/isaacplan/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/root/.vscode-server/extensions/ms-python.debugpy-2024.8.0-linux-x64/bundled/libs/debugpy/adapter/…/…/debugpy/launcher/…/…/debugpy/main.py”, line 39, in
cli.main()
File “/root/.vscode-server/extensions/ms-python.debugpy-2024.8.0-linux-x64/bundled/libs/debugpy/adapter/…/…/debugpy/launcher/…/…/debugpy/…/debugpy/server/cli.py”, line 430, in main
run()
File “/root/.vscode-server/extensions/ms-python.debugpy-2024.8.0-linux-x64/bundled/libs/debugpy/adapter/…/…/debugpy/launcher/…/…/debugpy/…/debugpy/server/cli.py”, line 284, in run_file
runpy.run_path(target, run_name=“main”)
File “/root/.vscode-server/extensions/ms-python.debugpy-2024.8.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py”, line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File “/root/.vscode-server/extensions/ms-python.debugpy-2024.8.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py”, line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File “/root/.vscode-server/extensions/ms-python.debugpy-2024.8.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py”, line 124, in _run_code
exec(code, run_globals)
File “/viewpoint_autonomy/standalone/human_scene.py”, line 187, in
main()
File “/viewpoint_autonomy/standalone/human_scene.py”, line 182, in main
run_simulator(sim, scene)
File “/viewpoint_autonomy/standalone/human_scene.py”, line 164, in run_simulator
scene.update(sim_dt)
File “/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/scene/interactive_scene.py”, line 494, in update
rigid_object.update(dt)
File “/IsaacLab/source/extensions/omni.isaac.lab/omni/isaac/lab/assets/rigid_object/rigid_object.py”, line 127, in update
self._data.update(dt)
AttributeError: ‘RigidObject’ object has no attribute ‘_data’. Did you mean: ‘data’?