The experiment loop
Teleoperation over LiveKit
Teleoperate a remote robot over LiveKit and keep a complete recording of every episode.
This example drives a simulated quadruped over LiveKit. The robot logs, as normal, with the Rerun SDK. The stream is both saved as a complete recording and forwarded over a latency-optimized bridge to the remote operator's Rerun Viewer.
Introduction
Remote teleoperation often involves poor network connections, and the operator needs to see the robot with as little latency as possible.
A recording needs every message, in order, but if the network connection is not sufficient, a stream that enforces this falls behind the robot, leading to unacceptable latency.
In this example the rerun_livekit bridge forwards a copy of the stream to the operator through LiveKit, compressing and dropping data as needed to keep the latency low.
The robot is a Unitree Go2 quadruped, simulated in MuJoCo. It walks under a pretrained policy from MuJoCo Playground, and you steer it from a keyboard on the operator's side.
The example covers the four parts of collecting an episode:
- Record on the robot, to a file and to the bridge.
- Stream to the operator's Viewer, optimizing for low latency over fidelity.
- Drive with commands that go back through the same LiveKit room.
- Register both ends as two layers of one segment in a catalog.
Recording on the robot
The robot logs one stream to two sinks: an .rrd file with every message as it was logged, and a Rerun proxy (rerun --serve-grpc) that the bridge reads from.
Rerun's MJCF importer reads the same model file that MuJoCo simulates, so the robot in the Viewer is the robot in the simulation.
Streaming to the operator
The bridge forwards the stream through a LiveKit room, over WebRTC. Images travel as video that adapts to the link, other data such as the lidar scans is sent on a lossy channel that skips old messages rather than waiting on them, and blueprints and static data are sent reliably. The operator's Viewer receives the same recording, with the same entity paths and timelines.
The video at the top shows the operator's Viewer, with the latency of what arrives plotted by the bridge (--plot-latency).
From 14 s to 21 s in that plot the camera falls about half a second behind, while the other data keeps arriving within 20 ms, so the 3D view stays current.
Driving the robot
The robot logs each command it receives next to the velocity it measured, so an episode holds the actions and the observations on one timeline.
Both ends in one segment
The operator's end can record too: what reached it, with lossy video and without the frames that were dropped on the way.
Both recordings keep the same recording ID, so they become two layers of one segment in a Rerun catalog.
The robot layer is everything the robot logged.
The operator layer adds the images that reached the operator and the latency of every frame.
Opening the segment shows the robot's camera next to the operator's view on one timeline, so you can check what the operator saw at any moment of an episode.
Run the code
This is an external example. Check the repository for more information.
The repository includes the simulated robot and a keyboard driver, so everything runs on one machine. Try it out walks through driving the robot, Record through recording on both ends, and Both ends in one segment through registering an episode in a local catalog.
To use the bridge with your own robot, the repository also covers:
- Two machines, with LiveKit Cloud or a LiveKit server that you host.
- Choosing what to send, with rules for each entity.
- Sending commands from your own input device to your own robot.
The robot model comes from MuJoCo Menagerie and the policy from MuJoCo Playground.