Controlling a Robotiq Hand-E Gripper

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

Hi @john_brann, thanks for posting your issue. What you are doing is fine, you just want to make sure to set a non-zero value for stiffness and also add some damping for stability to get the controller to follow position targets.

Thank you for the reply!

However, what I seeing is actually the opposite behavior.

Position control is only working when I set a stiffness value greater then 0.

The other issue I am having is that the position control only works when I change a single value in the GUI when my script is running.

For example, I will run my script to just import the gripper and I command it to open and close and repeat. When I first start the sim the gripper stays in the start position and does not open or close, but when I go into the side bar and change a single value under the PhysicsPrismatic joint for the finger, lets say Max Force from 100 to 100.1. It will then works:

does not work

Change the value and then it does work.

And by work I mean open or close the finger joints via a position via the method above using an ArticulationAction (gripper.apply_action(close_action)

Video showing my behavior:

Do you think it has something to do with me not reseting the world properly? or needing to apply some physics API?

I have been stuck on this for a while. I appreciate any help.

I think I may have solved the issue. For some reason if I call world.reset() after I initialize my drive instances above then the gripper will not move but if I call world.reset() before to initialize the gripper and everything, and then set up the drives, the issue seems to be solved and the gripper opens and closes off of the initial run

Hi @john_brann, that is great that you found a way around the issue. I don’t see why calling world.reset before setting up the drive configs is necessary. Can you share the code that reproduces your setup so I can take a look?

Hello!

We noticed that this topic hasn’t received any recent responses, so we are closing it for now to help keep the forum organized.

If you’re still experiencing this issue or have additional questions, please feel free to create a new topic with updated details. When doing so, we recommend mentioning or linking to this original topic in your new post—this helps provide context and makes it easier for others to assist you.

Thank you for being part of the NVIDIA Isaac Sim community.

Best regards,
The NVIDIA Isaac Sim Forum Team