Skip to content

Pepper handling

Pepper HandlingΒΆ


To make the handling of the Pepper robot easier, we've made some classes that can be used to interact with the robot. The classes associated with the Pepper robot interaction are located in the com.example.fitbot.pepper package. To start interacting with the Pepper robot, one must assign a QiContext first. This can be done by calling Pepper.provideQiContext(QiContext context) method. This method takes a QiContext object as a parameter. This object is used to interact with the robot.

To make the robot talk, one can call the following method:

1
Pepper.say(String text);

To make the robot execute an animation, one can call the following method:

1
Pepper.animate(String animationName);

To make the robot do more sophisticated things, one can call the

1
Pepper.addToEventQueue(AbstractPepperActionEvent event);
This adds the provided event to the event queue. The event will be executed in the order it was added. Whenever there's no valid QiContext available to use, the event will maintain in the queue until one is provided.

Note All Pepper action events are added to a queue, and executed synchronously. This means that if the robot is still busy with a task, adding a new event to the queue will not do anything until the robot is done with the current task.

Currently, the only supported actions are:

  • PepperSpeechEvent - This event makes the robot say something.
  • PepperAnimationEvent - This event makes the robot execute an animation.