Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dialogflow_task_executive/node_scripts/dialogflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,20 @@ def hotword_cb(self, msg):
rospy.loginfo("Hotword received")
self.state.set(State.LISTENING)

def text_cb(self, msg):
self.queue.put(msg)
rospy.loginfo("Recieved input")

def input_cb(self, msg):
if not self.enable_hotword:
self.state.set(State.LISTENING)
elif not self.use_audio:
# catch hotword from string
if isinstance(msg, SpeechRecognitionCandidates):
self.hotword_cb(String(data=msg.transcript[0]))
# if std_msgs/String was subscribed
elif isinstance(msg, String):
self.hotword_cb(data)
self.text_cb(msg)
else:
rospy.logerr("Unsupported data class {}".format(msg))

Expand Down