I set up a RL environment in Isaac Sim using OmniIsaacGymEnv plug in and the RLTask class. I am using the UR10 class set up in omni.isaac.universal_robots directory.
I view the robot instances through ArticulationView and the ee_link through RigidPrimView but I cannot gain access to the gripper methods. I would like to see the same behavior as the pick_place example. Any hints? Code below.
Hi there, in order to access the UR10 SurfaceGripper, you would need to create an instance of the UR10 class in the task self._robot = UR10(...) and add the robot instance to the scene with scene.add(self._robot). Then, you can access the SurfaceGripper component with self._robot.gripper.
Hi there, I used exactly the described setup (= RLTask from OmniIsaacGymEnvs & UR10 Robot), however my gripper won’t close:
def pre_physics_step(self, actions) -> None:
reset_env_indices = self.reset_buf.nonzero(as_tuple=False).squeeze(-1)
if 0 < len(reset_env_indices):
self.reset_envs(reset_env_indices)
# Rotate Joints
joint_rots = self._robots_view.get_joint_positions()
joint_rots += torch.tensor(actions[:, 0:6]) * self._max_joint_rot_speed
self._robots_view.set_joint_positions(positions=joint_rots)
# Open or close Gripper
for env_index in range(self._num_envs):
gripper = self._robots[env_index].gripper
is_closed = gripper.is_closed()
gripper_action = actions[env_index, 6]
if 0.9 < gripper_action and is_closed:
gripper.open()
elif gripper_action < -0.3 and not is_closed:
gripper.close()
I tested the code by having it called explicitly without the Actor Action and placing a part right into the gripper, however it does not work. I also have a single threaded Implementation with a single actor that doesn’t use RLTask and there the gripper works.