Search code examples
nao-robot

How can i read a voice input in a dialog? QiChat


There's some way that i can possibly read a voice recognition from the dialog in nao ?

For example:

proposal: What is your name
    u1:(John Doe) ["Hey John Doe, how are you doing"]
    u1:(anything) ["Sorry, i cant hear you, please repeat"] ^previousProposal

What i want is, how can i set the part (John Doe) to a dynamic input given by the user. There's some variable that i can create or a predefined variable for inputs by the user?


Solution

  • you can do that using $.

    Here are some example from this documentation

    Input selection as variable:

    u:(my name is _[david robert]) your name is $1
    

    Assign a variable:

    u:(my name is david) i store your name $name=david
    

    Condition

    u:(is my name david) [“$name==david yes” “no it is $name”]