Vocal Interaction Tutorial
Naos are equipped with speech recognition modules. The sequence of
actions created in this module will be decided on by a vocal command
given by you, the user.
- Open Choregraphe by opening a terminal and typing choregraphe.
- Drag and drop Voice -> Choice onto the flow diagram panel. The
Choice box will allow you to select a question that the Nao will prompt
the user with, as well as specify several potential answers that the Nao
will recognize. Connect Chioce's onStart input to the main onStart.
- Double-click on the Choice box to set it up.
- In the text box in the Localized Text module, delete the current
question and enter the following question: What color should my eyes be?
- In the Choice box, set the three options to be orange, green, and blue.
- Save the project as colorchoice.
- Click on root to return to main flow diagram panel.
- One of the outputs of the Choice box is a string corresponding to
the chosen color. We want to connect this string to a Switch box. Drag
and drop a Flow Control -> Switch Case box onto the flow diagram.
- Set the switch case values to be the strings "orange", "green", and
"blue". Connect the string output of the Choice box to the input of the
Switch Case box.
- Add three LEDS -> Eyes LEDs boxes to the flow diagram panel and
connect their inputs to the outputs associated with the orange, green,
and blue strings, respectiely. Connect the output of the Choice box
corresponding to the case where the string doesn't match any of the
cases to the main onStopped output. Connect all of the Eyes LEDs
onStopped output to the main onStopped output.
- Set the Eyes LEDs to the change the eyes to each associated color by
double-clicking on each of the Eyes LEDs boxes, double-clicking on the
color square in the Color Edit box, and setting the color.
- Click on the wrench of each of Eyes LEDs boxes to set the duration to be 5 seconds.
- Connect to a Nao.
- Once connected, click play to run. Speak clearly towards the Nao. If the Nao cannot understand you, it will prompt you again.