Skip to content

feat: edge margin for entry and submersion, from the first armed footage - #34

Merged
pizzasaurusrex merged 7 commits into
mainfrom
feat/edge-margin
Nov 16, 2026
Merged

pizzasaurusrex merged 7 commits into
mainfrom
feat/edge-margin

Conversation

@pizzasaurusrex

Copy link
Copy Markdown
Owner

Summary

Follow-up to #33, tested against the first armed footage recorded live from the SimpliSafe camera (both clips cover on, kept local). These commits were pushed to feat/entry-rule after #33 had already merged, so they never reached main; this PR carries them over.

Where a person stands, not the middle of their box

  • in_water is judged at the foot point (bottom centre of the box). From the elevated camera, the box centre of someone standing on the coping projects over the water: the day walk-around raised 2 false entries that way.

Edge margin + person-at-edge warning

  • TrackedPerson.water_depth: the foot point's signed distance from the pool outline, in the person's own box heights (geometry.depth_inside).
  • RulesSettings.edge_margin = 0.2: entry and submersion both need depth past it. Measured: walking the coping reached at most +0.093; the one real swimmer never went below +0.53.
  • New PERSON_AT_EDGE event (warn tier, armed only, once per track) for feet within the margin on either side.
  • Accepted trade: someone who slips in at the very edge and is lost at once would not raise a submersion (armed, they still raise the edge warning). Fall-in footage is planned to measure this.
  • HUD entry count and submersion meter use the margin, so the overlay matches the rules.

Footage and labels

  • New camera profile backyard_simplisafe_2026_11 for the current mount (the camera moved again).
  • armed-cover-on-night.mp4 (60 s, IR) and armed-cover-on-day-walk.mp4 (240 s, Sean walks the deck and stands at every edge) labeled armed.

Docs: decision log entries, PLAN, a CLAUDE.md rule (rules judge position by water_depth against edge_margin), the fall-in shot plan (cover-on falls with a dummy only), and the SimpliSafe token-expiry note left over from #32.

Results

Clip Before After
Day walk-around, armed 2 false entries, 1 false submersion 0 emergencies, 5 edge warnings, all at the coping
Night, empty pool, armed quiet quiet
drowning-test.mp4, armed entry 1.0 s edge 0.0 s, entry 1.2 s, submersion 37.0 s
Six swim clips correct unchanged

Test plan

  • ruff check, ruff format --check
  • pytest (all extras); geometry, tracker, rules and HUD tests written first and seen failing
  • pytest -m regression: all 9 event verdicts pass. 3 known tracker failures: adult-exits headcount, phantom tracks on both armed clips
  • Not yet covered by footage: fall-in onto the cover (dummy), slip-in at the edge, a swimmer at the far wall

@pizzasaurusrex
pizzasaurusrex merged commit 15737a6 into main Nov 16, 2026
1 check passed
@pizzasaurusrex pizzasaurusrex mentioned this pull request Nov 16, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant