Document mapping the LEDs end to end
Assisted-by: Claude Opus 5.5 via Claude Code
change vympqwkxoysutvvzpzmskwqooyqmywsy
commit e79208d0fc854cf4df17df58a6c1599821e9bf93
author Alpha Chen <alpha@kejadlen.dev>
date
parent mzrvvmlm
diff --git a/README.md b/README.md
index 37915d8..cd2a0f2 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,51 @@ The goal is to record each LED's 3D position, so effects can be computed from
 where the lights *are* rather than where they sit on the wire. The plan is to
 do the mapping with an iPhone Pro (ARKit + LiDAR) and a WLED-driven string.
 
+## Map the LEDs
+
+Mapping produces `leds.csv`: one row per LED with its position in meters (see
+[`firmament/SPEC.md`](firmament/SPEC.md#led-positions)). You need Nix, WLED
+on the network, and an iPhone Pro with
+[Stray Scanner](https://github.com/strayrobots/scanner) installed. Run the
+commands from `firmament/`, inside the repository's dev shell
+(`nix develop ..`).
+
+1. Play the ID pattern on the LEDs, and leave it running:
+
+   ```sh
+   uv run firmament play --host wled.local --leds 50
+   ```
+
+   Replace `wled.local` with your WLED's hostname or IP address, and `50` with
+   the number of LEDs.
+2. Record in Stray Scanner. Start with the phone facing the LEDs, because the
+   map's axes come from where the recording starts: x to the right, y up, and z
+   back toward you. Then walk slowly around the front of the LEDs for at least
+   4.2 s, two cycles of the pattern.
+3. Press Ctrl-C to stop the player.
+4. Copy the recording's folder from the phone into `data/`, which is ignored
+   by version control. Connect the phone to the Mac, select it in Finder's
+   sidebar, open the Files tab, and drag the folder out from under Stray
+   Scanner. Stray Scanner names the folder after a random hash, such as
+   `fb770bb311`.
+5. Find the LED positions, with the same LED count you played:
+
+   ```sh
+   uv run firmament solve ../data/fb770bb311 --leds 50
+   ```
+
+   `solve` writes `leds.csv` into the recording's folder (`--out` changes
+   this) and reports how many LEDs it placed. It fills in each LED it couldn't
+   identify by interpolating along its strand, and gives it 0 in the `views`
+   column. Set `--strand-length` if your strands aren't 50 LEDs long.
+6. Check the map by playing an effect in a 3D preview:
+
+   ```sh
+   uv run firmament stream examples/wipe.py --map ../data/fb770bb311/leds.csv --preview
+   ```
+
+[`firmament/README.md`](firmament/README.md) covers each command's options.
+
 ## Layout
 
 | Path | What's there |
@@ -24,17 +69,17 @@ do the mapping with an iPhone Pro (ARKit + LiDAR) and a WLED-driven string.
 | [`notes/mapping-existing-solutions.md`](notes/mapping-existing-solutions.md) | Survey of existing 3D LED mapping tools |
 | [`notes/mapping-arkit-approach.md`](notes/mapping-arkit-approach.md) | Why and how to use ARKit for mapping |
 | [`notes/porch-festoon.md`](notes/porch-festoon.md) | Separate project: a smart porch festoon (research stage) |
-| [`firmament/`](firmament/) | The mapping app (pattern player built; the rest is design only) |
+| [`firmament/`](firmament/) | The mapping app: pattern player, solver, and effect streamer |
 
 ## Status
 
 - Research and notes: written (2026-11-14), compiled from a web research
   session plus earlier chats from October and November 2026.
-- `firmament/`: the spec and the DDP pattern player are written; the player
-  hasn't run against the tree yet.
-- Next steps (see [`firmament/DESIGN.md`](firmament/DESIGN.md#plan)): run the
-  pattern player on the tree, then a tracking spike to see whether ARKit
-  tracking survives a dim room with the pattern running.
+- `firmament/`: mapped a single 50-LED strand in daylight (2026-11-22).
+  `solve` placed 34 of the 50 LEDs from a 10.8 s Stray Scanner walk and
+  interpolated the rest. Nothing has run against the tree yet.
+- Next steps (see [`firmament/DESIGN.md`](firmament/DESIGN.md#plan)): map the
+  tree in a dim room, to see whether ARKit tracking survives it.
 
 ## A note on provenance
 
diff --git a/firmament/README.md b/firmament/README.md
index ce29dab..5f449c4 100644
--- a/firmament/README.md
+++ b/firmament/README.md
@@ -7,10 +7,13 @@ The name: a sky full of points of light, each with a coordinate.
 
 ## Status
 
-The pattern player is built and checked on a single strand. The streamer plays
-effect files from a positions file. The solver is a prototype outside the
-repository, and everything else is design only. See [`DESIGN.md`](DESIGN.md) for the
-plan and [`SPEC.md`](SPEC.md) for the pattern and session format.
+The pattern player is built and checked on a single strand. The solver maps a
+Stray Scanner recording, standing in for the iPhone recorder, without the
+priors or bundle adjustment the design calls for. The streamer plays effect
+files from the solver's positions file. Everything else is design only. See
+[`DESIGN.md`](DESIGN.md) for the plan and [`SPEC.md`](SPEC.md) for the pattern
+and session format, and the [top-level README](../README.md#map-the-leds) for
+mapping end to end.
 
 ## Run the pattern player
 
@@ -35,6 +38,25 @@ uv run firmament light --host wled.local --leds 500 --strand 5
 
 `--level` sets the brightness of a lit LED, from 0 to 255 (default 32).
 
+## Find the LED positions
+
+`solve` reads a [Stray Scanner](https://github.com/strayrobots/scanner)
+recording of the ID pattern and writes a positions file in the
+[`leds.csv`](SPEC.md#led-positions) format:
+
+```sh
+uv run firmament solve ../data/fb770bb311 --leds 50
+```
+
+`--leds` must match the count the pattern was played on. The file goes in the
+recording's folder unless `--out` names another path. `solve` finds each LED
+lit in a cycle's all-on slot and places it from its depth and the camera pose.
+Then it follows that point through the rest of the cycle to read the LED's
+ID. Each cycle that reads an LED's ID counts as one view. `solve` interpolates
+an LED it never read along its strand, `--strand-length` LEDs long (default
+50). A strand with fewer than 2 placed LEDs is interpolated from the nearest
+placed LEDs on other strands, and `solve` names it.
+
 ## Play an effect
 
 An effect is a Python file that defines `color(led, t)`. It gets one LED and