Skip to main content
Add a few lines of code to your robot controller:
1

Import the module

from repoch.client_api.streaming import VideoStream
2

Create streaming instance

Give your robot and stream a unique name:
stream = VideoStream(robot_name="robot_arm", stream_name="wrist_cam")
3

Stream data

Send observations during operation:
stream.add_frame(image)
4

Close safely

Always close the stream when finished:
stream.close()

Complete Example

from repoch.client_api.streaming import TimeseriesStream, VideoStream, AudioStream

# Create streaming instances with robot and stream names
video_stream = VideoStream(robot_name="robot_arm", stream_name="wrist_cam")
audio_stream = AudioStream(robot_name="robot_arm", stream_name="mic_1")
ts_stream = TimeseriesStream(robot_name="robot_arm", stream_name="wrist_cam",
                             series_names=["joint_1", "joint_2"])

# Your camera and robot driver implementations
camera = YourCameraObject()
robot_driver = YourRobotDriver()

try:
    # Stream data during operation
    while True:
        image = camera.get_frame()
        if image:
            video_stream.add_frame(image)
        joints = robot_driver.get_pos()
        joint_series = {"joint_1": joints[0], "joint_2": joints[1]}
        ts_stream.add_data(joint_series)

finally:
    # Close streams safely when done
    ts_stream.close()
    video_stream.close()
    audio_stream.close()

Next Steps

Connect Robot

Start streaming data from your robot to the server