-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtuio_client.py
More file actions
executable file
·38 lines (30 loc) · 978 Bytes
/
tuio_client.py
File metadata and controls
executable file
·38 lines (30 loc) · 978 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
38
#!/usr/bin/env python
import tuio
from time import sleep
from utils import trace
from chalkboard import ChalkBoard
tracking = tuio.Tracking()
print "loaded profiles:", tracking.profiles.keys()
print "list functions to access tracked objects:", tracking.get_helpers()
#list of fiducials to track
track_fiducials = [0,1,2,3,4]
board = ChalkBoard()
board.loadImage("images/square2.jpg", 120, 90)
#board.loadImage("images/gear.jpg", 120, 90)
#board.loadImage("images/logo.png", 120, 90)
board.init()
try:
while True:
tracking.update()
for obj in tracking.objects():
# trace()
if obj.id in track_fiducials:
board.checkSpray(obj.xpos, obj.ypos, obj.id)
# print "x: %s y:%s angle:%s" % (obj.xpos, obj.ypos, obj.angle)
if len(track_fiducials) == 1:
break
continue
#
#sleep(0.100)
except KeyboardInterrupt:
tracking.stop()