I have a gripper in simulation by itself that is not connected to an arm. I am using the Hand-E gripper from the assets folder in Isaac sim 4.5.
this is how I am creating my gripper:
# Reference the standalone Robotiq Hand-E USD
assets_dir = "/home/csrobot/Isaac/assets/isaac-sim-assets-1@4.5.0-rc.36+release.19112.f59b3005/Assets/Isaac/4.5/Isaac/Robots/Robotiq/Hand-E"
usd_path = os.path.join(assets_dir, "Robotiq_Hand_E_convexDecomp_flattened.usd")
gripper_prim_path = "/robotiq_gripper"
add_reference_to_stage(
usd_path=usd_path,
prim_path=gripper_prim_path
)
# wrap the prim as a robot (articulation)
gripper = Robot(
prim_path=gripper_prim_path,
name="Hand-E",
position=[0.0, 1.0, 1.0],
)
My main question was how do you control your gripper. Specifically this model. I have been able to close my gripper fingers using this method below.
# Torque control
for dof in ["Slider_1","Slider_2"]:
jp = stage.GetPrimAtPath(Sdf.Path(f"{gripper_prim_path}/{dof}"))
drive = UsdPhysics.DriveAPI.Apply(jp, "linear")
drive.CreateStiffnessAttr(0.0) # N/m
drive.CreateDampingAttr(0.0)
drive.CreateMaxForceAttr(100.0) # max N·s/m
drive.CreateTargetVelocityAttr(0.001)
PhysxSchema.PhysxJointAPI.Apply(jp)
close_action = ArticulationAction(
joint_efforts = np.full(len(slider_idxs), -0.05, dtype=np.float32),
joint_indices = slider_idxs
)
open_action = ArticulationAction(
joint_efforts = np.full(len(slider_idxs), +0.05, dtype=np.float32),
joint_indices = slider_idxs
)
I then call gripper.apply_action(open_action) to open the gripper.
Which is able to control the gripper via force and I guess a velocity.
My ideal control of the gripper would be through positions. The Hand-E gripper has a range of 0.025 to -0.025 for open and close respectively. When I run my simulation to control the gripper, it works great for the force control, moving when I tell it to in my code. However when I try position control as seen below, the fingers do not move at all. They only move when if I am running my script and in the GUI under “Slider_1” or “Slider_2” I change one of the drive attributes I set above (ex. Force changing from 70.0 to 70.1) and then they would instantly move to the open or closed position as prompted.
# Position control
for dof in ["Slider_1", "Slider_2"]:
jp = stage.GetPrimAtPath(Sdf.Path(f"{gripper_prim_path}/{dof}"))
drive = UsdPhysics.DriveAPI.Apply(jp, "force")
drive.CreateStiffnessAttr().Set(1000.0)
drive.CreateDampingAttr().Set(1000.0)
drive.CreateMaxForceAttr().Set(70.0)
# drive.CreateTargetPositionAttr().Set(0.025)
drive.CreateTargetVelocityAttr(0.1)
PhysxSchema.PhysxJointAPI.Apply(jp)
close_action = ArticulationAction(
joint_positions = np.array([-0.025, -0.025]),
joint_indices = slider_idxs,
# joint_efforts = np.full(len(slider_idxs), -0.05, dtype=np.float32),
)
open_action = ArticulationAction(
joint_positions = np.array([ 0.025, 0.025]),
joint_indices = slider_idxs,
# joint_efforts = np.full(len(slider_idxs), +0.05, dtype=np.float32),
)
Not sure if I am missing something or should rework the actions.
I am using isaac sim 4.5

