URCap - Basics
This article is aimed at URCap Developers.
/Develop a URCap
At Universal Robots, one of the most important values for us is to democratize robotic automation.
One of the best ways to do that, is to enable any user of a Universal Robot to program their own application.
That means programming should be easy going, accessible and understandable even to a user with no or very little experience in programming and robotics.
The aim of our PolyScope graphical programming interface is just that, to provide easy programming to any user. No matter the task.
And this is right where you fit in! Creating a URCap is YOUR way to expand or enhance what PolyScope can do.
You can help make easy programming accessible to all, by being able to create your own program commands and setup screens, that allow users to configure external hardware, or perform new complex routines, but without all the complex programming.
Universal Robots + you = easy programming for anyone!
Universal Robots + your product = the solution!
In this article, we aim to give you an insight into a) what is a URCap, b) what can a URCap do, c) how to get started developing your first URCap.
But first of all, say hello to PolyScope!
This is PolyScope, the graphical programming interface of Universal Robots.
When the robot starts, the user has the choice to run an existing program, create or modify a program, or configure the installation / environment settings of the robot.
If the user decides to go to the programming section, a number of built-in and URCap program nodes are available for the user, to define a program.
In this case, the robot starts at Waypoint 1, then moves to Waypoint 2 where it waits for 1,5 second. After that delay, it moves to Waypoint 3 if the digital input 0 is high, or Waypoint 4 otherwise. Following that, the program repeats itself.
If the user decides to go the the Installation menu, all installation nodes are listed. This includes configuring the robot mounting (i.e. what is the direction of gravity), the Fieldbus communication interfaces, or Features aka. coordinate systems the robot can move relative to.
/What is a URCap?
A URCap is a Java-based plugin, that integrates in to PolyScope, the graphical programming interface of Universal Robots.
URCaps can be used to extend the functionality of PolyScope, i.e. by creating new friendly programming screens, the user can use to configure your hardware, or creating new programming templates, such as for packaging, or remote management operations.
This is an example of two instances of the Pick Or Place URCap. This URCap is already an example contained in the SDK.
In the first node, "Pick", the Pick Or Place program node have been set to a picking sequence. The program node then creates a sub-tree of program nodes, that are relevant to a picking operation, including a Gripper Close operation.
The second instance of the node is not yet configured, and the user has yet to decide, if this node should be a Pick or a Place node.
The user interface of the Pick Or Place node, and the sub-tree what this URCap is adding to PolyScope.
/What can a URCap do?
The main contributions of a URCap is a setup screen (Installation Node) and numerous program commands (Program Nodes), that the user can use side-by-side with built-in UR nodes, to configure the robot program and application. In general, the Installation Nodes are used for configuring the general settings, and the application environment, such as the end-effector, conveyors, coordinate systems etc. Whereas the program nodes are used to execute particular commands, at a given time or flow in a program sequence. E.g. moving to a particular position, closing a gripper, and moving away with the gripped object.
From a high-level perspective, a URCap can:
- Contribute a new Installation Node to PolyScope
- Contribute one or more Program Nodes to PolyScope
- Contribute a Toolbar to PolyScope (from PolyScope 5.0)
- Contribute a daemon process (background executable)
- Build program templates (using URCap and built-in program nodes)
- Add new Variables to a PolyScope program
- Add Script Functions to the Expression Editor of PolyScope (advanced users)
Now all this may sound a bit abstract, so here are some examples, that are all enclosed in the URCaps SDK or can be found within this UR+ Developer Forum.
This URCap is formally known as the Manipulate IO URCap sample, however it portrays a URCap that in an easy way enable you to operate a gripper or similar end-effector using a simple user interface from a URCap. The user has two radio-buttons used to select the desired operation of the gripper node (open or close), and is given two large buttons, to open or close this gripper, for testing or programming purposes. As well, the URCap shows some status information about the gripper, such as the open/closed/error status, and the open width based on an analog input measurement. If making a URCap for a gripper, this is definitely a good sample to check out.
Above is the UR3 Screw Driving URCap. This is a neat little tool, that takes a few user parameters such as the desired number of rotations, torque etc. and makes the UR3 robot rotate its infinite-rotation capable tool flange (wrist joint) until these parameters are met. A very simple way for the user, to configure the program just using a number of easily understandable parameters, while all the script coding to acheive this behavior is hidden away inside the URCap.
Above example shows the MyToolbar URCap from the URCaps SDK.
It creates a Toolbar in the top-right corner of PolyScope, that can be accessed from everywhere the user is in PolyScope.
A toolbar is great for controlling external hardware, such as a gripper or a linear pedestal directly from PolyScope. It can also be used to show KPI or status information to the operator of the robot in a nice graph or chart.
In this example, the Idle Time URCap counts the combined time the program spends waiting, through the sub-tree. This value can be stored in a Variable, which is chosen by the user. Either by selecting an existing Variable, or by creating a new one in the program.
The URCap checks all child nodes, and collects the wait time duration, in this case 4,5 seconds of delay.
This could functionality could also be used, to create other variable types, that show information about robot performance or similar.
The above URCap installs a daemon service in the background. Namely this is a Python script, that runs directly on the UR Controller. In this case, the daemon offers getting the "system time" to PolyScope, that can be accessed using XML-RPC at runtime. The functions that are accessible over XML-RPC are in this case offered to the user in the Script Functions list in the Expression Editor.
However one could imagine that this daemon in fact could be used for so much more, such as communication with external hardware, performance tacking or whatever you want to run in a daemon in the background.
/How to get started with development?
The Universal Robots+ Developer Community is a great place to start, and that's where we are right now.
Below you will find the next steps. Many articles on this site, will guide you to the next natural step to take, in order to complete your URCap development.
We would recommend you to start, by reading the article UR Software Architecture, listed below.
From this article, you will be guided on a quest to understand first the operation and principle of URCaps.
Following this, a video tutorial series will take you even further. But start with the fundamentals.
You will also be familiar with the URCaps Starter Package, which is a virtual development tool that you can use in your development.
Important to note, you can also find the UR+ Developer Forum, where you can share your work and ideas, or find help from or support developers like yourself.
No matter what issue or holdup you run into along the path of development, you are not alone, and the rest of us are here to help you in the forum.
/Check out Universal Robots Academy
The better you know the Universal Robots programming interface, the better URCaps you can make.
Users expect that your URCap, will have the same look-and-feel as PolyScope, and that buttons, tabs and icons work in the same way.
To better understand PolyScope, you can complete our FREE online training platform UR Academy.
UR Academy will in record time grant you an important insight into what scenarios the user of PolyScope and your URCap are facing.
Go to Universal Robots Academy, to get familiar with PolyScope.
/FAQ
Q: What programming languages are URCaps based on?
A: Java, JDK 6 to be exact. But you may also need a bit of URScript, which is the proprietary scripting language of Universal Robots.
Q: Why should I develop a URCap?
A: For a product to qualify for a Universal Robots+ Certification, there is most likely a need for a URCap to aid the user in configuring the product, and easing programming. But you could also create a URCap just for yourself or your own production, as they are the most powerful tool in the toolbox, and gives you full access to any feature of PolyScope and the UR Controller. In this way, that can also be used to create "blackboxes", that gives the operator an easy interface to configure the robot from.
Q: What products on Universal Robots+ require a URCap?
A: Take a look at the article What is a UR+ product?