Skip to content

Send Custom Script File

SUMMARY

Send Custom Script File reads a .urscript file from disk and transmits its contents to the robot controller over the RTDE control channel.

Use this skill when you have a pre-written URScript program saved as a file and want to execute it on the robot.

SUPPORTED ROBOTS

This skill is currently supported on Universal Robots only. Calling this method on other robot brands will raise a NotImplementedError.

The Skill

python
robot.send_custom_script_file(file_path="/path/to/program.urscript")

The Code

Example: Send a URScript File to the Robot

Connect to the robot, send a .urscript file, and disconnect.

python
from loguru import logger
from telekinesis.synapse.robots.manipulators import universal_robots

robot_ip = "192.168.1.2"  # replace with your robot's IP
script_file = "/path/to/program.urscript"

robot = universal_robots.UniversalRobotsUR10E()
# Connect
robot.connect(ip=robot_ip)

robot.send_custom_script_file(script_file)
logger.success(f"Custom script file '{script_file}' sent to robot.")

# Disconnect
robot.disconnect()

The Explanation of the Code

send_custom_script_file reads the URScript file at file_path, then sends its full contents to the robot controller over RTDE. The controller executes the program asynchronously. This is equivalent to calling send_custom_script with the file contents as a string, but handles file I/O internally. The call returns True on success.

How to Tune the Parameters

ParameterTypeDefaultDescription
file_pathstrAbsolute or relative path to the .urscript file to send.

Return Value

TypeDescription
boolTrue if the script was accepted by the controller, False otherwise.

Where to Use the Skill

  • Pre-written programs — Execute complex multi-step URScript programs maintained as files
  • Version-controlled scripts — Keep URScript programs under source control and send them at runtime
  • Large programs — Avoid inline string handling for long URScript programs

When Not to Use the Skill

Do not use Send Custom Script File when: