NAOqi Audio - Overview | API | QiChat | Tutorials
Choregraphe offers a full environment enabling you to quickly create and test dialog boxes.
Follow step by step the tutorials: Creating Dialog boxes.
Once familiar with the main functions, you can add more complex rules.
For further details, see: QiChat - Syntax.
Here are few sample codes in Python.
#create a dialog data file
dialog = """
topic: ~myTopic () \n
language: enu \n
u:(hello) hello \n """
file = open("path/to/myDialog.top","w")
file.write(dialog)
file.close()
# load topic
proxy = ALProxy("ALDialog")
proxy.setLanguage("English")
self.topic = proxy.loadTopic("myDialog.top")
# start dialog
proxy.subscribe("myModule")
# activate dialog
proxy.activateTopic(self.topic)
proxy = ALProxy("ALDialog")
# deactivate topic
proxy.deactivateTopic(self.topic)
# unload topic
proxy.unloadTopic(self.topic)
# stop dialog
proxy.unsubscribe("myModule")