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.
(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.
WindowResult for unknown channels.
Use cases
Buffer configuration
Each channel gets adeque-backed ring buffer (default: 1000 samples, O(1) eviction). Configure per-channel depth before the first ingest():
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: