How anurag-mitti/eyantra-ai-in-smart-mirror works
This is a local C++ smart-mirror physiotherapy engine. A RealSense camera supplies frames for pose inference; exercise-specific detectors derive movement metrics, state machines track form and repetitions, and the engine updates session statistics while streaming telemetry to a mirror UI. The README documents the camera, NEON conversion, MediaPipe, FSM, session, and WebSocket capabilities. Some internal wiring is supported only by that documentation and the source index; unsampled implementation details are not inferred.
Main entry points: detector_factory.hpp Detector factory · fsm_factory.hpp FSM factory · main.cpp Engine orchestration · pose_tracker.hpp Pose tracker
Components 24
Vision pipeline
- V4L2 capture
src/core/realsense_mmap.hpp - NEON math
src/core/neon_math.hpp - Pose tracker
src/pose_tracker.hpp - Kalman filter
src/core/kalman_filter.hpp
Exercise metrics
- Detector factory
src/detectors/detector_factory.hpp - Detector base
src/detectors/base_detector.hpp - Squat detector
src/detectors/squat_detector.hpp - Pendulum detector
src/detectors/pendulum_detector.hpp - Shoulder detector
src/detectors/shoulder_circle_detector.hpp - Sit-stand detector
src/detectors/sit_to_stand_detector.hpp - Trap detector
src/detectors/upper_trap_detector.hpp
Exercise state
- FSM factory
src/fsm/fsm_factory.hpp - FSM base
src/fsm/base_fsm.hpp - Squat FSM
src/fsm/squat_fsm.hpp - Pendulum FSM
src/fsm/pendulum_fsm.hpp - Shoulder FSM
src/fsm/shoulder_circle_fsm.hpp - Sit-stand FSM
src/fsm/sit_to_stand_fsm.hpp - Trap FSM
src/fsm/upper_trap_fsm.hpp
Runtime and telemetry
- Engine orchestration
src/main.cpp - Session tracker
src/fsm/session_tracker.hpp - Session report
src/fsm/session_tracker.hpp - WebSocket broadcaster
src/net/networking.hpp
Other components
- RealSense camera
- Smart mirror UI
Connections 31
- RealSense camera → V4L2 capture: streams frames
README.md - V4L2 capture → Pose tracker: supplies frames
README.md - NEON math → Pose tracker: converts frames
README.md - Pose tracker → Kalman filter: smooths metrics
src/pose_tracker.hpp - Pose tracker → Detector factory: selects detector
src/pose_tracker.hpp - Engine orchestration → Pose tracker: runs inference
src/main.cpp - Engine orchestration → Detector factory: changes exercise
src/main.cpp - Detector factory → Squat detector: creates
src/detectors/detector_factory.hpp - Detector factory → Pendulum detector: creates
src/detectors/detector_factory.hpp - Detector factory → Shoulder detector: creates
src/detectors/detector_factory.hpp - Detector factory → Sit-stand detector: creates
src/detectors/detector_factory.hpp - Detector factory → Trap detector: creates
src/detectors/detector_factory.hpp - Detector base → NEON math: uses geometry
src/detectors/base_detector.hpp - Engine orchestration → FSM factory: creates FSM
src/main.cpp - FSM factory → Squat FSM: creates
src/fsm/fsm_factory.hpp - FSM factory → Pendulum FSM: creates
src/fsm/fsm_factory.hpp - FSM factory → Shoulder FSM: creates
src/fsm/fsm_factory.hpp - FSM factory → Sit-stand FSM: creates
src/fsm/fsm_factory.hpp - FSM factory → Trap FSM: creates
src/fsm/fsm_factory.hpp - Engine orchestration → Session tracker: updates metrics
src/main.cpp - Session tracker → Session report: saves report
src/fsm/session_tracker.hpp - Engine orchestration → WebSocket broadcaster: broadcasts state
src/main.cpp - WebSocket broadcaster → Smart mirror UI: streams telemetry
README.md - Smart mirror UI → WebSocket broadcaster: sends commands
README.md - WebSocket broadcaster → Engine orchestration: delivers commands
src/main.cpp - Pose tracker → Detector base: processes landmarks
- Squat FSM → FSM base: implements
src/fsm/squat_fsm.hpp - Pendulum FSM → FSM base: implements
src/fsm/pendulum_fsm.hpp - Shoulder FSM → FSM base: implements
src/fsm/shoulder_circle_fsm.hpp - Sit-stand FSM → FSM base: implements
src/fsm/sit_to_stand_fsm.hpp - Trap FSM → FSM base: implements
src/fsm/upper_trap_fsm.hpp