Phase 1: Platform mental model

Before you touch any hardware, get the mental model for the whole workshop: how teaching by demonstration works, which Viam piece handles each stage, and what the policy sees and does. Every later phase builds one stage of that loop.

Programming by demonstration

Instead of writing code that says how to stack a block, you show the robot. That’s imitation learning: you record what a person does, and a model learns to map observations (camera images plus joint state) to actions (the next joint positions).

This workshop uses ACT, which stands for Action Chunking with Transformers. ACT predicts a chunk of future actions at once instead of one action at a time, so small errors don’t compound from one step to the next and the motion comes out smooth. It also learns from few demonstrations: on the reference cell, 58 were enough for a policy that stacks the block.

The loop on Viam

Teaching by demonstration is a loop of five stages:

The robot learning loop as five circles in a ring. Stage 1, Teleop, uses teleop and leader-arm to drive xarm. Stage 2, Record, uses demo-capture, data-manager, and capture-app. Stage 3, Curate, uses review:keep tags and the xarm-stacking-v1 dataset. Stage 4, Train, runs lerobot-training to produce xarm-stacking. Stage 5, Deploy, runs act-policy and act-controller. A dashed arrow from Deploy back to Teleop reads Evaluate, record more.

Each stage maps to a Viam piece and to the phase of this workshop where you build it:

  1. Teleop, in Phase 2: the leader-follower teleop service lets you steer the xArm6 with a leader arm.
  2. Record, in Phase 3: the capture control sensor and the capture-control webapp record each demonstration as one data sequence, using capture on demand.
  3. Curate, in Phase 4: you review the episodes and build a sequence dataset from the keepers.
  4. Train, in Phase 5: a custom training job trains the policy on a cloud GPU.
  5. Deploy, in Phase 6: the viam-labs:vla policy and controller services run the trained model on the machine.

The dashed arrow is Phase 7: you score the deployed policy, record demonstrations aimed at its failures, and go around the loop again.

Two arms, one policy

The leader arm is 5-DOF (degrees of freedom) and the xArm6 is 6-DOF, so copying joint angles from one to the other doesn’t work. The leader-follower teleop service maps the leader’s tool pose into the follower’s frame, and the motion service’s teleop pipeline solves the xArm’s joints and streams them to the arm.

The policy only ever sees the follower’s joints and cameras; the leader is just a way to steer the arm. You could steer with a different leader arm, or with a pose tracker through the viam:teleop module’s clutch model, and keep recording for the same policy.

What the policy sees and does

Contents
Observationwrist-cam and scene-cam images, six xArm joint angles, and the gripper position normalized from 0 (open) to 1 (closed)
ActionThe next six joint angles plus the gripper value

Both run at 10 Hz.

Checkpoint

Open your machine in the Viam app. The machine shows the green Live indicator. You can name the five stages of the loop and the arm whose joints the policy learns. If the machine isn’t Live, start viam-server before continuing.