Skip to content

Commit 9d19814

Browse files
committed
completed LB6
1 parent 0f8a816 commit 9d19814

4 files changed

Lines changed: 18 additions & 16 deletions

File tree

docs/arrows/tracking-engine.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ Computes continuous 6-DOF pose and velocity for tracked objects by fusing lighth
6060
| Poser interface | TE-API-001 to 005 | 5 | 0 | 0 |
6161
| Geometric pose solvers | TE-PROC-010 to 015 | 6 | 0 | 0 |
6262
| MPFIT optimizer | TE-PROC-020 to 025 | 6 | 0 | 0 |
63-
| Kalman object tracker | TE-PROC-030 to 042 | 10 | 3 | 0 |
63+
| Kalman object tracker | TE-PROC-030 to 042 | 13 | 0 | 0 |
6464
| Kalman lighthouse tracker | TE-PROC-050 to 051 | 2 | 0 | 0 |
6565
| Reprojection model | TE-DATA-050 to 053 | 4 | 0 | 0 |
6666
| Math infrastructure | TE-DATA-060 to 064 | 4 | 1 | 0 |
6767

68-
**Summary:** 37 of 41 active specs implemented; 4 active gaps (3 angular-rate gates TE-PROC-040/041/042, plus CI guard for codegen TE-DATA-064); 0 deferred.
68+
**Summary:** 40 of 41 active specs implemented; 1 active gap (CI guard for codegen TE-DATA-064); 0 deferred.
6969

7070
## Key Findings
7171

docs/launch-readiness-triage.2026-04-17.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
33 open items in the libsurvive docs, bucketed by shoot-readiness impact.
1010

11-
- 6 **launch blockers** — silent corruption or grey failures (LB-1/LB-2/LB-4/LB-5 done; LB-3 deferred to on-Pi recording milestone; LB-6 open)
11+
- 6 **launch blockers** — silent corruption or grey failures (LB-1/LB-2/LB-4/LB-5/LB-6 done pending deploy; LB-3 deferred to on-Pi recording milestone)
1212
- 5 **should fix before launch** — diagnosability gaps
1313
- 7 **nice to have** — robustness / dev hygiene
1414
- 8 **save for later** — irrelevant to stagehand (third-party bindings)
@@ -43,14 +43,15 @@ Each item either (a) lets bad data through without visibility, or (b) makes on-s
4343
- Bonus cleanup: `src/test_cases/residual_cascade_props.c:781` referenced `TE-PROC-040` but described the per-LH adaptive R formula → corrected to `TE-PROC-038`.
4444
- Arrow doc updated: tracking-engine.md spec count 36→41, Kalman object tracker row now 030–042 (10 impl, 3 gaps), Kalman lighthouse tracker row now 050–051.
4545

46-
- [ ] **LB-6 — Measure + enable pose-emission gates** (`kalman-max-pose-angular-rate`, `--light-max-error`)
46+
- [x] **LB-6 — Measure + enable pose-emission gates** (`kalman-max-pose-angular-rate`, `--light-max-error`)**pending on-tracker verification**
4747
- Category: **operational safety / fail-closed on output**
48-
- From [reflection-rejection.md](../reflection-rejection.md) bottom checklist. Orthogonal to existing input-side defenses.
49-
- Without these, a reflection that slips past `light-outlier-threshold` + `filter-normal-facingness` reaches the output stream.
50-
- Fix:
51-
- [ ] Run `reflect_test.cap` with `--survive-verbose 105`, record per-pose angular rates during reflection bursts and clean tracking.
52-
- [ ] Set `--kalman-max-pose-angular-rate` from the data (expected 5–10 rad/s).
53-
- [ ] Enable `--light-max-error 0.01` in the agent config.
48+
- Empirical data from [reflection-rejection.md](reflection-rejection.md): smallest reflection jump 30°/frame → ~31 rad/s at 60 Hz; clean tracker <1 rad/s. Sufficient to pick thresholds without new captures.
49+
- Config updated 2026-04-17 in [scripts/stagehand-health](../../stagehand/scripts/stagehand-health) `DEFAULT_SURVIVE_ARGS`:
50+
- `--kalman-max-pose-angular-rate 10.0` (pose-emission gate, comfortably below 31 rad/s reflections, well above <1 rad/s clean)
51+
- `--light-max-error 0.01` (per-sensor reprojection-error gate)
52+
- Unit typo fix in [reflection-rejection.md:360-363](reflection-rejection.md): "3.1 rad/s" → "31 rad/s" (factor-of-10 error; 30° × 60 Hz = 0.524 rad × 60 = 31.4 rad/s).
53+
- Spec updates: TE-PROC-040/041/042 marked `[x]` — the code for both gates already existed ([survive_kalman_tracker.c](../../libsurvive/src/survive_kalman_tracker.c)); flags were just defaulted off.
54+
- **Remaining**: deploy to both Pis and verify trackers still work.
5455

