ALDialog Tutorials

NAOqi Audio - Overview | API | QiChat | Tutorials


Getting started

Start with Choregraphe

Choregraphe offers a full environment enabling you to quickly create and test dialog boxes.

Follow step by step the tutorials: Creating Dialog boxes.

Go deeper with the full syntax

Once familiar with the main functions, you can add more complex rules.

For further details, see: QiChat - Syntax.

Other option: Python

Here are few sample codes in Python.

Understand hello and answer hello

#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)

Unload topic

proxy = ALProxy("ALDialog")
# deactivate topic
proxy.deactivateTopic(self.topic)
# unload topic
 proxy.unloadTopic(self.topic)
# stop dialog
proxy.unsubscribe("myModule")