Skip to content

Commit 1d734f4

Browse files
committed
update README.md
1 parent 97781e8 commit 1d734f4

File tree

1 file changed

+46
-24
lines changed

1 file changed

+46
-24
lines changed

README.md

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,30 @@ Quickly create applications that communicate with an [Universal Robots](https://
66

77
SDK : Software Development Kit
88

9-
109
🔗 **More Information:** [https://underautomation.com/fanuc](https://underautomation.com/universal-robots)
1110
🔗 Also available in **[🟦 .NET](https://github.com/underautomation/UniversalRobots.NET)** & **[🟨 LabVIEW](https://github.com/underautomation/UniversalRobots.vi)** & [🧊 Unity](https://github.com/underautomation/UniversalRobots.Unity)
1211

13-
1412
[![UnderAutomation Universal Robots communication SDK](https://user-images.githubusercontent.com/47540360/136141853-1ec87530-d88e-467f-adb4-ec3c46d26010.png)](https://underautomation.com)
1513

16-
1714
https://user-images.githubusercontent.com/47540360/143318635-6d6aaaf4-5642-457a-8ff1-4322f2defe82.mp4
1815

1916
## Try it
17+
2018
From Pypi :
19+
2120
```
2221
pip install UnderAutomation.UniversalRobots
2322
```
2423

2524
From this repo :
25+
2626
```
2727
git clone https://github.com/underautomation/UniversalRobots.py.git
28+
pip install pythonnet==3.0.3
2829
```
2930

3031
Import features :
32+
3133
```py
3234
from underautomation.universal_robots.ur import UR
3335
from underautomation.universal_robots.connect_parameters import ConnectParameters
@@ -42,14 +44,16 @@ from underautomation.universal_robots.rtde.rtde_input_values import RtdeInputVal
4244
## Features
4345

4446
### RTDE and Primary Interface
47+
4548
Full support for :
49+
4650
- RTDE (Real-Time Data Exchange) : read and write registers up to 500Hz
47-
- Primary Interface :
51+
- Primary Interface :
4852
- Receive robot state data at 10Hz : Cartesian and angular position, robot status, inputs and outputs value, and 100+ more measurements ...
4953
- Send URScript
5054
- Get variables
5155

52-
``` py
56+
```py
5357
# Create a robot instance
5458
robot = UR()
5559

@@ -103,7 +107,7 @@ def on_value_updated(p, e):
103107
name = variables[0].name
104108
value = variables[0].to_pose()
105109
type = variables[0].type
106-
##
110+
##
107111

108112
# Event raised when a program or installation variable change
109113
robot.primary_interface.global_variables.values_updated(on_value_updated)
@@ -134,15 +138,19 @@ robot.primary_interface.joint_data_received(on_joint_data_received)
134138
```
135139

136140
### Read variables
141+
137142
Read program and installation variables :
138-
``` py
143+
144+
```py
139145
myVar = robot.primary_interface.global_variables.get_by_name("myVar")
140146
variables = robot.primary_interface.global_variables.get_all()
141147
```
142148

143149
### Dashboard Server
150+
144151
Remote control the robot : load, play, pause, and stop a robot program, power on and off, release brake, shutdown, ...
145-
``` py
152+
153+
```py
146154
# Create a new robot instance
147155
robot = UR()
148156

@@ -171,10 +179,12 @@ state = robot.dashboard.get_program_state()
171179
```
172180

173181
### XML-RPC
182+
174183
From your robot program, remote call a function implemented in your .NET program. For example, this allows you to request a position resulting from image processing.
175184

176185
Robot code (URScript) :
177-
``` ruby
186+
187+
```ruby
178188
# Connect to the SDK and specifie the IP and port of the PC
179189
rpc:=rpc_factory("xmlrpc","http://192.168.0.10:50000")
180190

@@ -183,7 +193,8 @@ answer:=rpc.GetPose(100)
183193
```
184194

185195
Python code :
186-
``` py
196+
197+
```py
187198
# XML-RPC server on port 50000
188199
parameters.xml_rpc.enable = True
189200
parameters.xml_rpc.port = 50000
@@ -193,10 +204,12 @@ parameters.xml_rpc.port = 50000
193204
```
194205

195206
### Socket communication
196-
The library can start a communication. The robot can connect to your server and exchange custom data.
207+
208+
The library can start a communication. The robot can connect to your server and exchange custom data.
197209

198210
Robot code (URScript) :
199-
``` ruby
211+
212+
```ruby
200213
# Connect to robot socket server in URScript
201214
socket_open("192.168.0.10", 50001)
202215

@@ -208,7 +221,8 @@ var1 := socket_get_var("MY_VAR")
208221
```
209222

210223
Python code :
211-
``` py
224+
225+
```py
212226
robot = UR()
213227

214228
# Setup connection to th robot
@@ -224,14 +238,14 @@ robot.connect(param)
224238
##
225239
# Function called when robot connects with URScipt function socket_open()
226240
def on_socket_client_connection(o, e : SocketClientConnectionEventArgs):
227-
e.client.socket_write("Hello cobot <3")
241+
e.client.socket_write("Hello cobot <3")
228242

229243
robot.socket_communication.socket_client_connection(on_socket_client_connection)
230244

231245
# Function called when the robot sends a message with socket_write()
232246
def on_socket_request(o,e:SocketRequestEventArgs):
233-
# Get robot message
234-
robotMessage = e.Message
247+
# Get robot message
248+
robotMessage = e.Message
235249

236250
robot.socket_communication.socket_request(on_socket_request)
237251

@@ -248,16 +262,18 @@ clientEndpoint = connectedClients[0].end_point
248262
# Send a message to a specific connected robot
249263
connectedClients[0].socket_write("Hello robot [0]")
250264

251-
# Handle client disconnection
265+
# Handle client disconnection
252266
def on_socket_client_disconnection(o,e):
253-
pass
267+
pass
254268

255269
connectedClients[0].socket_client_disconnection(on_socket_client_disconnection)
256270
```
257271

258272
### SFTP
273+
259274
Manipulate files and folders of the robot via SFTP (Secure File Transfer Protocol) : download to the robot, import from the robot, rename, delete, move, list files in a folder...
260-
``` py
275+
276+
```py
261277
robot = UR()
262278

263279
# Setup connection to th robot
@@ -286,14 +302,18 @@ robot.sftp.write_all_text("/home/ur/file.txt", "Hello robot !")
286302
```
287303

288304
### SSH
305+
289306
Open a SSH (Secure Shell) connection with the robot to execute Linux command lines, as in the terminal.
290-
``` py
307+
308+
```py
291309
robot.ssh.run_command("echo Hello > /home/ur/Desktop/NewFile.txt");
292310
```
293311

294312
### Convert position types
313+
295314
Convert Rotation Vector to and from RPY.
296-
``` py
315+
316+
```py
297317
# Create X, Y, Z, RX, RY, RZ pose
298318
pose = Pose(0.1, 0.2, -0.1, 0, 0.05, 0.1)
299319

@@ -303,16 +323,18 @@ vectorPose = pose.from_rpy_to_rotation_vector()
303323
```
304324

305325
### Edit program and installation files
326+
306327
Open and edit program (.urp) and installation (.installation) files :
307-
``` py
328+
329+
```py
308330
# Decompile program and installation files and access inner XML
309331
installation = URInstallation.load("C:\\temp\\default.installation")
310332
prg = URProgram.load("C:\\temp\\prg.urp")
311333
internalXml = prg.xml
312334
```
313335

314336
## License
315-
This SDK is a commercial library and a license *must* be purshased. Once acquired, any application you develop can be delivered to an unlimited number of customers without royalties and without recurring subscription.
316337

317-
More information : [https://underautomation.com](https://underautomation.com)
338+
This SDK is a commercial library and a license _must_ be purshased. Once acquired, any application you develop can be delivered to an unlimited number of customers without royalties and without recurring subscription.
318339

340+
More information : [https://underautomation.com](https://underautomation.com)

0 commit comments

Comments
 (0)