UR10 is not initializing correctly while running on standalone application

Isaac Sim Version

2023.1.1

Operating System

Ubuntu 22.04

GPU Information

  • Model: NVIDIA GeForce RTX 3090
  • Driver Version: 570.124.04

Topic Description

Detailed Description

I am trying to pick and place a cube from one place to another using UR10 with cortex library with the vacuum or surface gripper provided by the isaac sim.
When i created a standalone application to create a UR10 robot and attach gripper using the attach_gripper method of UR10 and after that when i played the simulation the robot was not standing on the position.
Therefore when i am trying to pick a cube it is not following the proper path. I have given the created UR10 robot to cortexUr10 to get the object of the same and use the following with decider and state networks.

I have attached the standalone application code here, also a video of robot which is not standing and not standing.


Code when adding UR10 using cortex.
from omni.isaac.kit import SimulationApp

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

import numpy as np
from omni.isaac.core.objects import DynamicCuboid
from omni.isaac.cortex.cortex_world import CortexWorld
from omni.isaac.cortex.df import DfNetwork, DfState, DfStateMachineDecider
from omni.isaac.cortex.dfb import DfRobotApiContext, DfBasicContext
from omni.isaac.cortex.robot import CortexUr10, add_ur10_to_stage
from omni.isaac.universal_robots import UR10
from omni.isaac.core.utils.types import ArticulationAction

class PickState(DfState):

@property
def robot(self):
    return self.context.robot

@property
def pick_cube(self):
    return self.context.robot.pick_cube

def enter(self):
    self.robot.set_joints_default_state(positions=np.array([0.0,1.57, 1.57, 0.0, 1.57, 0.0]))
    self.target_pos, _ = self.pick_cube.get_world_pose()

def step(self):
    self.robot.arm.send_end_effector(target_position=self.target_pos)
    return self

def main():

world = CortexWorld()
robot = world.add_robot(add_ur10_to_stage(name="ur10", prim_path="/World/UR10"))
robot.pick_cube = world.scene.add(
     DynamicCuboid(
         name="pick_cube", prim_path="/World/PickCube",position=np.array([0.0, 0.8, 0.1 / 2]), scale=np.array([0.1, 0.1, 0.1]), color=np.array([0.7,0.0,0.7])
     )
)
world.scene.add_default_ground_plane()

#world.add_decider_network(DfNetwork(DfStateMachineDecider(PickState()), context=DfBasicContext(robot)))

world.run(simulation_app)
simulation_app.close()

if name == “main”:

main()

code when using UR10 to add robot to scene and then creating object of CortexUr10 using the same prim

from omni.isaac.kit import SimulationApp

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

import numpy as np
from omni.isaac.core.objects import DynamicCuboid
from omni.isaac.cortex.cortex_world import CortexWorld
from omni.isaac.cortex.df import DfNetwork, DfState, DfStateMachineDecider
from omni.isaac.cortex.dfb import DfRobotApiContext, DfBasicContext
from omni.isaac.cortex.robot import CortexUr10, add_ur10_to_stage
from omni.isaac.universal_robots import UR10
from omni.isaac.core.utils.types import ArticulationAction

class PickState(DfState):

@property
def robot(self):
    return self.context.robot

@property
def pick_cube(self):
    return self.context.robot.pick_cube

def enter(self):
    self.robot.set_joints_default_state(positions=np.array([0.0,1.57, 1.57, 0.0, 1.57, 0.0]))
    self.target_pos, _ = self.pick_cube.get_world_pose()

def step(self):
    self.robot.arm.send_end_effector(target_position=self.target_pos)
    return self

def main():

world = CortexWorld()
world.scene.add(UR10(prim_path="/World/UR10",attach_gripper=True))

robot = world.add_robot(CortexUr10(name="Ur10", prim_path="/World/UR10"))
robot.pick_cube = world.scene.add(
     DynamicCuboid(
         name="pick_cube", prim_path="/World/PickCube",position=np.array([0.0, 0.8, 0.1 / 2]), scale=np.array([0.1, 0.1, 0.1]), color=np.array([0.7,0.0,0.7])
     )
)
world.scene.add_default_ground_plane()

#world.add_decider_network(DfNetwork(DfStateMachineDecider(PickState()), context=DfBasicContext(robot)))

world.run(simulation_app)
simulation_app.close()

if name == “main”:

main()

This is what is happening, if my understanding is wrong help me with better understanding to pick this cube with set of configuration of UR10

Thank you in advance i am unable to solve this problem.

If without adding UR10 using add robot, if we add reference to stage it worked for me now.

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