This page provides a detailed tutorial about how to set up a custom media display.
Contents
Overview
This tutorial shows how to create and display media on the Robot’s head screen with the Intera Insight panel using:
- Uploaded Image: Load an image or gif to intera studio. During task execution, the loaded media is displayed continuously in a similar fashion to Sawyer’s eyes.
- Static source: Fetch an image or gif from a local or remote source. The loaded media is static and cannot be changed during task execution.
- Dynamic source: Fetch a video file from a string parameter that’s received from a TCP “device” connection.
Prerequisites
Uploading Image
- Confirm that no task is running, and click the Insights panel (1) in Intera Studio.
- On the Insights panel, press the pencil mark icon (2) to load a file from your PC.
- Confirm that the SET box signed with an “X”.
- Run the task.
- Now you are able to watch the image you have uploaded on the head screen.
Notes
- Only one image can be loaded at a time. If you want to change the image, please repeat section 2.
- The supported file types are only PNG & GIF (animated and still).
- The file size should be less than 85 KB.
- The recommended dimensions of the image to fit the screen are 1024x600 pixels.
Image from Static URL
Using an Image from a Remote Server (Static URL)
- Confirm that no task is running.
- Click the Insights panel (1) in Intera Studio.
- On the Insights panel, under the URL section, press the “EDIT” button (2) to edit the URL address.
- In the URL field type the URL address leading to the image.
For example: “https://upload.wikimedia.org/wikipedia/commons/a/ae/ClickSmart_6.jpg”
- Click “SAVE”.
- Confirm that the URL box signed with an “X”.
- Run the task.
- Now you are able to watch the image from the static URL on the head screen.
Notes:
- The supported file types are only PNG & GIF (animated and still).
- The recommended dimensions of the image to fit the screen are 1024x600 pixels.
Using a Video or Image from a Local Server (Static URL)
- First you should create and run a server. You can use our example for testing:
- Install node js on your computer (Windows, Linux).
- For Windows:
- in a Powershell install Chocolatey
- Use Chocolatey to install nodist and nodejs
choco install nodist nodejs -y
- For Linux:
- Install nodejs
- For Windows:
- Download archive file (link).
- Extract the archive file to a dedicated folder.
- Copy the images or videos to that same folder where the “server.js” file is located.
- Open a terminal or command prompt in the same folder as the files and the “Server.js”
- Type: “npm install” and press enter.
- Type: “node server.js” and press enter.
- Install node js on your computer (Windows, Linux).
- Confirm that the video or image are uploaded and available on the server:
- Open a new terminal or command prompt .
- Type: “ipconfig” (in windows) or “ifconfig” (in linux).
- Copy the ip address (example: “IPv4 Address: 172.20.30.90”).
- Open a browser.
- In the address type: “http://<IP address>:3005/<media filename>” - For example: “http://172.20.30.90:3005/gif1.gif”
- Now you able to watch the video or image in the browser.
- Perform all the steps in section B above.
Notes
- The supported file types are only PNG & GIF (animated and still) for images and MP4 & OGG for videos.
- The recommended dimensions of the image or video to fit the screen are 1024x600 pixels. Videos were successfully tested with 25 & 30 FPS.
Dynamic URL
Using a Video from a dynamic URL (Using TCP/IP Signals)
- First you should perform all the steps above.
IMPORTANT note: The static URL must be a video file (MP4 or OGG) and NOT an image file.
- Define a TCP/IP signal
- Confirm that no task is running.
- Click the Device Gallery (figure 1: A) in Intera Studio.
- On the Device Gallery, click the “+DEVICE” button (figure 1: B) to add a new device.
- On the Device Editor, click “TCP/IP” button.
- On the new window Device Editor, type a name for your device for example “media_server” (figure 2: A).
- In “Sawyer will” field, on the right side, click “⌄” to change to “receive connections” (figure 2: B).
- Click the “SET” button (figure 2: C).
- Click “EDIT” button for “DEFINE INPUT SIGNALS”.
- In “Start Delimiter” field, on the right side, click “⌄” to change to “semicolon” (figure 3: A).
- Type a name for your signal (figure 3: B) for example “media_link”.
- Click the “SET” button (figure 3: C).
- Create and run a TCP/IP sender.
You can download and use our example script from this link
How to run the script:
- Install python 3 on the computer
- Download and extract the script to a folder
- Execute the script.
- The script will ask you to type the IP addresses of the sawyer and the media server and their ports.
- Type the filename of a media file that you know the server have and press enter. For example: video.mp4.
- watch the sawyer change the head display to your file.
Note: In order to change the default values, open the script in a text editor and change the values in this section:
start_delimiter = ";" # Sawyer signal start delimiter
DEFAULT_SAWYER_IP = "172.20.30.188"
DEFAULT_SAWYER_PORT = "4000"
DEFAULT_SERVER_IP = "172.20.30.90"
DEFAULT_SERVER_PORT = "3007"
- The signal is coming from a TCP/IP device that can be defined by using this guide.
Notice that
- The Sawyer is set to receive connections on port 4000 by default
- The signal to Sawyer as a string has to start with a semicolon,
for example: “;http://172.20.30.90/3007/video.mp4”.
- If the connection with the signal sender is ok you will see a green dot to the right of the device name. If there is a problem, please check the following:
- The signal sender is activated.
- The correct robot IP is updated in the signal sender script.
- On the Insights panel, under the “Signal Name” section, press the “EDIT” button to edit the signal name.
- Type the signal name as you have typed in section 2.j.
- Click “SAVE”
- Run the task.
- Click Signal Name box, and confirm that it signed with an “X”.
- Now, on the head screen, you are able to watch the video sent by the signal sender.
Note:
- In this mode, when a task is started, the static URL video is the first video displayed; ensure that the first video URL signal sent through TCP/IP corresponds to the static URL.
- There are limitations on resolution and FPS (Frames-per-second) rate on the media files. The recommendation is to use 1024x600 resolution files or less and 30 FPS max rate.
- There are restrictions on media file types: The supported file types are only PNG & GIF (animated and still) for images and MP4 & OGG for videos.