Cannot run simulation of customized robot

I’m trying to load my customized robot (imported from onshape.com and saved as a .usd file) to Isaac Sim by python standalone scripts.

My code is modified from /standalone_examples/api/omni.isaac.core/add_frankas.py.

import os
curr_path = os.path.abspath(os.path.dirname(file))
asset_path = curr_path + “robot/myrobot.usd”

from omni.isaac.kit import SimulationApp

simulation_app = SimulationApp({“headless”: False})

from omni.isaac.core import World
from omni.isaac.core.robots import Robot
from omni.isaac.core.utils.stage import add_reference_to_stage, get_stage_units
import numpy as np
import argparse
import sys

my_world = World(stage_units_in_meters=1.0)
my_world.scene.add_default_ground_plane()

add_reference_to_stage(usd_path=asset_path, prim_path=“/World/myrobot”)
articulated_system_1 = my_world.scene.add(Robot(prim_path=“/World/myrobot”, name=“robot1”))
my_world.reset()
articulated_system_1.set_world_pose(position=np.array([0.0, 0.0, 2.0]) / get_stage_units())

while simulation_app.is_running():
my_world.step(render=True)

simulation_app.close()

But I got the following error:
Traceback (most recent call last):
File “test_addRobot.py”, line 27, in
my_world.reset()
File “/home/qingyu/.local/share/ov/pkg/isaac_sim-2022.2.0/exts/omni.isaac.core/omni/isaac/core/world/world.py”, line 282, in reset
self._scene._finalize(self.physics_sim_view)
File “/home/qingyu/.local/share/ov/pkg/isaac_sim-2022.2.0/exts/omni.isaac.core/omni/isaac/core/scenes/scene.py”, line 292, in _finalize
robot.initialize(physics_sim_view)
File “/home/qingyu/.local/share/ov/pkg/isaac_sim-2022.2.0/exts/omni.isaac.core/omni/isaac/core/articulations/articulation.py”, line 163, in initialize
self._articulation_view.initialize(physics_sim_view=physics_sim_view)
File “/home/qingyu/.local/share/ov/pkg/isaac_sim-2022.2.0/exts/omni.isaac.core/omni/isaac/core/articulations/articulation_view.py”, line 201, in initialize
assert self._physics_view.is_homogeneous
File “/home/qingyu/.local/share/ov/pkg/isaac_sim-2022.2.0/kit/extsPhysics/omni.physics.tensors-104.1.6-5.1/omni/physics/tensors/impl/api.py”, line 156, in is_homogeneous
return self._backend.is_homogeneous
AttributeError: ‘NoneType’ object has no attribute ‘is_homogeneous’

Any ideas how to solve it? When I comment out the line

articulated_system_1 = my_world.scene.add(Robot(prim_path=“/World/myrobot”, name=“robot1”))

The error goes away, but I cannot see the robot in the scene.

My bad. The prim path should be /World/myrobot/robot. The imported object from onshape has some hierarchical structure and need to be careful to specify the prim path.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.