Hi, I’m using TCP/IP primary client interface to control the robot through Python. I am able to send URScript commands through Python to move the robot, but am not able to receive data. For example, I cannot seem to properly execute the get_actual_tcp_pose command. This is my code for receiving data:
I tried that, now I’m getting an error saying “UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 5: invalid start byte”. Do you know what might be causing this?
Is there some way to enable receiving messages? Because no matter what I send, I always receive the same binary dump with recv. The received data never changes
The data you are receiving is not directly related to the data you are sending, it contains all relevant data from the controller sent out at regular intervals, the script code you send to this port will execute but you will not be able to receive return values in this way.
Recommend you check out the below third party library for an easy way to get started talking to the robot with python:
Look at the documents at the end of this site: Remote Control Via TCP/IP - 16496
In the excel document for exmaple point 5.9 there are listed all data, which the primary and secondary clients send. Maybe the list contain the data which you are looking for? But note: New data are available only every 100 ms. If you need other data or higher refresh rate, you can look at the end of the excel document “RealTime” or to this site Real-Time Data Exchange (RTDE) Guide - 22229. But before you use the RealTime client you should use the recommended RTDE.
Thanks! Besides the faster refresh rate, what are the other advantages of the RTDE? I am able to now receive data via the primary interface and am wondering if RTDE offers more useful advantages.
So RTDE is a more robust protocol, that is better at ensuring your data is exchanged at the required frequency, and you can specify in a recipe file which specific data fields you would like to receive. Primary and secondary just throw everything out at you and the burden is on you to unpack it and sift through for that you want, the controller doesn’t care whether you received it or not.
Also the format of the datastreams is likely to change between software releases, which can be troublesome, this won’t be an issue with RTDE.
What’s nice about it, is the fact that because you dont require 500HZ communication, this package allows for controlling robot in slower rate, BUT you don’t need to deal with programming on the teaching pedant. Instead you come with your PC, plugin in and run code.
Very comfortable to use