How bigheadg/mmwave works
Project type and purpose
• This is an SDK & Examples repository (not a monolithic full-stack web app).
• It hosts many demo sub-projects (DRN, HAM, LPD, PC3, … ZOD), each a Python (and sometimes Arduino) app that:
– Communicates with a Batman-Kit mmWave sensor over UART (or SPI/USB).
– Parses raw radar data frames.
– Runs domain-specific signal-processing algorithms (range‐profile, Doppler, point-cloud, occupancy, people counting, etc.).
– Visualizes results interactively using pyqtgraph (2D/3D plots).
– Optionally logs raw or processed data to CSV.
File structure
• Top-level directories: one per demo type (DRN, HAM, LPD, …, ZOD).
• Inside each:
– Python scripts (e.g., *_ex0.py, *_pyqtgraph*.py) for data‐acquisition, processing, UI.
– Some include Arduino sketches under an Arduino/ subfolder (for on-board configuration).
– README.md per demo explaining its purpose.
• Shared concerns:
– All Python scripts import the external mmWave library (mmWave pip package).
– Visualization uses pyqtgraph, PyQt5/Qt Widgets, numpy, pandas, scikit-learn.
– Serial comm uses pySerial (and optionally RPi.GPIO on Raspberry Pi).
– Build/deploy is manual: copy scripts to host (RPi/Jetson/Windows/Mac/NUC), install pip deps, enable UART.
Extract additional insights from the root README
• Lists all demo types and associated hardware requirements.
• Describes installation of dependencies (mmWave lib, tkinter, numpy, pandas, pyqtgraph, etc.).
• Mentions threading for UART reads, special handling for pyqtgraph v0.13.1, and workarounds for MQTT.
1) Hardware Layer (green):
– mmWave sensor modules (IWR6843-DRN, IWR1642-HAM, IWR6843-LPD, …).
– Host board (Raspberry Pi, Jetson Nano, Windows PC, Mac, Intel NUC).
2) Communication Layer (orange):
– UART interface (ttyS0/ttyAMA0) or SPI/USB link.
– pySerial / RPi.GPIO drivers.
3) Core SDK Layer (blue):
– mmWave Python library (frame decoder, API wrappers).
4) Application Layer (purple):
– Demo-specific Python scripts (threaded UART reader, data packet parser, algorithm module).
– Optional Arduino firmware for on-sensor config.
5) Processing & Analytics (yellow):
– Signal-processing routines (range FFT, Doppler processing, CFAR detection).
– Machine learning modules (scikit-learn for classification, clustering).
6) Visualization & UI (pink):
– pyqtgraph 2D/3D plotting components.
– PyQt5/QtWidgets event loop.
– tkinter (in some demos).
7) Storage & Logging (gray):
– CSV writers (pandas) for raw data or processed output.
8) External Services (if used):
– MQTT broker for remote telemetry (optional demos/troubleshooting).
– Hardware → Communication: raw data frames over UART.
– Communication → Core SDK: ring‐buffer or thread posts raw bytes to frame‐decoder.
– Core SDK → Application: passing parsed point cloud or radar metrics via Python API calls.
– Application → Processing: invoke signal-processing algorithms.
– Processing → Visualization: push numeric arrays or PyQt graph items to UI event loop.
– Application → Storage: write CSV files (logging thread or callback).
– Optionally, Application ↔ Arduino: configuration commands over serial.
– Optionally, Application → MQTT: publish telemetry.
c. Architectural patterns & design principles
– Layered architecture: hardware/comm → core SDK → application → UI.
– Pipeline pattern: data flows through acquisition → parsing → analytics → presentation.
– Modularity: each demo folder is a self-contained module relying on the common mmWave lib.
– Concurrency: separate threads for UART I/O vs. UI/event loop.
d. Key technologies & libraries:
– Python 3.6+
– mmWave (pip) library for sensor APIs
– pySerial, RPi.GPIO
– numpy, pandas, scikit-learn
– PyQt5 / tkinter / pyqtgraph for GUI and plotting
– Arduino IDE (INO files for sensor firmware)
Detail and coverage
• Entire pipeline from sensor to UI/storage.
• External dependencies (pip packages, hardware requirements) are shown.