Isaac Sim 4.2.0: Articulation not working with torch backend

Isaac Sim Version [
] 4.2.0

Operating System

Ubuntu 22.04

GPU Information

  • Model: RTX4090
  • Driver Version:

Topic Description

Detailed Description

Hello,

I am using Isaac Sim 4.2.0 which I would use with torch backend on the gpu (“cuda:0”) .

Here the code to instantiate the articulation prim object:

        from omni.isaac.core.simulation_context import SimulationContext
        simulation_context = SimulationContext.instance()
        print("at the articulation constructor")

        self.world.scene.add(Articulation(robot_prim_path))
        world.reset()
        self._articulation.initialize(simulation_context.physics_sim_view)
        self._kinematics_solver = LulaKinematicsSolver(
            robot_description_path = "lula_description.yaml",
            urdf_path = "GEN3-7DOF-VISION_ARM_URDF_V12.urdf",
        )
        end_effector_name = "end_effector_link"
        
        self._articulation_kinematics_solver = ArticulationKinematicsSolver(self._articulation,self._kinematics_solver, end_effector_name)
        self.brush_prim_path = brush_prim_path

Here the code instantiating the world, physics and simulation context:

            #instanciate the world
            self.physics_scene = PhysicsContext(
                prim_path = self.app_config["app"]["physics_context"]["prim_path"],
                set_defaults = self.app_config["app"]["physics_context"]["set_defaults"],
                device = self.app_config["app"]["world"]["device"],
                backend = self.app_config["app"]["world"]["backend"],
            )
            self.physics_scene.enable_gpu_dynamics(True)
            self.physics_scene.enable_ccd(True)
            self.world = World(
                physics_prim_path = self.app_config["app"]["physics_context"]["prim_path"],
                physics_dt = self._physics_dt,
                rendering_dt = self.rendering_dt,
                set_defaults = self.app_config["app"]["physics_context"]["set_defaults"],
                stage_units_in_meters = self.app_config["app"]["world"]["stage_unit_in_meters"],
                device = self.app_config["app"]["world"]["device"], # cuda:0
                backend = self.app_config["app"]["world"]["backend"], # torch
                )
            #omni.timeline.get_timeline_interface().play()
            self.physics_scene = self.world.get_physics_context()

            print("device used in context: " + self.world.device)

            self.physics_scene.enable_fabric(False)
            self.world.step(render=True)
            self.world.step(render=True)
            self.world.step(render=True)
            self.world.reset()
            self.physics_scene.enable_gpu_dynamics(True)
            self.physics_scene.enable_ccd(True)
            self.physics_scene.set_gravity(-9.81)

            simulation_context = SimulationContext.instance()
            print("simulation context device: " + simulation_context.device)
        
        self.world.reset()

When I want to instantiate the Articulation object, an error occurs which is given below:

### Error Messages
Error executing job with overrides: []
Traceback (most recent call last):
  File "/home/btabia/git/new/Malleabot/./script/train.py", line 134, in main
    env = gymnasium.make(env_name, cfg_env = wandb.config["env"], cfg_task  = wandb.config["tasks"] ,world = app.get_world(), app = app.get_sim_app())
  File "/home/btabia/.local/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.ml_archive/pip_prebundle/gymnasium/envs/registration.py", line 802, in make
    env = env_creator(**env_spec_kwargs)
  File "/home/btabia/git/new/Malleabot/envs/baseenv.py", line 63, in __init__
    self.task.set_up_task(self.world)
  File "/home/git/new/tasks/baseline.py", line 106, in set_up_task
    self.robot_interface =  RobotInterfacePositionControl(self.cfg["task"]["robot"]["prim_path"],
  File "/home/git/new/tasks/utils/RobotPositionControl.py", line 27, in __init__
    world.reset()
  File "/home/.local/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.core/omni/isaac/core/world/world.py", line 390, in reset
    self.scene.post_reset()
  File "/home/.local/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.core/omni/isaac/core/scenes/scene.py", line 324, in post_reset
    prim_registery[prim_name].post_reset()
  File "/home/.local/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.core/omni/isaac/core/prims/_impl/single_prim_wrapper.py", line 131, in post_reset
    self._prim_view.post_reset()
  File "/home/.local/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.core/omni/isaac/core/articulations/articulation_view.py", line 2453, in post_reset
    XFormPrimView.post_reset(self)
  File "/homelocal/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.core/omni/isaac/core/prims/xform_prim_view.py", line 407, in post_reset
    self.set_world_poses(self._default_state.positions, self._default_state.orientations)
  File "/home/.local/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.core/omni/isaac/core/articulations/articulation_view.py", line 1754, in set_world_poses
    current_positions, current_orientations = self.get_world_poses(clone=False)
  File "/home/.local/share/ov/pkg/isaac-sim-4.2.0/exts/omni.isaac.core/omni/isaac/core/articulations/articulation_view.py", line 1834, in get_world_poses
    pos = pose[indices, 0:3]
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

Screenshots or Videos

(If applicable, add screenshots or links to videos that demonstrate the issue)

Additional Information

What I’ve Tried

(Describe any troubleshooting steps you’ve already taken)

Related Issues

(If you’re aware of any related issues or forum posts, please link them here)

Additional Context

(Add any other context about the problem here)