Skip to main content
Runs a trained policy on the robot, using the ZED cameras attached to it. During a rollout, type a key on the terminal:
  • s saves the rollout and ends the episode.
  • r discards it. The arms go limp so you can move them by hand, since a failed rollout often leaves them in a bad spot. Clear them, then press Enter to return to rest and record again.
  • q discards it and quits.
--episode_time_s limits each episode. When time runs out with no key pressed, you get the same prompt: Enter saves, r discards, q quits.
Load only policy checkpoints and existing rollout datasets that you created or obtained from a trusted source. Loading them is not sandboxed.
For the end-to-end workflow, including running inference on a GPU machine, see the Run Policy guide.
This command is configured through draccus. The robot settings (cameras, per-joint gains) live in the nested robot_config. Set them with dotted flags or a whole-config file. See Command configuration for the syntax and Run Policy Config Parameters for every field with its default.

Cameras and observations

The GStreamer and ZED SDK backends produce visibly different images. Run the policy through the backend its dataset was recorded with, or it sees images it was never trained on. The startup log names the backend in use: Cameras: gst pipeline or Cameras: ZED SDK. The GStreamer backend is used only when the plugin installed by gst.build-zed is verified. Each observation pairs the camera images with the arm state from the moment the images were exposed. If a camera goes stale, or the images and arm state are too far apart in time, the rollout stops rather than feed the policy a mismatched observation.

Safety checks

First-action check

For joint-space policies, run-policy compares the first action of each episode with the arm’s measured pose. If any arm joint is more than --max_first_action_offset_rad away:
  • Nothing is sent to the arms and the episode is discarded.
  • The log and the control panel name the joint and the offset.
  • Continue to start the next attempt.
Demonstrations start from rest, so a large first offset usually means the policy sees inputs it wasn’t trained on, such as a different scene or camera backend. Grippers and Cartesian actions aren’t checked. Any accepted first action is still ramped in, not sent as one step.

Contact stops

If the return to rest between episodes hits something, the arms stop and go limp in a gravity-compensation hold. Free them by hand, then continue (Enter or the panel’s Return to rest) to return to rest from where they are. With --policy_torque_threshold set, the same check runs while the policy drives. A stop ends the episode without saving and drops the arms limp. Clear them, then continue to return to rest and start the next attempt.

Saving rollouts

With --repo_id, each saved episode is added to a LeRobot-format dataset. Resuming and repair work as in collect-data, and each episode is on disk as soon as it saves. Between episodes the arms return to rest along a collision-aware path.

Starting and stopping

Starting needs the arms near zero. Run-policy refuses to start while shoulder_1, shoulder_2 or elbow is more than 25° from zero, the arms’ natural resting pose. It names each joint that is out. Move them back by hand, for example under axol gravity-comp, and start again. The first move then goes through zero on its way to the rest pose. See Starting needs the arms near zero. Stopping parks the arms. When you end a run with Ctrl+C, q or Stop in the control panel:
  1. The arms return to the rest pose.
  2. With Park to zero on stop (--park_to_zero, on by default), they continue to zero, holding their grasp.
  3. The motors turn off.
The return to rest has 6 s and the move to zero has 10 s. If a move runs out of time or hits something, the motors turn off where the arms are. A second Ctrl+C doesn’t interrupt the park. The park is skipped when the run never moved the arms, when a contact hold has left them limp, when the IK process never started, or when the CAN bus has stopped reporting positions.

Custom policy interface

--policy_type custom connects to your endpoint through the custom policy interface. The robot sends compressed observations and keeps running the current plan while the endpoint computes the next one. When a new plan arrives, the robot skips the rows whose time has already passed. The endpoint must use protocol version: 2. Endpoints on the original protocol are refused.
Write the endpoint with the almond_axol.policy SDK (Policy and serve()), and test it without the robot using policy.check. See the custom policy interface documentation for setup, timing and recovery.