forked from kemot1709/smart_table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scenario_manager.py
executable file
·36 lines (26 loc) · 1.04 KB
/
scenario_manager.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
#!/usr/bin/env python3.8
import time
import os
import string
# Suppress tensorflow noncritical warnings
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from nodes.usage_table import UsageTableNode
def ignore_punctuation_marks(sentence):
result = sentence.translate(str.maketrans('', '', string.punctuation))
return result
if __name__ == "__main__":
usage_node = UsageTableNode()
while 1:
# Wait for commands
if usage_node.command_arrived:
usage_node.command_arrived = False
command = ignore_punctuation_marks(usage_node.command).lower()
if command == "przywieź mi herbatę" or ("bring" in command and "tea" in command):
if usage_node.handle_give_tea_command() != 0:
usage_node.abort_task()
elif command == "odwieź kubek do kuchni" or ("take" in command and "empty" in command):
if usage_node.handle_drop_mug_command() != 0:
usage_node.abort_task()
else:
pass
time.sleep(1)