NAO
2

Bumper trigger : which way/tool use ?

Hi,

I want to secure the behaviours launch on my NAO with autonomous life ON (2.1.0.19) .

To do that, I use feet bumper (right or left) to launch the behaviour. But in fact, there is two way to do that : - use a collaborative dialog topic with the following code : u:(e:LeftBumperPressed) ^switchFocus(monappli/Comportement1)

  • in the beaviour project properties, in "Launch Trigger Condition" with the following code : ('LeftBumperPressed' == 1) && ('Launchpad/PreviousActivity' !="monappli/Comportement1")

My question : - It's seems that with a dialog topic, the behaviour is only launch when NAO has catch somebody (blue eye), isn't it ? - if I wrote the 2 ways in my project, which way/tool is use first my the system ? Could it be a conflict or not ?

Your advice are welcome. Thanks for your support.

Fred

Answers

Hello Fred!

Launching behaviours in a robust way is still a problem and vocal commands aren't 100% reliable, especially in a loud environment.

Your solution is perfectly fine and you don't have to fear for conflicts as far as I know. When in Dialog mode (rolling blue eyes) if rules are conflicting, the Dialog engine will randomly choose between the conflicting rules.

If you want to have a consistent experience, I would suggest to add something.

First, use a bumper or any tactile surface to launch the dialog. In a new project, assign one of the bumper/tactile surface to a python box with the following piece of code:

    def onLoad(self):
        self.dialog = ALProxy("ALDialog")
        pass

    def onUnload(self):
        #put clean-up code here
        pass

    def onInput_onStart(self):
        #self.onStopped() #activate the output of the box
        self.dialog.runDialog()
        pass

    def onInput_onStop(self):
        self.onUnload() #it is recommended to reuse the clean-up as the box is stopped
        self.onStopped() #activate the output of the box

It will force the robot to enter the dialog state. Then use your collaborative dialog to launch your behaviour.

If you're in a quiet environment, you could also add a trigger sentence to the manifest of your application, or enhance your collaborative dialog with something like:

u:(launch my application) Okay! ^switchFocus(monappli/Comportement1)

Don't hesitate to ask more questions Smile

Fred

1 comment
  • 0) - Python box is python script box ?

    1) - Does "Dialog State" means "rolling blue eyes" for NAO waiting for a trigger (tactile or vocal command) ? This is why with a dialog topic, the behaviour is only launch when NAO has the rolling blue eyes), isn't it ?

    2) - Is it the "self.dialog = ALProxy("ALDialog")" code which "assign one of the bumper/tactile surface" ? How can i choose the right bumper/tactile sensor ?

    Thanks,

    Fred (too)

0) - Python box is python script box ?

Yup!

1) - Does "Dialog State" means "rolling blue eyes" for NAO waiting for a trigger (tactile or vocal command) ? This is why with a dialog topic, the behaviour is only launch when NAO has the rolling blue eyes), isn't it ?

Absolutely!

2) - Is it the "self.dialog = ALProxy("ALDialog")" code which "assign one of the bumper/tactile surface" ? How can i choose the right bumper/tactile sensor ?

No, self.dialog = ALProxy("ALDialog") only creates a proxy to the ALDialog API.

To choose the right bumper/tactile surface, you can use Choregraphe bumper boxes or tactile boxes and connect the output to the entry of the Python script box (but then you end up having to press the bumper once to launch the app, then press it again to lunch the Dialog state, which is redundant). So I've changed a little bit the way of doing things to make it lightweight, just connect the Python script box to the begining of your behavior, and add a Launch Trigger Condition like you did in the first place.

First screenshot is what my launching Dialog state application looks like.

Second screenshot is the manifest of the application.

So, now you've entered the dialog state, you can either use the bumpers to launch your app or a vocal command. It may not be exactly what you asked for in the first place, but depending on the context, you have now two ways of launching your app Smile

1 comment
  • ok. Thanks you very much for your explanation.

    Fred

Back to top