Teach an xArm6 to Stack Blocks
You’ll teach a robot arm a skill by showing it instead of programming it. You move an SO-ARM101 leader arm by hand, the xArm6 copies you, and Viam records each demonstration. Then you train a policy on those recordings, and the xArm6 stacks the blocks by itself.
The leader and follower are different arms, and Viam connects them.
Required hardware
- A uFactory xArm6 with its gripper, the follower arm that does the stacking.
- An SO-ARM101 leader arm with its gripper, which you move by hand to demonstrate the task.
- An Intel RealSense wrist camera, mounted on the xArm6. The workshop uses it for color only.
- A USB webcam, fixed on a stand beside the table, facing the work area.
- Two blocks in contrasting colors, sized for the xArm gripper.
- An x86 Linux computer that runs
viam-serverand inference.
Phases
- Platform mental model
- Configure the cell
- Record demonstrations
- Review and build a dataset
- Train a policy (milestone one: a trained model)
- Deploy the policy (milestone two: an autonomous stack)
- Evaluate and iterate (optional)
When you finish, the wrap-up reviews what you built and points to next steps.
Plan your day
| Phase | Time estimate |
|---|---|
| 1. Platform mental model | 20 minutes |
| 2. Configure the cell | 75 minutes |
| 3. Record demonstrations | 90 minutes |
| 4. Review and build a dataset | 30 minutes |
| 5. Train a policy | 20 minutes plus a 45 to 60 minute training job |
| 6. Deploy the policy | 60 minutes |
| 7. Evaluate and iterate (optional) | 90 minutes plus a retrain |
The Phase 5 training job runs for 45 to 60 minutes, so submit it before a break.
Companion code
The training script is viam-labs:lerobot-training, already published to the registry, so you don’t write it. The other supporting files live in the viam-devrel/xarm-act-stacking repository, under config/: the cell config and the policy and controller configuration.
Prerequisites
The workshop is self-serve, so confirm each of these before you start:
- A Viam account with an online machine. Log in at app.viam.com, create a machine, and confirm the green Live indicator before you begin.
viam-serverv0.127.0 or later. Data sequences, which every phase from Phase 3 on depends on, need v0.127.0.gitandcurlon the machine. The policy module needs both to install its dependencies in Phase 6.- An xArm6 that’s networked and reachable from the machine.
- An SO-ARM101 leader that’s built and calibrated. Follow the setup steps in the SO-ARM101 module documentation: configure the motors, build the arm, and calibrate it.
- The Viam CLI, installed and logged in. See the Viam CLI documentation.
- Python 3 with pip, to run the dataset script in Phase 4.
- Optional: the pick-and-place workshop, a gentler introduction to the xArm6.
Where to start
- Hardware ready and machine online (
viam-serverrunning): start at Phase 1. - Still building your SO-ARM101 leader: complete the SO-ARM101 setup first, then return here for Phase 1.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!