Universal Robots Forum

Sending Commands to UR robot The Best Way (not text based...)


I have been playing around with UR robots (using URSim and also with a real robot I have on-site), and I am intending to drive the robot from remote.

I have read a lot of UR articles, and so far I have only figured out how to move the robot via Primary, Secondary or Real Time clients using text based commands. My question is then:

  • Is text the only way of sending commands to the UR!? Isn’t there a “better” (in terms of coding) way of sending the commands other than hard-coding them into your code based on the URScript Manual Commands?

I have read the UR XML-RPC communication articles, but as far as I figured it is only so that URController can make RPC calls to a remote server (coded by anyone). So I am guessing there does not exist a XML-RPC protocol to communicate with URController to send commands. Is this correct?

I appreciate all your help!

Best way would be to use the RTDE interface to write your target positions into the robots general purpose registers, then have a program loop running on the robot itself to read them in and execute them. Your program on the robot could use Move commands to just use the robots own path planning to get to the target position, or Servo commands to execute a trajectory you have planned using other software.


I don’t have a sample showing exactly this to hand, but the above article and the attached examples at the bottom should help to get you started.

You can use a library like ur_rtde SDU Robotics / ur_rtde · GitLab to control the robot.The library offers a C++ and Python interface and uses the RTDE interface for sending commands to the robot.

Here is the API documentation: Universal Robots RTDE C++ Interface — ur_rtde 1.3.8 documentation