Pepper: disable events temporally

267 views Asked by At

I'm programming a Pepper app with Choregraphe to make a conversation. This conversations have some different sorted states:

  1. Hello (start of conversation)
  2. ask for information
  3. Specify the information
  4. Goodbye (end of the conversation)

To start a conversation, people have to get close to the robot and the robot has to detect a face.

The problem is that if I am in middle of the conversation and the robot detect another face, it starts the conversation at the beginning. So I need to disable the event temporally, while the robot is in a conversation. Is there a way to do it?

These are the events output of Choregraphe:

These are the events output of Choregraphe

3

There are 3 answers

0
Albert Lazaro de Lara On BEST ANSWER

At the end I visit this part of documentation and looked at Engagement Modes.

To allow a wider range of behaviors, ALBasicAwareness provides 3 engagement modes that specify how “focused” the robot is on the engaged person.

“Unengaged”: (Default mode) when the robot is engaged with a user, it can be distracted by any stimulus, and engage with another person.

“FullyEngaged”: as soon as the robot is engaged with a person, it stops listening to stimuli and stays engaged with the same person. If it loses the engaged person, it will listen to stimuli again and may engage with a different person.

“SemiEngaged”: when the robot is engaged with a person, it keeps listening to the stimuli, and if it gets a stimulus, it will look in its direction, but it will always go back to the person it is engaged with. If it loses the person, it will listen to stimuli again and may engage with a different person.

I have used FullyEngaged and the robot only focuses on the first person that enter the robot Zone 1.

This is done like this:

basic_awareness = ALProxy("ALBasicAwareness", ip_robot, port_robot)
basic_awareness.setEngagementMode("FullyEngaged")
basic_awareness.startAwareness()
4
JLS On

you cannot disable them on that format, but if you use the "subscribe to event" box, there are start/stop inputs that you can use to enable/disable the box, i.e. subscribe/unsubscribe to the events.

1
Alexandre Mazel On

At your place, I would program it as a finite state machine: you decide your detection and the way to switch from one state to another, in a simple way. Each processing of one state is stopped when you change state.

You can download a simple state machine here: http://protolab.aldebaran.com/public/the_3_templates.zip