Create a custom interface on a Universal Robot teach pendant

Did you already solve this problem?

Just edit this wiki post!

Please provide a step-by-stap solution, including all the code and other things someone else would like to know to make it work.

If you want to discuss this topic or if you have questions, reply in the comments.

Create a custom interface on a Universal Robot teach pendant (by @icorn )

In this How-to you will learn how to program a custom interface directly to the teach pendant of a Universal Robot, using their programming environment / language, URCaps.

Introduction

First of all, think if this solution is the one you want. While it is cool to have an interface directly in the pendant, it requires knowledge of Java (and/or HTML), it has lots of limitations when it comes to HTML elements (lots of them are not available to use), the debugging is not optimal and uploading the program to the robot takes around 30 seconds. If you’re sure this is the best implementation for your project, keep reading.

Basics

URCaps code is based on Java, you can either choose to work with Swing or Java+HTML. With URCaps we can create custom installation and program modules for UR cobots that do exactly what we want, and they can also act as a GUI. Please, check the official manuals to get the full information.

Swing Manual → https://plus.universal-robots.com/media/1810567/urcap_tutorial_swing.pdf
HTML Manual → https://plus.universal-robots.com/media/1810566/urcap_tutorial_html.pdf
Style Guide → https://www.universal-robots.com/media/1802558/urcaps_style_guide-v10.pdf

If you’re not sure which one to pick, the author suggests HTML for simpler applications, and Swing for more complex applications.

Development environment

The development environment for URCaps I suggest is the following:

  • If you’re working with Windows, you’ll need a Linux environment. I suggest using WSL (Windows Subsystem Linux), which you can get by installing Ubuntu from the Microsoft Store. You will need to install some dependencies which you can find inside the manual.
  • I strongly suggest to download the URSim (Simulator for the UR bot) so you can test your interface on the simulator instead of the real robot (Find a Linux simulator here: Articles | Support site | Universal Robots) You will need a Virtual Machine to work with this simulator, I suggest you to use VirtualBox.
  • Finally, for the IDE, I recommend Virtual Studio Code, which can work with WSL folders.

The project structure you will have is the same for a Java project, with a pom file inside. You can find other URCaps projects in Github that you may use as inspiration on where to start. It will probably take a while to understand the structure of the project, and how it works, but basically you’ll have, at least, an Activator, Communicator, View and Service java file.

Once you have the setup working, you can start to program your interface.

Compile and upload to the robot

Go to the root URCaps Code folder, and from there run “sudo mvn install -Premote” if you want to install it on to the robot, or “sudo mvn install -P ursimvm” if you plan to do it on the URSimulator. Keep in mind, you might need to adjust the IP addresses on the POM file, depending on where you upload it!

Credits

This how-to was written by @icorn

Fantastic @icorn! Thanks!

1 Like