I'd like to use the object detection feature of the Robotiq Gripper from python script.
When the gripper grasps some object, I want to get the OBJ value (and POS).
I executed bellow script, but the last POS and OBJ are both the values when the gripper was fully close despite grasping object.
UR5 + Robotiq 2F-85
import socket
import time
import urx
from urx.robotiq_two_finger_gripper import Robotiq_Two_Finger_Gripper
rob = urx.Robot("192.168.0.100")
robotiqgrip = Robotiq_Two_Finger_Gripper(rob)
PORT = 63352
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.0.100", PORT))
s.send(b"socket_send_string(\"GET POS\", \"gripper_socket\")")
data = s.recv(1024)
print(data)
robotiqgrip.open_gripper()
time.sleep(2.)
s.send(b"socket_send_string(\"GET POS\", \"gripper_socket\")")
data = s.recv(1024)
print(data)
robotiqgrip.close_gripper()
time.sleep(2.)
s.send(b"socket_send_string(\"GET POS\", \"gripper_socket\"")
data = s.recv(1024)
print(data)
s.send(b"socket_send_string(\"GET OBJ\", \"gripper_socket\")")
data = s.recv(1024)
print(data)
I'd like to use the object detection feature of the Robotiq Gripper from python script. When the gripper grasps some object, I want to get the OBJ value (and POS). I executed bellow script, but the last POS and OBJ are both the values when the gripper was fully close despite grasping object.
UR5 + Robotiq 2F-85
import socket import time import urx from urx.robotiq_two_finger_gripper import Robotiq_Two_Finger_Gripper
rob = urx.Robot("192.168.0.100") robotiqgrip = Robotiq_Two_Finger_Gripper(rob)
PORT = 63352 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("192.168.0.100", PORT))
s.send(b"socket_send_string(\"GET POS\", \"gripper_socket\")") data = s.recv(1024) print(data)
robotiqgrip.open_gripper() time.sleep(2.)
s.send(b"socket_send_string(\"GET POS\", \"gripper_socket\")") data = s.recv(1024) print(data)
robotiqgrip.close_gripper() time.sleep(2.)
s.send(b"socket_send_string(\"GET POS\", \"gripper_socket\"") data = s.recv(1024) print(data) s.send(b"socket_send_string(\"GET OBJ\", \"gripper_socket\")") data = s.recv(1024) print(data)
s.close()
Thank you for your help.