-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcyton_control.py
43 lines (30 loc) · 1.09 KB
/
cyton_control.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
from assistant.sensors import MyoController, LeapController
from assistant.cyton.cyton_connection import CytonConnection
from assistant.cyton.cyton_controller import CytonController
from assistant.scheduler import Scheduler
from assistant.items.Block import Block
from assistant.items.locations import BlockEndLocations
from assistant.state_machine import PickPlaceStateMachine
def main():
########
# Plan #
########
# blocks = [Block(idx + 1) for idx, e in enumerate(BlockEndLocations)]
# # blocks = [Block(1, color="blue", location=BlockEndLocations.A)]
# scheduler = Scheduler(blocks)
#
# print("PLAN: ", scheduler.execute())
###############
# Controllers #
###############
client = CytonConnection(wait=False)
controller = CytonController(client=client)
leap = LeapController()
myo = MyoController()
#################
# State Machine #
#################
state_machine = PickPlaceStateMachine(controller=controller, leap_controller=leap, myo_controller=myo)
state_machine.run()
if __name__ == "__main__":
main()