Skip to content

feat: 4-phase stream lifecycle with live preview before recording - #4

Merged
styu12 merged 1 commit into
mainfrom
feat/oglo-tactile
Apr 11, 2026
Merged

feat: 4-phase stream lifecycle with live preview before recording#4
styu12 merged 1 commit into
mainfrom
feat/oglo-tactile

Conversation

@styu12

@styu12 styu12 commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Refactor all stream adapters (OAK, OGLO, synthetic demo) from a 2-phase start()/stop() lifecycle to a 4-phase SPI: prepare() → connect() → start_recording()/stop_recording() → disconnect(). This lets the viewer show live camera frames and sensor plots before the user presses Record.
  • Add CONNECTING, CONNECTED, and COUNTDOWN session states with a 3/2/1 countdown tick tone before the start chirp.
  • New full_rig/ example combining Mac webcam + iPhone + dual OAK + OGLO tactile glove (5 streams on one host).

Changes

  • adapters/oak_camera.py: 4-phase lifecycle, XLink enumeration retries for dual-OAK rigs, preview-only capture loop
  • adapters/oglo_tactile.py: 4-phase lifecycle, BLE scan matches both device.name and adv.local_name
  • types.py: New CONNECTING, CONNECTED, COUNTDOWN session states
  • tone.py: Countdown tick spec (100ms C6 beep), sounddevice warning upgraded from INFO → WARNING
  • viewer/fonts.py: (new) System font loader for non-ASCII viewer glyphs (●, ■, →, —)
  • viewer/app.py: Font loading at startup, session teardown on window close
  • viewer/state.py: Filter auxiliary channels (timestamps, _-prefixed) from sensor plot Y-axis
  • viewer/demo.py: All synthetic streams converted to 4-phase lifecycle, improved screenshot capture
  • discovery/_ble.py: Fixed _cache_lock_scan_lock bug in clear_cache()
  • examples/: New full_rig/ and mac_iphone_dual_oak/ READMEs, updated uv run instructions
  • tests/: Updated OAK and OGLO tests for 4-phase lifecycle, added preview vs recording counter tests

Test Plan

  • pytest tests/unit/adapters/test_oak_camera.py — 4-phase lifecycle, legacy compat, depth option
  • pytest tests/unit/adapters/test_oglo_tactile.py — payload decoding, preview sample isolation
  • pytest tests/unit/test_tone.py — countdown tick spec
  • Manual: run examples/full_rig/record.py with full hardware rig
  • Manual: run examples/mac_iphone_dual_oak/record.py and verify live preview → record → stop → re-record cycle

🤖 Generated with Claude Code

…ore recording

Squashed from feat/oglo-tactile branch (25 commits).
@styu12
styu12 force-pushed the feat/oglo-tactile branch from bbb6065 to 3d1bd84 Compare April 11, 2026 00:59
@styu12
styu12 merged commit 28ab05a into main Apr 11, 2026
0 of 4 checks passed
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