Skip to content

Start File Recording

SUMMARY

Start File Recording begins recording RTDE data from the robot controller to a CSV file. Once started, the controller continuously writes the specified variables to disk at the RTDE sample rate. Call Stop File Recording to end the recording.

Use this skill to capture robot state data for post-hoc analysis, trajectory logging, or quality recording.

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.start_file_recording(filename="recording.csv", variables=[])

The Code

Example: Record RTDE Data for 2 Seconds

Connect to the robot, start recording, wait, then stop.

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

robot_ip = "192.168.1.2"  # replace with your robot's IP
output_file = "rtde_recording.csv"

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

robot.start_file_recording(output_file)
logger.info(f"Recording to {output_file}...")

time.sleep(2.0)

robot.stop_file_recording()
logger.success("Recording stopped.")

# Disconnect
robot.disconnect()

The Explanation of the Code

start_file_recording opens the specified CSV file and begins writing RTDE data at the controller's sample rate. The variables parameter selects which RTDE variables to record; passing an empty list records all default variables. The recording continues until Stop File Recording is called. Returns True on success.

How to Tune the Parameters

ParameterTypeDefaultDescription
filenamestrPath to the output CSV file. Created if it does not exist; overwritten if it does.
variableslist[str][]List of RTDE variable names to record. Empty list records all default variables.

Return Value

TypeDescription
boolTrue if recording started successfully, False otherwise.

Where to Use the Skill

  • Motion logging — Capture joint positions, TCP poses, and forces during a task for post-hoc analysis
  • Quality recording — Record RTDE data during production cycles for traceability
  • Controller tuning — Capture trajectory data to tune speed, acceleration, and blending parameters

When Not to Use the Skill

Do not use Start File Recording when:

  • Real-time streaming is needed — RTDE recording is written to disk and is not intended for real-time streaming to another process
  • Recording is already active — call Stop File Recording first before starting a new recording session