5556
## Should Fix Before Launch
5657

docs/reflection-rejection.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,10 @@ lowering the suppress-threshold to something high like 10000 to log without reje
357357
This gives the distribution of angular rates during a clean tracking session. The gate threshold
358358
should be set above the 99th percentile of clean rates and below the smallest reflection jump.
359359

360-
From the empirical data, the smallest reflection jump was 30° in one frame. At 60 Hz that's ~3.1
361-
rad/s. A clean tracker should be well below 1 rad/s in normal VP operation. Start the gate at
362-
**5–10 rad/s** and adjust.
360+
From the empirical data, the smallest reflection jump was 30° in one frame. At 60 Hz that's ~31
361+
rad/s (0.524 rad × 60 fps). A clean tracker should be well below 1 rad/s in normal VP operation.
362+
Start the gate at **5–10 rad/s** — comfortably below the smallest reflection (31 rad/s) and well
363+
above clean tracking (<1 rad/s).
363364

364365
### Step 2 — Verify normal filter rejection
365366

docs/specs/tracking-engine-specs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ Prefix: **TE**
4040
- [x] **TE-PROC-037**: When tracking is lost (no valid measurements for the configured timeout period), the system shall reset the Kalman state covariance to reflect high uncertainty.
4141
- [x] **TE-PROC-038**: The system shall scale each lighthouse's observation noise covariance R by the ratio of that lighthouse's EWMA residual to the fleet mean residual, so that lighthouses with above-average residuals receive proportionally less Kalman weight.
4242
- [x] **TE-PROC-039**: Where `light-outlier-threshold` is > 0, the system shall compute the pre-update RMS innovation for each lighthouse batch and skip that lighthouse's Kalman update for the current sync cycle if the RMS exceeds `light-outlier-threshold × light_residuals_all`.
43-
- [ ] **TE-PROC-040**: Where `lc-angular-rate-max` is > 0, the system shall predict the Kalman pose at each incoming lightcap batch's timestamp and compute the angular rate implied by the rotation change from the last accepted batch; if the rate exceeds `lc_angular_rate_max` rad/s the entire batch shall be dropped without modifying the Kalman state.
44-
- [ ] **TE-PROC-041**: When a lightcap batch passes the `lc-angular-rate-max` gate, the system shall update `last_accepted_lc_rot` and `last_accepted_lc_time` to the predicted pose at that batch's timestamp, so subsequent batches are gated against a current reference.
45-
- [ ] **TE-PROC-042**: Where `kalman-max-pose-angular-rate` is > 0, the system shall compute the angular rate between the current predicted pose and the last emitted pose; if the rate exceeds `kalman-max-pose-angular-rate` rad/s the system shall suppress pose emission for that frame and increment `stats.dropped_poses` without modifying the Kalman state.
43+
- [x] **TE-PROC-040**: Where `lc-angular-rate-max` is > 0, the system shall predict the Kalman pose at each incoming lightcap batch's timestamp and compute the angular rate implied by the rotation change from the last accepted batch; if the rate exceeds `lc_angular_rate_max` rad/s the entire batch shall be dropped without modifying the Kalman state.
44+
- [x] **TE-PROC-041**: When a lightcap batch passes the `lc-angular-rate-max` gate, the system shall update `last_accepted_lc_rot` and `last_accepted_lc_time` to the predicted pose at that batch's timestamp, so subsequent batches are gated against a current reference.
45+
- [x] **TE-PROC-042**: Where `kalman-max-pose-angular-rate` is > 0, the system shall compute the angular rate between the current predicted pose and the last emitted pose; if the rate exceeds `kalman-max-pose-angular-rate` rad/s the system shall suppress pose emission for that frame and increment `stats.dropped_poses` without modifying the Kalman state.
4646

4747
## Kalman Lighthouse Tracker
4848

0 commit comments

Comments
 (0)