Hello,
I am able to open and close the 2F-85 gripper I have, which is mounted on an UR5, but am struggling to figure out how to read the gripper position.
Originally I had the USB-serial converter directly plugged into my computer and reading the gripper position (over /dev/ttyUSB0) was really easy (I used python, as per https://blog.robotiq.com/controlling-the-robotiq-2f-gripper-with-modbus-commands-in-python). However, then I could not coordinate the gripper with my UR5's movements.
Therefore I plugged the converter to the USB port within the UR5 control box, so that I can command the gripper in sync with the robot `movel` commands. I am able to open and close it using the library https://github.com/jkur/python-urx/blob/SW3.5/urx/robotiq_two_finger_gripper.py, or roughly:
However, the python-urx library leaves "getting the gripper status" as an exercise for the reader, and for the life of me I cannot figure out how to do it. I thought it would be so easy, since when I had it plugged into the laptop it was very straightforward. But now, I'm unclear how to read the data.
The library includes code to get the robot status (e.g. joint configuration, tool position), but as far as I can tell the robotiq gripper status is not included in that information.
Does anyone have python code for reading the gripper status over the UR5 tcp/ip protocol, or be able to give an example of how to do so?
Thank you!