|
| 1 | +# Universal Robots RTDE Data Reference |
| 2 | + |
| 3 | +This document lists all data available from the RTDE driver and how to access it using JSONPath expressions in the Edge Agent ConfigDB. |
| 4 | + |
| 5 | +## Driver Addresses |
| 6 | + |
| 7 | +The driver publishes data to the following addresses: |
| 8 | + |
| 9 | +| Address | Description | |
| 10 | +|---------|-------------| |
| 11 | +| `json/state` | Complete robot state (all sections combined) | |
| 12 | +| `json/jointData` | Joint-specific data for all 6 joints | |
| 13 | +| `json/cartesianInfo` | Tool Center Point (TCP) position and orientation | |
| 14 | +| `json/robotModeData` | Robot operational mode and status | |
| 15 | +| `json/toolData` | Tool flange I/O and power data | |
| 16 | +| `json/masterboardData` | Master board I/O and safety information | |
| 17 | +| `json/forceModeFrame` | Force mode configuration | |
| 18 | +| `json/additionalInfo` | Additional robot information | |
| 19 | +| `json/toolCommunicationInfo` | Tool communication settings | |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Joint Data (`json/jointData`) |
| 24 | + |
| 25 | +Array of 6 objects (one per joint: Base, Shoulder, Elbow, Wrist1, Wrist2, Wrist3) |
| 26 | + |
| 27 | +| JSONPath | Data Type | Unit | Description | |
| 28 | +|----------|-----------|------|-------------| |
| 29 | +| `$[0].positionActual` | Float | radians | Base joint actual position | |
| 30 | +| `$[0].positionTarget` | Float | radians | Base joint target position | |
| 31 | +| `$[0].velocityActual` | Float | rad/s | Base joint actual velocity | |
| 32 | +| `$[0].currentActual` | Float | A | Base joint actual current | |
| 33 | +| `$[0].voltageActual` | Float | V | Base joint actual voltage | |
| 34 | +| `$[0].motorTemperature` | Float | °C | Base joint motor temperature | |
| 35 | +| `$[0].controlCurrent` | Float | A | Base joint control current | |
| 36 | +| `$[0].mode` | Integer | - | Base joint control mode (see modes below) | |
| 37 | + |
| 38 | +**Note:** Replace `[0]` with `[1]` through `[5]` for Shoulder, Elbow, Wrist1, Wrist2, and Wrist3 joints respectively. |
| 39 | + |
| 40 | +### Joint Control Modes |
| 41 | +- `236`: Position control |
| 42 | +- `237`: Velocity control |
| 43 | +- `238`: Force control |
| 44 | +- `239`: Torque control |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Cartesian Information (`json/cartesianInfo`) |
| 49 | + |
| 50 | +Tool Center Point (TCP) position and orientation |
| 51 | + |
| 52 | +| JSONPath | Data Type | Unit | Description | |
| 53 | +|----------|-----------|------|-------------| |
| 54 | +| `$.toolVectorX` | Float | m | TCP X position in base coordinate system | |
| 55 | +| `$.toolVectorY` | Float | m | TCP Y position in base coordinate system | |
| 56 | +| `$.toolVectorZ` | Float | m | TCP Z position in base coordinate system | |
| 57 | +| `$.toolVectorRX` | Float | radians | TCP rotation around X axis | |
| 58 | +| `$.toolVectorRY` | Float | radians | TCP rotation around Y axis | |
| 59 | +| `$.toolVectorRZ` | Float | radians | TCP rotation around Z axis | |
| 60 | +| `$.tcpSpeedActual` | Float | m/s | Actual TCP speed | |
| 61 | +| `$.tcpForce` | Float | N | TCP force magnitude | |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Robot Mode Data (`json/robotModeData`) |
| 66 | + |
| 67 | +Robot operational state and status flags |
| 68 | + |
| 69 | +| JSONPath | Data Type | Unit | Description | |
| 70 | +|----------|-----------|------|-------------| |
| 71 | +| `$.timestamp` | Integer | µs | Robot timestamp (microseconds) - **DO NOT USE** | |
| 72 | +| `$.isRobotConnected` | Boolean | - | Robot connected to controller | |
| 73 | +| `$.isRealRobotEnabled` | Boolean | - | Real robot mode enabled (not simulation) | |
| 74 | +| `$.isPowerOnRobot` | Boolean | - | Power supply to robot is on | |
| 75 | +| `$.isEmergencyStopPressed` | Boolean | - | Emergency stop button pressed | |
| 76 | +| `$.isProtectiveStopActive` | Boolean | - | Protective stop active | |
| 77 | +| `$.isProgramRunning` | Boolean | - | UR program currently running | |
| 78 | +| `$.isProgramPaused` | Boolean | - | UR program paused | |
| 79 | +| `$.robotMode` | Integer | - | Robot operational mode (see modes below) | |
| 80 | +| `$.controlMode` | Integer | - | Control interface in use (see control modes below) | |
| 81 | +| `$.targetSpeedFraction` | Float | 0-1 | Target speed as fraction of maximum | |
| 82 | +| `$.speedScaling` | Float | 0-1 | Current speed scaling factor | |
| 83 | +| `$.targetSpeedFractionLimit` | Float | 0-1 | Maximum allowed target speed fraction | |
| 84 | + |
| 85 | +### Robot Modes |
| 86 | +- `-1`: ROBOT_MODE_DISCONNECTED |
| 87 | +- `0`: ROBOT_MODE_CONFIRM_SAFETY |
| 88 | +- `1`: ROBOT_MODE_BOOTING |
| 89 | +- `2`: ROBOT_MODE_POWER_OFF |
| 90 | +- `3`: ROBOT_MODE_POWER_ON |
| 91 | +- `4`: ROBOT_MODE_IDLE |
| 92 | +- `5`: ROBOT_MODE_BACKDRIVE |
| 93 | +- `6`: ROBOT_MODE_RUNNING |
| 94 | +- `7`: ROBOT_MODE_UPDATING_FIRMWARE |
| 95 | + |
| 96 | +### Control Modes |
| 97 | +- `0`: CONTROL_MODE_TEACH |
| 98 | +- `1`: CONTROL_MODE_FREEDRIVE |
| 99 | +- `2`: CONTROL_MODE_REMOTE (RTDE/URScript control) |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## Tool Data (`json/toolData`) |
| 104 | + |
| 105 | +Tool flange digital I/O and power supply |
| 106 | + |
| 107 | +| JSONPath | Data Type | Unit | Description | |
| 108 | +|----------|-----------|------|-------------| |
| 109 | +| `$.analogInputRange0` | Integer | - | Analog input 0 range setting | |
| 110 | +| `$.analogInputRange1` | Integer | - | Analog input 1 range setting | |
| 111 | +| `$.analogInput0` | Float | V or A | Analog input 0 value | |
| 112 | +| `$.analogInput1` | Float | V or A | Analog input 1 value | |
| 113 | +| `$.toolVoltage48V` | Float | V | 48V tool supply voltage | |
| 114 | +| `$.toolOutputVoltage` | Integer | V | Tool output voltage setting | |
| 115 | +| `$.toolCurrent` | Float | A | Tool current consumption | |
| 116 | +| `$.toolTemperature` | Float | °C | Tool temperature | |
| 117 | +| `$.toolOutputCurrent` | Float | A | Tool output current | |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## Master Board Data (`json/masterboardData`) |
| 122 | + |
| 123 | +Controller board I/O and safety information |
| 124 | + |
| 125 | +| JSONPath | Data Type | Unit | Description | |
| 126 | +|----------|-----------|------|-------------| |
| 127 | +| `$.digitalInputBits` | Integer | bitmask | Digital inputs state (bits 0-17) | |
| 128 | +| `$.digitalOutputBits` | Integer | bitmask | Digital outputs state (bits 0-17) | |
| 129 | +| `$.analogInputRange0` | Integer | - | Analog input 0 range | |
| 130 | +| `$.analogInputRange1` | Integer | - | Analog input 1 range | |
| 131 | +| `$.analogInput0` | Float | V or A | Analog input 0 value | |
| 132 | +| `$.analogInput1` | Float | V or A | Analog input 1 value | |
| 133 | +| `$.analogOutputDomain0` | Integer | - | Analog output 0 domain | |
| 134 | +| `$.analogOutputDomain1` | Integer | - | Analog output 1 domain | |
| 135 | +| `$.analogOutput0` | Float | V or A | Analog output 0 value | |
| 136 | +| `$.analogOutput1` | Float | V or A | Analog output 1 value | |
| 137 | +| `$.masterBoardTemperature` | Float | °C | Controller board temperature | |
| 138 | +| `$.robotVoltage48V` | Float | V | 48V robot supply voltage | |
| 139 | +| `$.robotCurrent` | Float | A | Total robot current consumption | |
| 140 | +| `$.masterIOCurrent` | Float | A | Master board I/O current | |
| 141 | +| `$.safetyMode` | Integer | - | Safety system mode (see safety modes below) | |
| 142 | +| `$.inReducedMode` | Integer | - | Robot in reduced mode (0=normal, 1=reduced) | |
| 143 | + |
| 144 | +### Safety Modes |
| 145 | +- `1`: NORMAL |
| 146 | +- `2`: REDUCED |
| 147 | +- `3`: PROTECTIVE_STOP |
| 148 | +- `4`: RECOVERY |
| 149 | +- `5`: SAFEGUARD_STOP |
| 150 | +- `6`: SYSTEM_EMERGENCY_STOP |
| 151 | +- `7`: ROBOT_EMERGENCY_STOP |
| 152 | +- `8`: VIOLATION |
| 153 | +- `9`: FAULT |
| 154 | + |
| 155 | +### Digital I/O Bit Positions |
| 156 | +- Bits 0-7: Configurable digital inputs |
| 157 | +- Bits 8-9: Tool digital inputs |
| 158 | +- Bits 10-17: Configurable digital outputs |
| 159 | + |
| 160 | +--- |
| 161 | + |
| 162 | +## Force Mode Frame (`json/forceModeFrame`) |
| 163 | + |
| 164 | +Active force mode configuration |
| 165 | + |
| 166 | +| JSONPath | Data Type | Unit | Description | |
| 167 | +|----------|-----------|------|-------------| |
| 168 | +| `$.x` | Float | m | Force frame X position | |
| 169 | +| `$.y` | Float | m | Force frame Y position | |
| 170 | +| `$.z` | Float | m | Force frame Z position | |
| 171 | +| `$.rx` | Float | radians | Force frame rotation X | |
| 172 | +| `$.ry` | Float | radians | Force frame rotation Y | |
| 173 | +| `$.rz` | Float | radians | Force frame rotation Z | |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +## Additional Info (`json/additionalInfo`) |
| 178 | + |
| 179 | +| JSONPath | Data Type | Unit | Description | |
| 180 | +|----------|-----------|------|-------------| |
| 181 | +| `$.freedriveButtonPressed` | Boolean | - | Freedrive button currently pressed | |
| 182 | +| `$.freedriveButtonEnabled` | Boolean | - | Freedrive button enabled in safety config | |
| 183 | + |
| 184 | +--- |
| 185 | + |
| 186 | +## Tool Communication Info (`json/toolCommunicationInfo`) |
| 187 | + |
| 188 | +| JSONPath | Data Type | Unit | Description | |
| 189 | +|----------|-----------|------|-------------| |
| 190 | +| `$.toolCommunicationIsEnabled` | Boolean | - | Tool communication enabled | |
| 191 | +| `$.baudRate` | Integer | baud | Tool communication baud rate | |
| 192 | +| `$.parity` | Integer | - | Parity setting (0=none, 1=odd, 2=even) | |
| 193 | +| `$.stopBits` | Integer | - | Stop bits (1 or 2) | |
| 194 | +| `$.rxIdleChars` | Float | - | RX idle characters | |
| 195 | +| `$.txIdleChars` | Float | - | TX idle characters | |
| 196 | + |
| 197 | +--- |
| 198 | + |
| 199 | +## Complete State (`json/state`) |
| 200 | + |
| 201 | +All the above data combined in a single object. Use the same JSONPaths but without the address prefix. |
| 202 | + |
| 203 | +Example: To get base joint position from complete state: |
| 204 | +- Address: `json/state` |
| 205 | +- Path: `$.jointData[0].positionActual` |
| 206 | + |
| 207 | +--- |
| 208 | + |
| 209 | +## Usage Examples |
| 210 | + |
| 211 | +### Example 1: Base Joint Position |
| 212 | +```json |
| 213 | +{ |
| 214 | + "Address": "json/jointData", |
| 215 | + "Path": "$[0].positionActual", |
| 216 | + "Sparkplug_Type": "Float", |
| 217 | + "Eng_Unit": "rad", |
| 218 | + "Eng_Low": -6.2832, |
| 219 | + "Eng_High": 6.2832 |
| 220 | +} |
| 221 | +``` |
| 222 | + |
| 223 | +### Example 2: TCP X Position |
| 224 | +```json |
| 225 | +{ |
| 226 | + "Address": "json/cartesianInfo", |
| 227 | + "Path": "$.toolVectorX", |
| 228 | + "Sparkplug_Type": "Float", |
| 229 | + "Eng_Unit": "m" |
| 230 | +} |
| 231 | +``` |
| 232 | + |
| 233 | +### Example 3: Emergency Stop Status |
| 234 | +```json |
| 235 | +{ |
| 236 | + "Address": "json/robotModeData", |
| 237 | + "Path": "$.isEmergencyStopPressed", |
| 238 | + "Sparkplug_Type": "Boolean" |
| 239 | +} |
| 240 | +``` |
| 241 | + |
| 242 | +### Example 4: Robot Mode |
| 243 | +```json |
| 244 | +{ |
| 245 | + "Address": "json/robotModeData", |
| 246 | + "Path": "$.robotMode", |
| 247 | + "Sparkplug_Type": "Int32" |
| 248 | +} |
| 249 | +``` |
| 250 | + |
| 251 | +### Example 5: Tool Temperature |
| 252 | +```json |
| 253 | +{ |
| 254 | + "Address": "json/toolData", |
| 255 | + "Path": "$.toolTemperature", |
| 256 | + "Sparkplug_Type": "Float", |
| 257 | + "Eng_Unit": "°C" |
| 258 | +} |
| 259 | +``` |
| 260 | + |
| 261 | +--- |
| 262 | + |
| 263 | +## Important Notes |
| 264 | + |
| 265 | +### ⚠️ DO NOT Use Timestamps |
| 266 | +The `$.timestamp` field in `robotModeData` is in **microseconds** (16 digits) which causes overflow errors in InfluxDB. The Edge Agent automatically adds timestamps using the current system time. **Never extract timestamp fields from RTDE data.** |
| 267 | + |
| 268 | +### 📊 Recommended Data Types |
| 269 | +- **Positions/Distances**: Float (radians or meters) |
| 270 | +- **Velocities**: Float (rad/s or m/s) |
| 271 | +- **Currents**: Float (A) |
| 272 | +- **Voltages**: Float (V) |
| 273 | +- **Temperatures**: Float (°C) |
| 274 | +- **Booleans**: Boolean |
| 275 | +- **Modes/Enums**: Int32 or UInt32 |
| 276 | +- **Bitmasks**: UInt32 |
| 277 | + |
| 278 | +### 🔢 Unit Conversions |
| 279 | +If you need degrees instead of radians, use a conversion factor in your visualization: |
| 280 | +- **Radians to Degrees**: multiply by `57.2958` (180/π) |
| 281 | +- **Meters to Millimeters**: multiply by `1000` |
| 282 | + |
| 283 | +### 🎯 Throttling Configuration |
| 284 | +The driver supports throttling to prevent overwhelming the historian: |
| 285 | + |
| 286 | +```json |
| 287 | +{ |
| 288 | + "DriverDetails": { |
| 289 | + "host": "192.168.1.103", |
| 290 | + "port": 30001, |
| 291 | + "throttle": true, |
| 292 | + "pollInt": 500 |
| 293 | + } |
| 294 | +} |
| 295 | +``` |
| 296 | + |
| 297 | +- `throttle`: `true` to enable throttling, `false` for full rate (~125Hz) |
| 298 | +- `pollInt`: Publish interval in milliseconds (default 500ms = 2Hz) |
| 299 | + |
| 300 | +--- |
| 301 | + |
| 302 | +## Reference Links |
| 303 | + |
| 304 | +- [Universal Robots RTDE Guide](https://www.universal-robots.com/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/) |
| 305 | +- [ur-rtde Library](https://gitlab.com/sdurobotics/ur_rtde) |
0 commit comments