|
|
@ -9,12 +9,13 @@
|
|
|
|
# Libraries
|
|
|
|
# Libraries
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
from config import characters, directions
|
|
|
|
from config import characters, directions
|
|
|
|
from logic import tts, read_script, select_script
|
|
|
|
from logic import tts, read_script, select_script, play_script
|
|
|
|
from subprocess import call
|
|
|
|
from subprocess import call
|
|
|
|
import paho.mqtt.client as mqtt
|
|
|
|
import paho.mqtt.client as mqtt
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
from time import sleep
|
|
|
|
from time import sleep
|
|
|
|
from pixel_ring import pixel_ring
|
|
|
|
from pixel_ring import pixel_ring
|
|
|
|
|
|
|
|
import serial
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# === SETUP OF MQTT PART 1 ===
|
|
|
|
# === SETUP OF MQTT PART 1 ===
|
|
|
@ -33,6 +34,8 @@ def on_connect(client, userdata, flags, rc):
|
|
|
|
client.subscribe("hermes/asr/textCaptured")
|
|
|
|
client.subscribe("hermes/asr/textCaptured")
|
|
|
|
client.subscribe("hermes/dialogueManager/sessionQueued")
|
|
|
|
client.subscribe("hermes/dialogueManager/sessionQueued")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Set up serial connection with the microcontroller that controls the speaker LED's
|
|
|
|
|
|
|
|
ser = serial.Serial('/dev/ttyACM0', 1000000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -43,20 +46,13 @@ def on_wakeword(client, userdata, msg):
|
|
|
|
|
|
|
|
|
|
|
|
# Function which is triggered when the intent introduction is activated
|
|
|
|
# Function which is triggered when the intent introduction is activated
|
|
|
|
def on_play_intro(client,userdata,msg):
|
|
|
|
def on_play_intro(client,userdata,msg):
|
|
|
|
# # disable this intent to avoid playing another act triggered by the Google Home
|
|
|
|
|
|
|
|
# client.publish("hermes/dialogueManager/configure", json.dumps({
|
|
|
|
|
|
|
|
# 'siteId': 'default',
|
|
|
|
|
|
|
|
# 'intents': {
|
|
|
|
|
|
|
|
# 'jocavdh:play': False
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# }))
|
|
|
|
|
|
|
|
import pdb; pdb.set_trace()
|
|
|
|
import pdb; pdb.set_trace()
|
|
|
|
path = 'scripts_play/intro/'
|
|
|
|
path = 'scripts_play/intro/'
|
|
|
|
call(["python3", "act.py", 'scripts_play/intro/introduction_01.txt'])
|
|
|
|
#call(["python3", "act.py", 'scripts_play/intro/introduction_01.txt'])
|
|
|
|
|
|
|
|
play_script('scripts_play/intro/introduction_01.txt')
|
|
|
|
print('The act is over.')
|
|
|
|
print('The act is over.')
|
|
|
|
|
|
|
|
|
|
|
|
#on_play_question(client, userdata, msg)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Function which is triggered when the intent for another question is activated
|
|
|
|
# Function which is triggered when the intent for another question is activated
|
|
|
|
def on_play_question(client, userdata, msg):
|
|
|
|
def on_play_question(client, userdata, msg):
|
|
|
|
|
|
|
|
|
|
|
|