Skip to main content
STUB DOCUMENT: This page is intentionally minimal and will be expanded with deeper technical details in a future update.
The cw.data module provides time-aware fusion primitives for edge workers that fuse multiple sensor streams.

data.at() — Interpolated point read

Query a channel at an arbitrary timestamp. The SDK interpolates between the two nearest buffered samples. Returns None for unknown channels. When t falls outside the buffered range, the nearest boundary sample is returned (constant extrapolation).

Interpolation strategies

Dict interpolation operates over the union of keys from both samples and emits a UserWarning when the schemas diverge (schema drift detection).

Quaternion type

SLERP only triggers when values are wrapped in Quaternion. Plain list[float] of length 4 will not be SLERPed — this avoids ambiguity with RGBA colors, 4-DOF joint arrays, etc.
Convention: Hamilton (x, y, z, w) — the same as ROS, MuJoCo, and the Cyberwave wire format.

data.window() — Time-range query

Return all buffered samples within a time range. The returned WindowResult is iterable.
Returns an empty WindowResult for unknown channels.

Use cases

Buffer configuration

Each channel gets a deque-backed ring buffer (default: 1000 samples, O(1) eviction). Configure per-channel depth before the first ingest():
Calling configure_channel after samples have already been ingested raises ValueError.

Custom clock

FusionLayer accepts an optional clock argument (defaults to time.time). Use this to align with a monotonic or sim-time source: