Detecting Contact on the Gripper for Stretch RE1

I am working on a project that requires detecting when the gripper has picked up an object and I’ve seen the object grasping demo but I’m having a hard time understanding how the robot knows it’s grabbed an object. I’ve seen that there is a way to use motor currents to detect contact for other joints of Stretch but I haven’t seen how to access the motor currents/effort for the gripper. If anyone has guidance on what methods work best for determining when the gripper is grasping an object or where I could look to learn some more about this, please let me know. Thank you!

Hi @Edelio_Taboada, welcome to the Stretch forum! The object grasping demo for RE1 was “open loop” in that it simply closed the gripper and assumed it had grabbed the object. The robot visually estimated the size of the object to determine how far to close the gripper. The corresponding lines of code are here:

With Stretch 3, we’ve added a wrist-mounted camera and ArUco markers on the fingertips to enable “closed loop” grasping. Sample code available here and here.

Since you’re using a Stretch RE1, you can close the loop with the head camera. For example, one approach you can take is using an object detection network (e.g. YOLO) to detect if the class of object is seen when the gripper presents to the camera. Another approach is what you suggested regarding the motor current of the gripper servo. Subscribing to the /stretch/joint_states topic, you’ll receive the motor current of the gripper under the effort array. Monitoring the value for spikes while the gripper closes on an object is one way to estimate if the grasp has completed.

1 Like

thank you! That’s very helpful