Working with the PolyScope X Simulator

The PolyScope X Simulator allows for an offline simulation and programming of robot programs. This documentation is covering the use of the Simulator inside the PolyScope X SDK.

Starting the Simulator

Prerequisites

In order to be able to start up and use the PolyScope X Simulator, the steps inside the Setup Chapter needs to be fulfilled. Make sure your IDE is opened inside the development container.

Options running the PolyScope X Simulator

The basic command for starting the simulator is the following:

./run-simulator

It is then exposed on localhost at port 80 and can be accessed by using the Chrome browser.

Set a custom port

As already mentioned in the Setup Chapter the default port 80 is often blocked by IT. It is recommended to define a specific port using the --port parameter, as shown below:

./run-simulator --port 45000

PolyScope X Simulator running in Chrome PolyScope X Simulator running in Chrome

Chose the robot type

By using the --robotType parameter the robot type the simulator runs can be specified. The choices are:

  • UR3

  • UR5

  • UR10

  • UR16

  • UR20

  • UR30

./run-simulator --robotType UR20

If nothing has been specified the default robot type in the simulator is the UR5

Remove existing Programs and Applications

To remove existing programs and applications present on the simulator the --clear-applications parameter is used. This leaves the simulator only with a fresh default application and default program.

Reset to the default state

In case there are problems starting up the simulator or other issues, it can be started using the --reset parameter. This rebuilds the container to provide a simulator in the default state again. The applications and programs will not be removed and are still available after a reset.

Working with the Simulator

How to export a Program

The programs developed with the PolyScope X Simulator can be directly exported to the host file system. To do do so access the System Manager through the menu on top left.

Accessing the System Manager
Accessing the System Manager

There a list of the available programs can be found. Pressing the icon to the very right next to the saving symbol opens up an additional menu.

Export PolyScope X Program
Export PolyScope X Program

By selecting Export a file explorer window is opened allowing to save the program on the hosts file system.

Save exported PolyScope X Program
Save exported PolyScope X Program

How to import a Program

The following steps show how an already existing PolyScope X program can be imported into the PolyScope X Simulator. First the System Manager needs to be opened by clicking on the menu icon in the top left of the screen.

Accessing the System Manager
Accessing the System Manager

Clicking the + New icon allows the user to either create a completely new program or to import an already existing one.

Import PolyScope X Program
Import PolyScope X Program

After selecting Import Program a file explorer window opens to select the program, which should be imported.

Save exported PolyScope X Program
Save exported PolyScope X Program

How to install a URCap

There are two different options to install a URCap on the PolyScope X Simulator.

URCap installation from the development container

During the URCap development most often the URCap will be installed directly through the development container. For this the IDE needs to be opened inside the development container. With the terminal navigate into the root folder of the URCap - project, which should be installed on the simulator.

psxdev@<containerID>:/workspace/polyscopex-x.xx.xx/<myURCapProject>$ 

Before a URCap can be installed the correspondent project needs to be installed once:

npm install

and built:

npm run build

Once the URCap was built it can be installed with:

npm run install-urcap [-- --host <HOST_IP>] [-- --port <PORT>] [-- --force-replace]

Tip

If the PolyScope X Simulator has been started with a custom port (i.e. 45000), this information needs to be added to the command.

npm run install-urcap -- --port 45000

The terminal output should then look similar to the screenshot below:

Terminal output after successful installation Terminal output after successful installation

Further options

For the installation of a URCap next to the port the two further parameters can be specified:

  • –host <HOST_IP>: Should the URCap not be installed on the running simulator a dedicated IP-address can be specified.

  • –force-replace: To completely remove the previously installed URCap, including any persistent data, this parameter shall be used.

Should a URCap just be deleted a dedicated command can be used:

npm run delete-urcap <VENDOR_ID> <URCAP_ID> [-- --host <HOST_IP>] [-- --port]

Tip

If you are inside the /workspace/polyscopex-x.xx.xx/ folder, you will also be able to ‘just’ run npm run delete-urcap [– –host <HOST_IP>] [– –port]. Since the command able to infer the VENDOR_ID and URCAP_ID from the directory and project.

Next to the command delete-urcap also the correspondent Vendor and URCap ID need to be specified. Those can be found in the manifest.yaml file of the URCap Project

Manifest.yaml file
Manifest.yaml file

URCap installation through the System Manager

As an alternative an already existing .urcapx file can be installed directly through the System Manager. This can be done via a few simple steps:

Accessing the System Manager
Accessing the System Manager

After accessing the System Manager a URCap can be installed via New and Install URCap

Install URCap
Install URCap

Then the URCap to be installed needs to be selected.

Install URCap
Select URCap from file explorer

And in the final step the installation is started and the Simulator page will refresh.

Install URCap
Start the URCap installation

Troubleshooting

ECONNREFUSED: In case the URCap installation fails, and it states ECONNREFUSED in the error messages details, most likely the Simulator cannot be reached.

Terminal Output - Error installing a URCap
Terminal Output - Error installing a URCap

  • Is the PolyScope X Simulator running?

  • Is the (correct) port number provided?

  • If necessary, is the Host IP provided and correct?

An error occurred: Should the installation of a URCap through the System Manager fail the following error code is displayed:

Error Popup while installing a URCap
Error Popup while installing a URCap

Make sure the selected URCap is not already installed on the Simulator. Opposite to the installation through the development container, the URCap needs to uninstalled first, before its new version can be installed.

Known Limitations

Communication with external devices through the Simulator is currently not supported. This topic is worked on at the moment and will be featured in a future release.