-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsshTrun.py
31 lines (22 loc) · 824 Bytes
/
sshTrun.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
import paramiko
import sys
hostname = '10.0.0.100'
port = 22
username = 'pi'
password = 'raspberry'
def action(img, rect, s, steps):
height, weight, _ignore = img.shape
print(rect[0][0], rect[0][2])
bonduary = (weight * 0.2, weight * 0.8)
print(bonduary)
center = int((rect[0][2] + rect[0][0]) / 2)
if center < bonduary[0]:
stdin, stdout, stderr = s.exec_command('python3 /home/pi/AutoTrackCam/remoteTurn.py 29 31 33 35 -5')
return True, (steps - 1)
if center > bonduary[1]:
stdin, stdout, stderr = s.exec_command('python3 /home/pi/AutoTrackCam/remoteTurn.py 29 31 33 35 5')
return True, (steps + 1)
return False
def resetAction(steps, s):
command = 'python3 /home/pi/AutoTrackCam/remoteTurn.py 29 31 33 35 ' + str(int (steps * 5))
return