ST Solutions Australia

©Copyright ST Solutions Australia. All rights reserved.

22 May 2017

Please reload

Latest Articles

Pepper Tutorial <5>: Tablet

In this tutorial, we will explain how to control the tablet through the manipulation of boxes.

 

Note that the tablet behaviour cannot be simulated on the virtual robot, but we will explain how to check what is written inside the box with Python programming code to explain what the box is actually doing.

 

 

 

Project files pane

 

To display intended contents on the tablet, they must be imported into the project in advance. This is done on the “Project files” pane.

 

 

1. Project files: list of files that are included in the project. Files can be sorted into a hierarchical structure by creating directories, and can be moved around with drag and drop.

 

2. Add file/directory button: add elements to the project file. A dropdown menu appears when clicked.

  • Create directory…

  • Create behavior…

  • Create dialog topic…

  • Create planar move…

  • Import behavior…

  • Import files…

  • Import folder…

3. Remove selection button: remove the selected file/directory from the project.

 

To output contents on the tablet, html directory must be created which holds all the files to be displayed. Once the directory is created, files can be referenced by boxes through the html directory path.

 

 

 

Displaying contents

 

 

Output pictures:

 

Let’s start with displaying an image on Pepper’s tablet. Please prepare an appropriate picture in either .PNG, .JPEG, or .GIF file format to be used.

 

 

1. Prepare boxes. Drag & drop following box from the Box libraries onto the flow diagram.

               Multimedia > Tablet > Show Image

 

 

2. Connect the box

 

3. Create html directory

 

Go to the “Project files” pane, click the + button and select [Create directory…].

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Set the directory name as “html” and click [Create].

 

New directory “html” is now created as a project file.

 

 

4. Import an image file

 

On “Project files” pane, click the + button again and this time select [Import files…]. Select and open the image to be displayed on the tablet.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Drag and drop the imported file to move it into the html directory.

It is now ready to be displayed on the tablet.

 

 

5. Click on the parameter button on “Show Image” box and enter the file name into “ImageUrl” parameter then click [OK].

 

 

 

Now the application is ready to be initiated. To check the operation, please connect to Pepper and run the application.

When you try to run it on the virtual robot, the “Show Image” box turns red and error messages that look something like this show up on the Log viewer pane:

 

 

Output videos:

 

Video files can also be displayed on the tablet just like the image files. Supported file formats are .mp4 and .mov.

 

 

1. Prepare boxes. Drag & drop following box from the Box libraries onto the flow diagram.

               Multimedia > Video > Play Video

 

2. Connect the box

 

This ends the behaviour as the video stops playing.

 

 

3. Create html directory and import the video file.

 

Then move the video file into the html directory just like how we did for the image file previously.

 

 

4. Set the Video Path parameter for the “Play Video” box.

 

 

Now the application is ready to be initiated. To check the operation, please connect to Pepper and run the application.

 

 

“Play Video” box has two other inputs “onPauseVideo” and “onResumeVideo”, which enables users to edit when to start or pause the video. For example, you can modify it so that the video starts only when Pepper detects that someone is standing in front, and stops the video when there’s no one around.

 

 

 

Using Touch Detection

 

Touch on the screen can also be processed with the tablet. In this tutorial, we will make Pepper say “Yes” when the tablet screen detects the touch.

 

 

1. Prepare boxes

  • Sensing > Touch > Tablet Touch

  • Speech > Creation > Say

 

2. Connect boxes

 

3. Set parameters

 

For the “Touch Detection” box, set the Action parameter as [On touch down].

 

 

4. Customise “Say” box

 

Open the parameter box of Say and modify the text to “Yes”.

 

 

Now the application is ready to be initiated. To check the operation, please connect to Pepper and run the application. Try touching the tablet and if Pepper says “Yes” then the application is running successfully.

 

onTouched output sends the information of the touch coordinates. It is possible to change Pepper’s motions depending on where on the tablet is touched.

 

Tablet is one of the most important elements which helps Pepper to exhibit information to the users. You can do many other things using the tablet.

Share on Facebook
Share on Twitter
Please reload

Please reload

Tags

Please reload

Archive