Skip to main content
rua.telemetry records robot runs onto HUD traces. The guide is Recording traces.
The rua.telemetry package itself exports nothing; import from the submodules. Steps reach the platform only when HUD reporting is on: HUD_API_KEY set and HUD_TELEMETRY_ENABLED not false.

TraceRecorder

Streams one trace’s robot telemetry. The trace’s lifecycle stays with the caller.

to_numpy

Coerces a torch tensor (detached, moved to CPU), an array or a scalar to a numpy array, without importing torch.

Video

VideoStreamer(*, fps, trace_id, keep_every_frame=False) runs one SegmentEncoder thread per camera and emits a VideoSegmentStep for every segment. record(obs) submits each HxWxC frame in obs["data"] with 1, 3 or 4 channels; finalize() flushes every camera’s tail. It needs PyAV (av), a rua dependency. SegmentEncoder(camera, on_segment, *, fps, segment_seconds=2.0, crf=23, max_queued_frames=16, keep_every_frame=False) encodes one camera to H.264 in fragmented MP4 (CMAF). Segment 0 is the init segment; each later one is a fragment of about segment_seconds. Frames are converted to RGB, with odd sides cropped to even. Under backpressure, submit drops frames unless keep_every_frame.

Step schemas

Every robot step is a hud.types.Step subclass with schema_tag = ROBOT_STEP_SCHEMA = "hud.robot.step.v1", which the HUD trace viewer dispatches on. RobotStepSource is Literal["observation", "inference", "video_segment"]. StateFeature is {names: list[str], values: list[float], role: FeatureRole | None}. FeatureRole is Literal["state", "privileged", "measured"]: what the agent observes, the env’s hidden state, which the agent never sees, or a part as the embodiment measures it. ObservationStep.from_obs(obs, *, tick=0, obs_space=None) builds an observation step from a raw {"data": ...} observation; a feature takes its role from the contract feature that labels it (observation gives state, privileged gives privileged).

Direct-control traces

DirectControl and CodeControl record each episode onto the rollout’s trace. The recording opens at the scene as it is on the agent’s first call of any tool (move, done, hindsight or python), so an episode that never moves still records its opening scene as tick 0.
  • Each tick is an ObservationStep with the contract’s observation and privileged features, and a measured/<part> feature (role measured) per embodiment part, labelled with the part’s dims. A part’s values are what a move starts from, in the dims’ units.
  • Each request is one InferenceStep: a move call, a cell’s robot.move or a robot.step. tick is the tick the request started from, chunk holds the rows it played on ticks tick + 1 to tick + played, and the step spans the request’s wall-clock time. status is RequestStatus, Literal["completed", "cut_short", "refused", "vetoed", "ended"]; a refused or vetoed request has its reason and an empty chunk. A request still playing when the episode ends is not recorded.