BoundaryRobot arm

Teaching a robot to teach itself

A low-cost SO-101 arm on my desk, learning to sort coloured cubes from its own experience. The long-term goal is an arm that helps someone eat and drink.

Lab notebookLast session 23 Oct 2026

This is the record so far, taken from the run logs. It includes the failures, because that’s most of it.

Laid out like a notebook so you can follow the work. The grey lines are code. You can skip them and read the results. The outputs are the arm’s real camera frames and logs; the code lines are simplified.

In [1]:
arm = connect("pi-arm6")    # SO-101 arm, Raspberry Pi, Viam
show(arm.overview_camera())
Out[1]:
A white robot arm on a desk beside two blue and two green cubes
The overview camera: the arm and four cubes before the supervised grasp, 23 Oct 2026.

The loop

Every attempt runs the same five steps. “Learning” today means the last one: after a held pick, the arm saves the corrections it needed.

In [2]:
describe(arm.loop)
Out[2]:
stepwhat happensstate
0SeeTwo cameras: one overlooking the table and one on the wrist. Cubes are found by colour.Working
1PlanCube positions are mapped from pixels to table coordinates, and a move is planned to group cubes by colour.Working
2ActEvery motion goes through SafeArm, a guard layer that checks every move before the arm makes it. It is kept separate from whatever proposes the move.Working
3CheckBefore closing, the wrist camera re-centres on the cube. After closing, the gripper’s width says whether anything is held.Working, by proxy
4KeepAfter a held pick, it saves its updated wrist-camera mappings and the gap between where it expected the cube and where it found it.Saves; not yet shown to help

One real run, frame by frame

All 31 frames the wrist camera saved during one run, with what the log recorded at each point. Press play. (The software calls the blue cubes “purple”.)

In [3]:
run = load_run("2026-10-23 17:24")    # 31 wrist-camera frames, 105 log events
replay(run)
Out[3]:
Wrist camera, grouping run, frame 1 of 31t = 0.0 s · frame 1/31
Scan

Ten wrist-camera poses across the table. Four cubes detected in view.

Outcome Stuck. One cube moved; the task wasn’t finished.

In [4]:
run.log.tail(6)
17:25:17  close          pct=0.4  held=False
17:25:23  close          pct=0.4  held=False
17:25:25  wrist_too_far  mm=52
17:25:27  miss           name=purple  in_a_row=1
17:25:27  stuck          reason="no stray block can be picked safely or has a free slot"
17:25:31  end            moved=1

One supervised grasp

Afterwards, one careful grasp with me beside the arm: stop at the first miss, no retries. Click through the steps.

In [5]:
step_through(load_run("2026-10-23 18:15"))
Out[5]:
Wrist camera: Above
Wrist camera
Overview camera: Above
Overview camera

Hovers over the front green cube, the one with nothing next to it.

On video

Filmed on a phone the same day. No sound.

In [6]:
videos("2026-10-23")
Out[6]:
15:23 A miss. Aiming for a lone green cube, the arm swings past it and lifts away without picking it up.
17:02 A two-high stack, done by the arm on its own: it sets a yellow cube on top of another. One stack on camera, not yet a repeatable result.
17:23 Scanning the field: the wrist camera sweeps over six cubes, a minute before the run in the replay above.

What it sees

The overview camera finds cubes by colour, maps them onto the table, and plans moves on a top-down map.

In [7]:
show(colour_masks, planned_move, table_map, reach_area)
Out[7]:

What it keeps between runs

Everything the arm adjusts, and whether it survives a restart.

In [8]:
arm.memory.summary()
Out[8]:
what it adjustskept after a restartcaveat
0Where table points appear in the overview cameraYesWhether the final fit uses only verified points hasn’t been checked.
1How wrist-camera pixels shift when the arm movesYes, after a held pickNo test yet shows each update helps.
2Where the cube should sit in the wrist image before closingYesSuccess is judged by gripper width alone; slip and force aren’t measured.
3The wrist-scan map from image to tableYesA homography (a map from image positions to table positions) from 13 pairs: 3.3 mm typical and 12.7 mm worst error, leave-one-out (each point tested against a fit made without it).
4Corrections from past picksYes, the last 60Applied only once 2 sit within 100 mm. There is 1 so far.
5Cubes it failed to pickThis run onlyA skip list, not a learned behaviour.

It doesn’t learn a general manipulation policy yet. Saving works; whether it makes the next attempt better hasn’t been tested.

Numbers so far

In [9]:
metrics(run)
Out[9]:
22.8 sone successful move: pick, carry, release
15.4 sthe failed pick, plan to miss
11.4 smedian ten-pose wrist scan, 3 scans
1 of 2pick attempts held, latest run
1 of 4closes that held, latest run
6 of 8earlier look-before-grab attempts held, from project notes

One run, not a reliability estimate. No task has been completed yet under a fixed benchmark.

What the logs corrected

Reviewing the raw logs against the notes turned up three things the notes had wrong.

  1. The scan map isn’t quadratic. The handover notes said it was. The saved calibration is a homography from 13 point pairs; the quadratic fit only starts at 15.
  2. The angle error is 30°, not 26°. Two logged calibrations put the cube’s reference angle at −18.8° and +40.9°. Allowing for a cube’s 90° symmetry, that’s 30.3° apart.
  3. “All grouped” could be logged when it wasn’t. In the code, a run can report every cube grouped when the planner just finds no safe move. It didn’t cause this run’s failure, but completion signals can’t be trusted until it’s fixed.

The road to helping someone

Gates I’ve set for myself, not finished milestones. Each one needs measured evidence before the next.

  • 0
    Reproducible baselinein progress

    Tell grouped, stuck and missed apart, and snapshot code and calibration for every run.

  • 1
    Reliable cubesin progress

    18 of 20 fixed picks held and placed, then 5 layouts in a row with no help.

  • 2
    Learning that holds up

    A learned version beats a frozen one on 20 unseen picks, and survives a restart.

  • 3
    An empty cup

    Pick up, carry and return an unbreakable cup, kept upright.

  • 4
    Drinking and feeding, on a bench

    With a mock recipient, measuring spills, contact and failures.

  • 5
    A person

    Only after all of the above, with consent, an easy way to pause, and qualified review.