← Back

Imitation Learning with 6-Axis Robot Arm

At the Viam x Intel Robot Hackathon, we used imitation learning to teach a uFactory xArm 6 to pack a shirt, a hat, a ball, and a small box into a package in any order. We collected 15 episodes per object by teleoperating the xArm with an SO-101 leader arm, recording the arm’s joint positions and gripper state along with two camera views: an overhead webcam and a wrist-mounted Intel RealSense. Instead of one long-horizon policy for the whole task, I trained a separate Action Chunking with Transformers (ACT) policy for each object, running 45 epochs each. Each policy only has to learn a short grasp-and-place skill, which keeps the packing order flexible. From the current images and joint state, a policy predicts a chunk of upcoming joint and gripper targets. We also experimented with fine-tuning SmolVLA, Hugging Face’s compact VLA model, but the results weren’t as good as the ACT policies given how little data we had. Fine-tuning also took much longer to train than ACT, which doesn’t lend itself well to a time-constrained hackathon, as we did a lot of training iterations based on new data we collected and different epoch counts.

The main failure mode was stalling. A policy would make the right motion but then hesitate, taking a long time to commit to a grasp and move toward the package. I suspect this came from inconsistent episodes and overfitting with only 15 episodes per object. We also found small inconsistencies in the overhead webcam’s positioning that we didn’t catch during training, which surely made the training data less reliable. I wrote a script to adjust for this using fixed location things along the edges of the view as references, but it’s still far from ideal.

Side-by-side camera views from the xArm setup: the wrist camera on the left and the overhead webcam on the right, both showing a Viam shirt, hat, ball, and small box on a white table next to an open shipping box
Example camera views: wrist camera (left) and overhead webcam (right).

I wrote an orchestration layer that takes an inputted packing order and runs the according per-object policies in that sequence. It also handles retrying when an object isn’t detected as placed in the package, and hands off to the next policy once it is, so any ordering works without retraining. The pipeline is written in Python running on Viam, and policy inference runs at the edge on an Intel NUC’s NPU through OpenVINO. Both videos are real sped-up runs on the arm.