# pitraclm/pitrac architecture

> Architecture diagram of the GitHub repository pitraclm/pitrac, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pitraclm/pitrac
- Repository: https://github.com/pitraclm/pitrac

## Overview

PiTrac is a Raspberry Pi golf launch monitor: cameras capture images, image-processing software estimates ball launch and spin, and results can be used by golf simulators or the web dashboard. The web server also manages configuration, calibration, diagnostics, and updates. The graph preserves these documented capabilities while distinguishing the sampled web-server orchestration from the mostly unsampled C++ runtime. Arrows are limited to relationships visible in the excerpts or source index; the internal image-processing flow is therefore not asserted.

Main entry points: [`Software/web-server/server.py`](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/server.py) (Dashboard API), [`Software/LMSourceCode/ImageProcessing/golf_ball.cpp`](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/golf_ball.cpp) (Ball and spin estimates), [`Software/web-server/pitrac_manager.py`](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/pitrac_manager.py) (PiTrac process manager), [`Software/web-server/calibration_manager.py`](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/calibration_manager.py) (Camera calibration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web dashboard"]
  node_server["Dashboard API<br/>[server.py]"]
  node_ui["Dashboard interface<br/>[dashboard.js]"]
end

subgraph group_operations["Device operations"]
  node_config["Configuration manager<br/>[config_manager.py]"]
  node_process["PiTrac process manager<br/>[pitrac_manager.py]"]
  node_calibration["Camera calibration"]
  node_charuco["Charuco detection"]
  node_camera_detect["Camera detection<br/>[camera_detector.py]"]
  node_strobe["Strobe calibration"]
  node_testing["Diagnostic tools"]
  node_updates["Update manager<br/>[update_manager.py]"]
end

subgraph group_vision["Capture and vision"]
  node_camera["Camera hardware"]
  node_capture["Camera capture<br/>[rpicam_app.cpp]"]
  node_ball_processing["Ball image processing"]
  node_ball_model["Ball and spin estimates<br/>[golf_ball.cpp]"]
  node_config_cpp["Runtime configuration"]
  node_logging["Image and event logging<br/>[logging_tools.h]"]
end

subgraph group_results["Results and integrations"]
  node_gspro["GSPro interface"]
  node_e6["E6 interface"]
  node_standalone["Standalone web app<br/>[server.py]"]
end

node_user(("Builder / operator"))
node_simulators["Golf simulators"]

node_user -.->|"uses dashboard"| node_server
node_server -->|"routes configuration"| node_config
node_server -->|"manages process"| node_process
node_server -->|"routes calibration"| node_calibration
node_server -->|"routes diagnostics"| node_testing
node_server -->|"manages calibration"| node_strobe
node_server -->|"broadcasts updates"| node_updates
node_calibration -->|"uses detector"| node_charuco
node_process -->|"reads settings"| node_config
node_user -.->|"captures golf shots"| node_camera
node_camera -.->|"supplies images"| node_capture
node_capture -.->|"processes images"| node_ball_processing
node_ball_processing -.->|"estimates ball motion"| node_ball_model
node_ball_model -.->|"provides shot results"| node_gspro
node_ball_model -.->|"provides shot results"| node_e6
node_gspro -->|"interfaces with"| node_simulators
node_e6 -->|"interfaces with"| node_simulators
node_user -.->|"views results"| node_standalone

click node_server "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/server.py"
click node_ui "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/static/js/dashboard.js"
click node_config "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/config_manager.py"
click node_process "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/pitrac_manager.py"
click node_calibration "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/calibration_manager.py"
click node_charuco "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/charuco_detector.py"
click node_camera_detect "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/camera_detector.py"
click node_strobe "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/strobe_calibration_manager.py"
click node_testing "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/testing_tools_manager.py"
click node_updates "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/update_manager.py"
click node_camera "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/camera_hardware.cpp"
click node_capture "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/core/rpicam_app.cpp"
click node_ball_processing "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/ball_image_proc.cpp"
click node_ball_model "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/golf_ball.cpp"
click node_config_cpp "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/configuration_manager.cpp"
click node_logging "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/logging_tools.h"
click node_gspro "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/gs_gspro_interface.cpp"
click node_e6 "https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/gs_e6_interface.cpp"
click node_standalone "https://github.com/pitraclm/pitrac/blob/main/Software/web-server/server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_ui toneBlue
class node_config,node_process,node_calibration,node_charuco,node_camera_detect,node_strobe,node_testing,node_updates toneAmber
class node_camera,node_capture,node_ball_processing,node_ball_model,node_config_cpp,node_logging toneMint
class node_gspro,node_e6,node_standalone toneRose
class node_user,node_simulators toneIndigo
```

## Components

### Web dashboard

- [Dashboard API](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/server.py): `Software/web-server/server.py`
- [Dashboard interface](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/static/js/dashboard.js): `Software/web-server/static/js/dashboard.js`

### Device operations

- [Configuration manager](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/config_manager.py): `Software/web-server/config_manager.py`
- [PiTrac process manager](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/pitrac_manager.py): `Software/web-server/pitrac_manager.py`
- [Camera calibration](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/calibration_manager.py): `Software/web-server/calibration_manager.py`
- [Charuco detection](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/charuco_detector.py): `Software/web-server/charuco_detector.py`
- [Camera detection](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/camera_detector.py): `Software/web-server/camera_detector.py`
- [Strobe calibration](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/strobe_calibration_manager.py): `Software/web-server/strobe_calibration_manager.py`
- [Diagnostic tools](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/testing_tools_manager.py): `Software/web-server/testing_tools_manager.py`
- [Update manager](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/update_manager.py): `Software/web-server/update_manager.py`

### Capture and vision

- [Camera hardware](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/camera_hardware.cpp): `Software/LMSourceCode/ImageProcessing/camera_hardware.cpp`
- [Camera capture](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/core/rpicam_app.cpp): `Software/LMSourceCode/ImageProcessing/core/rpicam_app.cpp`
- [Ball image processing](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/ball_image_proc.cpp): `Software/LMSourceCode/ImageProcessing/ball_image_proc.cpp`
- [Ball and spin estimates](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/golf_ball.cpp): `Software/LMSourceCode/ImageProcessing/golf_ball.cpp`
- [Runtime configuration](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/configuration_manager.cpp): `Software/LMSourceCode/ImageProcessing/configuration_manager.cpp`
- [Image and event logging](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/logging_tools.h): `Software/LMSourceCode/ImageProcessing/logging_tools.h`

### Results and integrations

- [GSPro interface](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/gs_gspro_interface.cpp): `Software/LMSourceCode/ImageProcessing/gs_gspro_interface.cpp`
- [E6 interface](https://github.com/pitraclm/pitrac/blob/main/Software/LMSourceCode/ImageProcessing/gs_e6_interface.cpp): `Software/LMSourceCode/ImageProcessing/gs_e6_interface.cpp`
- [Standalone web app](https://github.com/pitraclm/pitrac/blob/main/Software/web-server/server.py): `Software/web-server/server.py`

### Other components

- **Builder / operator**
- **Golf simulators**

## Connections

- Builder / operator → Dashboard API: uses dashboard (evidence: `README.md`)
- Dashboard API → Configuration manager: routes configuration (evidence: `Software/web-server/server.py`)
- Dashboard API → PiTrac process manager: manages process (evidence: `Software/web-server/server.py`)
- Dashboard API → Camera calibration: routes calibration (evidence: `Software/web-server/server.py`)
- Dashboard API → Diagnostic tools: routes diagnostics (evidence: `Software/web-server/server.py`)
- Dashboard API → Strobe calibration: manages calibration (evidence: `Software/web-server/server.py`)
- Dashboard API → Update manager: broadcasts updates (evidence: `Software/web-server/server.py`)
- Camera calibration → Charuco detection: uses detector (evidence: `Software/web-server/calibration_manager.py`)
- PiTrac process manager → Configuration manager: reads settings (evidence: `Software/web-server/pitrac_manager.py`)
- Builder / operator → Camera hardware: captures golf shots (evidence: `README.md`)
- Camera hardware → Camera capture: supplies images
- Camera capture → Ball image processing: processes images
- Ball image processing → Ball and spin estimates: estimates ball motion
- Ball and spin estimates → GSPro interface: provides shot results (evidence: `README.md`)
- Ball and spin estimates → E6 interface: provides shot results (evidence: `README.md`)
- GSPro interface → Golf simulators: interfaces with (evidence: `README.md`)
- E6 interface → Golf simulators: interfaces with (evidence: `README.md`)
- Builder / operator → Standalone web app: views results (evidence: `README.md`)
