Skip to main content
Runs a trained policy on the robot while the operator watches in VR and steps in to correct it. The whole session is recorded to a LeRobot-format dataset, both the policy’s motion and the operator’s corrections. This is the DAgger loop: you record demonstrations where the policy struggles, so retraining fixes those failures. Local policies run inference on the robot, one action per control tick. Remote policies run on a desktop. Cameras and recording work as in collect-data.
Load only policy checkpoints and resumed datasets that you created or obtained from a trusted source. Loading them is not sandboxed.
With a local policy, the VR grip buttons control interventions during an episode:
  • While the policy drives, either grip alone freezes it. The robot holds its pose and recording pauses.
  • Both grips hand control to you. Teleop engages at the robot’s current pose and recording resumes.
  • Either grip alone hands control back to the policy.
Nothing is recorded while frozen, so the dataset goes straight from the policy’s motion into your correction. Remote policies use hold-to-intervene controls. In both modes, rows you drive are tagged with LeRobot’s per-frame intervention flag. Episodes start and end as in collect-data:
  • Press the record button to start an episode. The policy starts driving and recording begins.
  • Press record again to save.
  • Press record with reset held to discard and record again.
On the terminal, s saves, r discards, and q discards and quits. --episode_time_s saves the episode if nothing is pressed in time. With a local policy and --subtasks, type a number from 1 to N to switch the policy’s instruction without ending the episode.
For the end-to-end workflow, from a trained checkpoint to recorded corrections, see the DAgger Collection guide.
This command is configured through draccus. Local inference uses --policy_path, --policy_type and --device. --policy_type custom selects the custom policy interface. The recording side matches collect-data: the nested robot_config and teleop_config set cameras, per-joint gains, IK and the VR server. See Command configuration for the syntax and DAgger Collection Config Parameters for every setting. If a return to rest hits something, the arms stop and go limp in a gravity-compensation hold. Free them by hand, then press the VR reset button, or continue at the prompt, to return to rest from where they are. This works as in teleop. The video relay must start for this command. If it can’t, install the GStreamer stack with gst.install and gst.build-zed.

Local-policy intervention flow

The grip buttons move control between the policy and the operator during an episode.
  • When you take over, teleop engages at the robot’s measured pose, so the arm doesn’t jump.
  • The grippers follow the controller triggers as soon as you take over. Set the triggers before you squeeze the grips. For example, hold a trigger down to keep a part gripped.
  • When you hand back, the policy restarts its plan from the corrected pose.
  • If the headset link drops while you drive, tracking disengages and control goes back to the policy.
Between episodes the grips work as plain teleop, and nothing is recorded. Squeeze both to engage and one to disengage, so you can reset the scene with the arms. The VR reset button sends the arms to rest. Inside an episode the reset button is disabled, and episodes end from the record button.

Remote policies through the custom policy interface

--policy_type custom runs inference on a desktop through the custom policy interface. It requires --hold_to_intervene true:
  • Hold either grip to drive that arm. The other arm holds its pose.
  • Release both grips to hand control back to the policy.
  • If the headset connection drops while you hold a grip, you keep control and the arm holds its position until you release.
The freeze and toggle controls above apply to local policies only. For example, on the robot, with your endpoint address and camera serial:
The endpoint must accept the robot’s state, action and camera layout. No checkpoint path is needed. --task labels the dataset and isn’t sent to the endpoint, and the endpoint picks the instruction. Remote mode rejects --subtasks. Set DAgger’s own server_host and hold_to_intervene. The control panel shows these fields too. Run-policy’s inference settings don’t select the DAgger endpoint. When you hand back, the robot holds your last command until the desktop returns a fresh plan from the corrected pose. It then blends into that plan. Each switch between policy and operator stays in the same dataset episode, and the rows are labelled correctly at the switch. The startup move must finish before the first VR Record prompt opens. Whenever the session homes on start (the default, or with --home_on_start true), it first checks that shoulder_1, shoulder_2 and elbow are within 25° of zero, and the first home goes through zero. See Starting needs the arms near zero. A session with --start_from_current_pose and without --home_on_start can start anywhere.

Stopping a session

With a local policy, ending the session parks the arms as in collect-data. They go to rest, then to zero holding the grasp, then the motors turn off. Zero applies with --teleop_config.vr_teleop_config.park_to_zero (on by default; the control panel’s Park to zero on stop). The moves are limited to 6 s and 10 s. With a remote policy:
  • Press q once to park through rest and zero, then turn off the motors. It needs no Enter and discards an episode in progress. It works at the idle VR Record prompt or during an episode.
  • An idle q never starts the policy.
  • During an episode, s + Enter saves and r + Enter discards.
  • End-of-input, Ctrl+C, a fault, declining a contact retry or a failed park all stop without parking. The motors keep holding the arms’ position.
  • Arms already limp after a contact stop stay limp and don’t park.

DAgger annotation

Every dataset collect-dagger creates has LeRobot’s per-frame intervention feature. It is True on rows you drove and False on the policy’s rows, the same annotation LeRobot’s DAgger rollout uses. Training can use it to weight or filter the corrections. You can resume only a dataset that already has the intervention feature, which means one recorded by this command. Any other dataset is rejected.