Transferring data from python to UR


Good afternoon! I have a code written in python that determines the rotation angle of the box and its coordinates. How do I transfer this data to the robot so that he would turn his hand at this angle and be able to take this box?

1 Like

Easiest way I would do it is an XMLRPC server that the robot can request data from.

I should mention that if you send a python dictionary with the keys x, y, z, rx, ry, rz, the robot side rpc_client automatically converts it to UR data type ‘pose’.

You can also send a python list and it will show up as a vector on the robot. Be warned that vectors of length > 512 will cause “ValueStack” errors from my experience.

UR Example:

https://www.universal-robots.com/articles/ur/interface-communication/xml-rpc-communication/

Python Documentation (Server Side):

My non-OOP example:

OOP example:

Robot example:

1 Like