3

Is it possible to open/close a app installed in Nao by voice command?

Hi guys, I want to know Is it possible to open/close a app installed in Nao by voice command? Any suggestions?

Thank you!

回答

Hello!

There are two ways to launch an application using voice command: 1. simply add one or more "Trigger sentences" in your Project properties (click on the behavior.xar). When Nao understands the trigger, it will simply launch the application, therefore, it will not be in the dialog anymore, it will have switched focus to the application; 2. write a collaborative dialog by clicking on the adding button in your Project content and selecting "Create dialog topic...". A window will pop-up, select what language you want to write your dialog with, give it a name and DON'T FORGET to tick the "Add to the package content as collaborative dialog" box.

Next is an example of a very simple collaborative dialog about a calculator:

topic: ~calculator_launcher()
language: enu

u:(["launch the calculator" "let's do some maths"])
Alright! ^switchFocus(dialog_calculator/app)

u:(["can you" "do you know how to"] make sums)
Of course! ^switchFocus(dialog_calculator/app)

The ^switchFocus(path_to_behavior.xar) tells the dialog engine it now has to switch focus from the dialog to the application.

To exit your application, it's up to you! You can add some dialog inside of your app like a trigger:

u:([stop quit] the application) $onStopped=1

Once you quit the application, the robot will go back to its Life state.

1つのコメント
  • Thank you so much! However I did not work it out, I guess problem happens in app path? How can I know that? Thank you for your help again!

Sorry for the super late reply and thanks to Sarit for pointing out the fact this wasn't very clear.

You need to give the path to the behavior.xar that will start your application. If the behavior is not at the root of the project, it has to be ^switchFocus(app-UUID/path_to_folder_containing_behavior.xar). Otherwise, use ^switchFocus(app-UUID/.) and you're good to go Smile

1つのコメント
  • i cant seem to launch an application from your example any more suggestions

I am having same issue where do I find the UUID? Is it the Application ID in the properties window or is it something else?

トップに戻る