A lightweight Kotlin API client for Universal Robots (Primary Interface and Dashboard Server) with coroutines support.
Install the Universal Robots API client by adding the JitPack repository and the dependency to your build.gradle file:
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
dependencies {
implementation("com.github.wolfscowl:ur-kotlin:1.0.1")
}Gradle (Groovy)
If you are using Groovy, add this to your build.gradle:repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.wolfscowl:ur-kotlin:1.0.1'
}Install the Universal Robots API client by adding the JitPack repository and the dependency to your pom.xml file:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.wolfscowl</groupId>
<artifactId>ur-kotlin</artifactId>
<version>1.0.1</version>
</dependency>The API distinguishes between Dashboard Server commands and commands sent via the Primary Interface.
- Primary Interface: Requires a persistent connection to receive Real-Time data or execute movement commands.
- Dashboard Commands: A short-lived connection is automatically established for each command.
Create an instance of the Universal Robots client by providing the robot's IP address:
val ur = UR(
host = "192.168.2.1",
// additional optional configurations...
)Connect to the Primary Interface to receive real-time data and execute movement commands.
try {
ur.connect()
} catch (e: Exception) {
println("Host is unavailable")
}Explore our detailed tutorials to master robot automation with Kotlin:
📖 1. Dashboard Server - Remote Control & Program Management: Learn how to interact with Polyscope, load installations, and automate program execution via the Dashboard Server.
📖 2. Primary Interface - Real-Time Data & Monitoring: Learn how to read live data and monitor the robot's "Digital Twin" through the Primary Interface.
📖 3. Primary Interface - Motion Control, Scripts & Procedures: Learn how to send movement commands and synchronize your code with the robot's physical actions using our state-driven procedure logic
📖 4. Primary Interface: Operating OnRobot End-Effectors: Learn how to integrate OnRobot grippers tools into your automation workflows.
The Primary Interface allows you to send URScript commands to the controller and receive Real-Time Data (at 10Hz). The commands are divided into standard Universal Robots base commands and specialized implementations for OnRobot end-effectors.
Standard motion and configuration commands for the robot arm:
The following grippers are currently supported:
| OnRobot TFG | OnRobot RG | OnRobot VG |
|---|---|---|
|
gripExt gripInt releaseExt releaseInt |
grip release |
grip release seekGrip |
The client continuously updates robot state variables and provides them as both standard properties and Kotlin Coroutine Flows. For a comprehensive list of available data fields (e.g., Joint Positions, TCP Poses, Currents), please refer to the Universal Robots Primary Interface Documentation.
The following commands are currently supported via the Dashboard Server. For a detailed description of each function, please refer to the API Documentation and Dashboard Server Documentation from Universal Robots.
- powerOn
- powerOff
- shutdown
- loadInstallation
- load
- play
- stop
- pause
- unlockProtectiveStop
- fetchRobotModel
- fetchRobotMode
- fetchSafetyStatus
- fetchSerialNumber
- fetchPolyscopeVersion
- fetchIsRunning
- fetchProgramState
- fetchLoadedProgram
UR Kotlin API Client is an open-sourced software licensed under the MIT license. This is an unofficial library, it is not affiliated with nor endorsed by Universal Robots.
I originally developed this library as the communication backbone for Vocobo — a LLM driven mobile assistance system that enables Programming by Natural Language (PNL) for Universal Robots.
I built this library because no Kotlin or Java library existed that allowed for seamless, native communication with UR Cobots. Vocobo demonstrates what is possible with this library: it bridges the "interface gap" by allowing operators to program and control the robot arm entirely through voice and touch.
-
High-Level Control: Using the Dashboard Server (Guide 1), Vocobo manages the robot's operational state—such as powering on and releasing brakes—directly from a smartphone.
-
Real-Time Telemetry: Through the Digital Twin (Guide 2), Vocobo constantly monitors the robot's status. This enables context-sensitive commands like "Lift the arm a bit higher," as the app is always aware of the current position.
-
Synchronized Workflows: Complex tasks like "Pick-and-Place" are executed via Procedures (Guide 3/4). Vocobo utilizes the library's state-driven design to detect exactly when a motion sequence is completed or if an error has occurred.
-
Hands-on Programming: The library enables a fluid workflow where a single operator can guide the robot in Free-Drive (Guide 3) and save waypoints via voice commands simultaneously, eliminating the need to go back and forth to a stationary Teach-Pendant.
![]() Dashboard: Remote state control |
![]() Manual Control via Touch |
![]() Voice interaction & LLM logic |
![]() Visualized instruction sequence |



