-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRESET_POSITION.py
45 lines (37 loc) · 1.05 KB
/
RESET_POSITION.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
'''
Resetting robot position
- Command arguements:
- - 0 Immediate robot reset
- - 1 Reset simulation on 127.0.0.1
[other] Reset robot in 5 seconds
'''
import abb
import time
import sys
from Robot_Config import robot_config
modeSelection = 2
cmdArgs = sys.argv
if len(cmdArgs)==2:
modeSelection = int(cmdArgs[1])
if modeSelection == 1:
R = abb.Robot("127.0.0.1")
print("Robot resetting")
elif modeSelection == 0:
R = abb.Robot("192.168.125.1")
print("Robot resetting now")
elif modeSelection == 2:
R = abb.Robot("192.168.125.1")
print("Robot moving backwards and then resetting")
currPos = R.get_cartesian()
currPos[0][0] -= 100
R.set_cartesian(currPos)
else:
R = abb.Robot("192.168.125.1")
print("---- WARNING ----")
print(" Robot will move suddenly in 5 seconds")
print(" Press CTRL+C to cancel move")
print("-----------------")
time.sleep(5)
#R.set_workobject(robot_config.get_wobj())
R.set_tool([[0,0,0],[1,0,0,0]])
R.reset_position(0)