Skip to main content

Sensor Storage and Replay

Record sensor streams to disk and replay them with original timing. Useful for testing, debugging, and creating reproducible datasets.

Quick Start

Recording

skip

Replaying

skip

TimedSensorStorage

Stores sensor data with timestamps as pickle files. Each frame is saved as 000.pickle, 001.pickle, etc.
skip
Storage location: Files are saved to the data directory under the given name. The directory must not already contain pickle files (prevents accidental overwrites). What gets stored: By default, if a frame has a .raw_msg attribute, that’s pickled instead of the full object. You can customize with the autocast parameter:
skip

TimedSensorReplay

Replays stored sensor data with timestamp-aware iteration and seeking.

Basic Iteration

skip

Realtime Playback

skip

Seeking and Slicing

skip

Finding Specific Frames

skip

Observable Stream

The .stream() method returns an Observable that emits frames with original timing:
skip

Usage: Stub Connections for Testing

A common pattern is creating replay-based connection stubs for testing without hardware. From robot/unitree/go2/connection.py: This is a bit primitive. We’d like to write a higher-order API for recording full module I/O for any module, but this is a work in progress at the moment.
skip
This allows running the full perception pipeline against recorded data:
skip

Data Format

Each pickle file contains a tuple (timestamp, data):
  • timestamp: Unix timestamp (float) when the frame was captured
  • data: The sensor data (or result of autocast if provided)
Files are numbered sequentially: 000.pickle, 001.pickle, etc. Recordings are stored in the data/ directory. See Data Loading for how data storage works, including Git LFS handling for large datasets.

API Reference

TimedSensorStorage

TimedSensorReplay