forked from Auxority/hackathon-team10
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTracker.py
More file actions
37 lines (27 loc) · 929 Bytes
/
Copy pathTracker.py
File metadata and controls
37 lines (27 loc) · 929 Bytes
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
from naoqi import ALProxy
class Tracker():
def __init__(self, pepper):
self.tracker = ALProxy("ALTracker", pepper._ip, pepper._port)
self.motion = ALProxy("ALMotion", pepper._ip, pepper._port)
def track(self):
self.motion.wakeUp()
print("Time to show the cup!")
targetName = "WhiteCup"
cupSize = 0.2
self.tracker.registerTarget(targetName, cupSize)
mode = "Head"
self.tracker.setMode(mode)
self.tracker.setEffector("LArm")
self.tracker.track(targetName)
import time
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
print("Interrupted by user")
print("Stopping...")
# Stop tracker.
self.tracker.stopTracker()
self.tracker.unregisterAllTargets()
self.tracker.setEffector("None")
self.motion.rest()