3.3.9 Obtain user input through voice
< step >
< say >
Do you want to know what Nao presenter can do
< dial timeOut =
>
< answer key =
/ answer >
< answer key =
< answer key =
you
< answer key =
problem see you
</ dial >
</ step >
This tag allow the robot to wait for a vocal human answer. In this example, we first ask
to the user "do you want to know what Nao presenter can do?", then we wait for a vocal
answer from the user.The following cases can occur:
After 20 seconds (timeout attribute), we assume that the user has leave, or didn't
want to answer. In that case Nao will say the text define in onTimeOut: "I guess that
you don't want to continue":
The user says "yes" or "ok". In that case, the robot says "super, lets go", and the
variable ans is created and contains "yes" (have a look at the if command in order
to use it)
The user says "no" or "not at all". In that case, the robot replies "no problem see
you later", and the variable ans is created and contains "no" (have a look at the if
command in order to use it)
In all cases the step then terminates.
3.3.10 Conditional execution
< step >
< if condition =
< true >
< say >
</ true >
< false >
< say >
</ false >
</ if >
</ step >
The if command allows you to execute conditional instruction, depending on the value of
a variable. In this example, we check if the variable ans contains the value "yes". If this
condition is true, then the elements inside the tag true will be executed. If the condition is
false, the element inside the tag false will be executed.
This command is generally used with the jump or break commands to change the flow of
the presentation.
3.3.11 Stopping the presentation
< break / >
This command allows you to stop the presentation. It is generally used within an if tag.
3.3.12 Jumping to a specific step
< jump >
mylabel
</ jump >
" 20 "
onTimeOut =
" yes "
varName =
" ok "
varName =
" no "
varName =
later
</ answer >
" not at all "
later
" { ans }== no "
>
you said yes
</ say >
you said no
</ say >
" I guess that you don ' t want to continue "
" { ans } "
varValue =
" { ans } "
varValue =
" { ans } "
varValue =
varName =
" { ans } "
</ answer >
12
? </ say >
" yes "
>
super
,
" yes "
>
super
</ answer >
" no "
>
no problem see
varValue =
" no "
>
Nao Presenter- V2.1.7
lets go
<
no
Need help?
Do you have a question about the Nao Presenter and is the answer not in the manual?