URCap - API Overview
This article is aimed at URCap Developers.
URCap API Overview
The URCap API provides a set of features to a URCap installed with the robot.
This article will provide an overview of the functionality provided by the API by topic.
For a complete reference of the API, please refer to the API Reference (Javadoc).
The "core" of the API is the Contributions.
The Contributions are new services, that can be added to PolyScope, to provide a user with a more rich functionality.
There are 4 types of generic contributions:
- Installation Node
An Installation Node is an extension to the Installation domain of the robot.
From here, the URCap can provide a user interface and add functionality to configure "environment settings". - Program Node
A Program Node is an extension to the Program domain of the robot.
Here, the URCap can provide new programming concepts to the program flow of the robot.
The Program Node includes a user interface and adds URScript code to the overall program. - Toolbar
A Toolbar is an extension to the general robot user interface.
The Toolbar provides a user interface which is accessible from anywhere in PolyScope, making it useful to show status information or control external equipment independent from robot state. - Daemon
A Daemon is a headless extension, which enables a URCap to execute a runnable service in the OS of the robot.
I.e. this could be a Python or C++ service, that facilitates communication with an external device in real-time.
The three user interface extending generic types (Installation, Program and Toolbar) has access to a number of features in the URCap API.
The API provided to these types of nodes is generally referred to as Domain API, as it provides access to the domain particulars and logic of the robot.
/API provided by Contribution type
The general API provided to the generic node types is referred to as the Domain API.
However not all functionality in this API makes sense to all node types at any given time.
Therefore, the Domain API is provided to the consuming URCap node in reasonable API sub-types.
There are 3 "base" API's based on the Domain API:
- Application API
Provides access to API relevant to robot or application specific functionality.
I.e. the I/O's of the robot, the program variables or coordinate systems (Features). - User Interface API
Provides access to API relevant when interacting with the user in the UI.
I.e. creating keyboards, or asking the user to define a position. - System API
Provides access to API containing system information about the robot.
I.e. the serial number, software version or system language.
Installation Nodes and Program Nodes are due to their context in the robot program entitled to special API features, which grant functionality that only makes sense to use from within the Installation or Program domain. These API's are:
- Installation API
An extension of the Application API, includes special functionality available to Installation Nodes.
I.e. creating TCP's. - Program API
An extension of the Application API, includes special functionality available to Program Nodes.
I.e. building program node templates.
As both the Installation and Program API are extensions of the Application API, they individually provide access to all features of the Application API, with the addition of the special features relevant for this type of node.
The access to these API's are given in "Provider"-objects specific to the node type.
I.e. an Installation Node will receive an "InstallationAPIProvider"-object, which provides access to API relevant to Installation Nodes.
The InstallationAPIProvider is passed to the Installation Node in the "createInstallationNode()" method in the SwingInstallationNodeService-class.
From there, the Provider should be passed into the newly created Installation Node upon construction.
//Constructor of My Installation Node
public MyInstallationNode(InstallationAPIProvider apiProvider, ...) {
InstallationAPI installationAPI = apiProvider.getInstallationAPI();
UserInterfaceAPI uiAPI = apiProvder.getUserInterfaceAPI();
SystemAPI systemAPI = apiProvider.getSystemAPI();
}
/Overview of API functionality
Below is a simple overview of the functionality provided by the URCaps API.