Embodied AI Glossary中文

URScript

Advanced

The scripting language Universal Robots controllers run directly; programs built on the teach pendant are converted into it too.

URScript is the scripting language Universal Robots (UR) designed for its own robot controllers, letting you control the arm in code without the graphical interface. It has the usual variables, conditionals, loops, functions and threads, plus built-in motion commands such as movej, movel and servoj and functions for reading and writing I/O. When you press Play on a program built in PolyScope, the graphical interface on the teach pendant, it is converted into URScript together with code generated by any URCaps (PolyScope plugins from gripper, camera and other vendors) and handed to the controller to run. An external computer can also bypass PolyScope and send URScript as plain text over TCP to the controller's ports 30001–30003; on e-Series and newer robots the arm must first be switched to remote control mode. One gotcha: sending a new program stops whatever program is currently running. Under the hood, the ur_rtde library and UR's official ROS 2 driver work the same way: they first get a URScript control program running on the controller, then exchange data with it at high rates.

ExampleFrom Python, open a socket to port 30002 on a UR5e controller and send a URScript program that starts with def, ends with end and has every line in between indented — say, a movej to a ready pose followed by a movel 5 cm downward — and the arm runs it right away, as long as the pendant has been switched to remote control mode.

Also called
UR Script, Universal Robots script language
Related
Universal Robots · Teach Pendant · RTDE · MoveJ / MoveL · Streaming Servo Control · Robot Controller
Sources
Develop with URScript (Universal Robots)
Overview of client interfaces (Universal Robots)
Universal Robots ROS 2 Driver: Operation modes

See it in the full glossary →