-
Notifications
You must be signed in to change notification settings - Fork 1
/
gripperexample.py
59 lines (45 loc) · 1.13 KB
/
gripperexample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import sys
import urx
import logging
import time
from urx.robotiq_two_finger_gripper import Robotiq_Two_Finger_Gripper
'''if __name__ == '__main__':
rob = urx.Robot("172.22.22.2")
robotiqgrip = Robotiq_Two_Finger_Gripper()
if(len(sys.argv) != 2):
print "false"
sys.exit()
if(sys.argv[1] == "close") :
robotiqgrip.close_gripper()
if(sys.argv[1] == "open") :
robotiqgrip.open_gripper()
rob.send_program(robotiqgrip.ret_program_to_run())
rob.close()
print "true"
sys.exit()
'''
#THIS WORKS!!
'''
rob = urx.Robot("172.22.22.2")
robotiqgrip = Robotiq_Two_Finger_Gripper(rob, 1.25)
#what this thing takes: self, robot, payload, speed, ...
logging.basicConfig()
if(len(sys.argv) != 2):
print "faLse"
sys.exit()
if(sys.argv[1] == "close") :
robotiqgrip.close_gripper()
if(sys.argv[1] == "open") :
robotiqgrip.open_gripper()
rob.send_program(robotiqgrip.ret_program_to_run())
rob.close()
sys.exit()
'''
rob = urx.Robot("172.22.22.2")
robotiqgrip = Robotiq_Two_Finger_Gripper(rob, 1.25)
robotiqgrip.close_gripper()
time.sleep(3)
robotiqgrip.open_gripper()
rob.send_program(robotiqgrip.ret_program_to_run())
rob.close()
sys.exit()