Skip to main content

Robot policy contract

Lifecycle​

se3labs.interface.eval.policy.Policy defines the station-driven episode lifecycle:

MethodCalled whenReturn value
initialize(station, task)Before each episodeStation_JointPose: the pose the arms move to before rollout
infer(observation)On each observation tickStation_ActionChunk, or None to continue the current chunk
reset()After an episodeNothing; clear per-episode state

Model initialization and access to task.instruction belong in initialize(). Inference frequency, preprocessing, and chunk length are controlled by the policy.

Observations and actions​

station.arms and station.cameras describe the available hardware. Observation and action dictionaries use those same names. A bimanual station uses left and right for its arms; a single-arm station uses arm.

Joint targets are absolute angles in radians. Gripper positions are open fractions: 0 is closed, 1 is open. Each arm action contains arrays shaped (horizon, n_arm_dof) and (horizon, n_gripper_dof).

An action chunk's row i targets station time timestamp + i / rate. Use the observation's station-clock timestamps, not your computer's wall clock. All arms in a chunk share its horizon and rate. A new chunk replaces the remaining targets from the previous chunk; returning None keeps that chunk.

Task specification​

A Task_Spec contains an operator-facing description and reset_instruction, a model-facing instruction, a max_rollout_time in seconds, and a Task_ScoreSheet. Its required binary success question determines whether the episode passed. Additional questions can be binary or multiple choice. The station operator supplies the answers.

Inference errors​

An exception from infer() is recorded in SessionReport.errors. That tick sends no new chunk, so the station continues the existing one. An initialization exception ends the session and propagates. This version has no EndEpisode exception; the station controls the episode duration.

For a complete implementation, follow the robot policy tutorial. Data types are listed in the Python Interface reference, and session reports in the Python SDK reference.