IDD-60: Proactive assistant B1 — hazard detection, voice output, RPi5+OAK-D integration#58
Open
zd87pl wants to merge 3 commits into
Open
IDD-60: Proactive assistant B1 — hazard detection, voice output, RPi5+OAK-D integration#58zd87pl wants to merge 3 commits into
zd87pl wants to merge 3 commits into
Conversation
- deploy/oak-rpi5/app/proactive_engine.py: ProactiveEngine class that classifies OAK-D Lite detections into IMMEDIATE / WARNING / INFORMATIONAL tiers, ranks simultaneous hazards by distance × severity, and suppresses repeat alerts via per-class cooldown + distance-band escalation - Alert objects carry category, label, distance_m, direction, priority, and speech_text ready for TTS - Center-40%-of-frame path estimation; overhead / already-passed objects suppressed automatically - tests/test_proactive_engine.py: 32 tests covering all engine behaviour Co-Authored-By: Paperclip <noreply@paperclip.ing>
- demo_spatial/app/proactive_voice.py: new ProactiveVoice class that consumes Alert objects from ProactiveEngine and speaks them through TTS with asyncio priority queuing (IMMEDIATE=0 > WARNING=1 > QUERY=2 > INFO=3), VAD-aware suppression (set_user_speaking), and spatial memory enrichment for informational alerts (appends where tracked objects were last seen) - VoiceMode enum: GUIDE / QUIET / REACTIVE with parse_mode_intent() - Interrupt logic: higher-priority alert cancels in-flight lower-priority speech - Scene summary: one-shot "what's around me?" from spatial memory - voice_pipeline.py: extend parse_intent() and build_response_text() with mode_guide / mode_quiet / scene_summary intents - tests/test_proactive_voice.py: 53 tests covering all new behaviour Co-Authored-By: Paperclip <noreply@paperclip.ing>
- deploy/oak-rpi5/app/oak_pipeline.py: OakPipeline (hardware, DepthAI) and OakSimPipeline (synthetic desk scenarios) with OakDetection / OakFrame data model; OakUnavailable raised when depthai not installed; _FPSEstimator rolling-window FPS tracking - deploy/oak-rpi5/proactive_main.py: single entry point integrating OakPipeline → ProactiveEngine → ProactiveVoice; asyncio camera loop runs pipeline in executor thread; STT loop handles voice commands (guide me / quiet mode / where are my keys?); PerfTracker measures p50/p95 alert latency and FPS with warnings at <10 FPS / >200ms; power telemetry loop logs RSS and RPi5 PMIC power draw to CSV every 10s; --sim flag for hardware-free development - tests/test_proactive_main.py: 22 tests covering OakSimPipeline lifecycle, scenario cycling, noise bounds, PerfTracker, ProactiveApp startup/shutdown, alert production in guide mode, alert suppression in quiet mode, mode switching via handle_mode_command, and power helpers Co-Authored-By: Paperclip <noreply@paperclip.ing>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full B1 milestone for the proactive assistant on RPi5 + OAK-D Lite hardware:
deploy/oak-rpi5/app/proactive_engine.py: hazard detection engine with 3-tier severity classification and per-object cooldown to suppress repeat alertsdeploy/oak-rpi5/app/proactive_voice.py: proactive voice output with guide/quiet mode switching and STT command dispatch (guide me,quiet mode,where are my keys?)deploy/oak-rpi5/proactive_main.py+deploy/oak-rpi5/app/oak_pipeline.py: singleproactive_main.pyentry point integrating OAK-D Lite → hazard engine → voice output with asyncio loop,--simflag for hardware-free dev, PerfTracker (p50/p95 latency + FPS warnings), and power/RSS telemetry to CSVTest plan
test_proactive_engine.py,test_proactive_voice.py,test_proactive_main.py)python proactive_main.pyto validate)🤖 Generated with Claude Code