# shehababdelelah/autonomous-case-study- architecture

> Architecture diagram of the GitHub repository shehababdelelah/autonomous-case-study-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shehababdelelah/autonomous-case-study-
- Repository: https://github.com/shehababdelelah/autonomous-case-study-

## Overview

This is ESP32 firmware for the CAS Box, a sensor and control unit for a WAVE ROVER. The principal workflow is phone or serial input → box control loop → rover drive commands, with sensor snapshots and status available to the phone. Sensor acquisition, LiDAR navigation geometry, survey reporting, and test logging are distinct supporting capabilities. Edges reflect the sampled source and its index or explicit module documentation; unsampled wiring is not inferred.

Main entry points: [`src/Sensors.cpp`](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/Sensors.cpp) (Sensor facade), [`src/main.cpp`](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/main.cpp) (Control loop), [`src/WebHMI.cpp`](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/WebHMI.cpp) (Web HMI), [`src/NavSurvey.h`](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/NavSurvey.h) (Survey report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Control and interface"]
  node_main["Control loop<br/>[main.cpp]"]
  node_hmi["Web HMI<br/>[WebHMI.cpp]"]
  node_display["OLED display<br/>[DisplayManager.cpp]"]
  node_roverlink["Rover link<br/>[RoverLink.cpp]"]
end

subgraph group_sensing["Sensor acquisition"]
  node_sensors["Sensor facade<br/>[Sensors.cpp]"]
  node_ultrasonic["Ultrasonic manager<br/>[UsManager.cpp]"]
  node_lidarscan["LiDAR scan reader<br/>[LidarScan.h]"]
  node_gps["GPS manager<br/>[GpsManager.cpp]"]
  node_imu["IMU manager<br/>[ImuManager.cpp]"]
end

subgraph group_navigation["Navigation and survey"]
  node_navlidar["LiDAR geometry<br/>[NavLidar.h]"]
  node_navsurvey["Survey report<br/>[NavSurvey.h]"]
  node_surveyweb["Survey web view<br/>[NavSurveyWeb.h]"]
end

subgraph group_testing["Test recording"]
  node_logger["Test logger<br/>[TestLogger.h]"]
  node_loggerweb["Logger web view<br/>[TestLoggerWeb.h]"]
end

node_phone(("Phone UI"))
node_serial(("Serial operator"))
node_rover(("WAVE ROVER"))

node_phone -->|"sends drive"| node_hmi
node_hmi -->|"provides commands"| node_main
node_serial -->|"sends commands"| node_main
node_main -->|"ticks and reads"| node_hmi
node_main -->|"updates"| node_sensors
node_main -->|"sets drive"| node_roverlink
node_roverlink -->|"sends commands"| node_rover
node_sensors -->|"reads distances"| node_ultrasonic
node_sensors -->|"uses scan"| node_lidarscan
node_sensors -->|"polls GPS"| node_gps
node_sensors -->|"updates IMU"| node_imu
node_navsurvey -->|"uses geometry"| node_navlidar
node_navsurvey -->|"reads scan"| node_sensors
node_surveyweb -->|"copies report"| node_navsurvey
node_logger -->|"records readings"| node_sensors
node_logger -->|"uses geometry"| node_navlidar
node_loggerweb -->|"serves controls"| node_logger
node_hmi -->|"registers view"| node_surveyweb
node_hmi -->|"registers view"| node_loggerweb

click node_main "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/main.cpp"
click node_hmi "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/WebHMI.cpp"
click node_display "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/DisplayManager.cpp"
click node_roverlink "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/RoverLink.cpp"
click node_sensors "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/Sensors.cpp"
click node_ultrasonic "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/UsManager.cpp"
click node_lidarscan "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/LidarScan.h"
click node_gps "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/GpsManager.cpp"
click node_imu "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/ImuManager.cpp"
click node_navlidar "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/NavLidar.h"
click node_navsurvey "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/NavSurvey.h"
click node_surveyweb "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/NavSurveyWeb.h"
click node_logger "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/TestLogger.h"
click node_loggerweb "https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/TestLoggerWeb.h"

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_main,node_hmi,node_display,node_roverlink,node_phone toneBlue
class node_sensors,node_ultrasonic,node_lidarscan,node_gps,node_imu toneAmber
class node_navlidar,node_navsurvey,node_surveyweb toneMint
class node_logger,node_loggerweb toneRose
class node_serial,node_rover toneIndigo
```

## Components

### Control and interface

- [Control loop](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/main.cpp): `src/main.cpp`
- [Web HMI](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/WebHMI.cpp): `src/WebHMI.cpp`
- [OLED display](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/DisplayManager.cpp): `src/DisplayManager.cpp`
- [Rover link](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/RoverLink.cpp): `src/RoverLink.cpp`

### Sensor acquisition

- [Sensor facade](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/Sensors.cpp): `src/Sensors.cpp`
- [Ultrasonic manager](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/UsManager.cpp): `src/UsManager.cpp`
- [LiDAR scan reader](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/LidarScan.h): `src/LidarScan.h`
- [GPS manager](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/GpsManager.cpp): `src/GpsManager.cpp`
- [IMU manager](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/ImuManager.cpp): `src/ImuManager.cpp`

### Navigation and survey

- [LiDAR geometry](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/NavLidar.h): `src/NavLidar.h`
- [Survey report](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/NavSurvey.h): `src/NavSurvey.h`
- [Survey web view](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/NavSurveyWeb.h): `src/NavSurveyWeb.h`

### Test recording

- [Test logger](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/TestLogger.h): `src/TestLogger.h`
- [Logger web view](https://github.com/shehababdelelah/autonomous-case-study-/blob/master/src/TestLoggerWeb.h): `src/TestLoggerWeb.h`

### Other components

- **Phone UI**
- **Serial operator**
- **WAVE ROVER**

## Connections

- Phone UI → Web HMI: sends drive
- Web HMI → Control loop: provides commands (evidence: `src/main.cpp`)
- Serial operator → Control loop: sends commands (evidence: `src/main.cpp`)
- Control loop → Web HMI: ticks and reads (evidence: `src/main.cpp`)
- Control loop → Sensor facade: updates (evidence: `src/main.cpp`)
- Control loop → Rover link: sets drive
- Rover link → WAVE ROVER: sends commands
- Sensor facade → Ultrasonic manager: reads distances
- Sensor facade → LiDAR scan reader: uses scan
- Sensor facade → GPS manager: polls GPS
- Sensor facade → IMU manager: updates IMU
- Survey report → LiDAR geometry: uses geometry (evidence: `src/NavSurvey.h`)
- Survey report → Sensor facade: reads scan (evidence: `src/NavSurvey.h`)
- Survey web view → Survey report: copies report (evidence: `src/NavSurveyWeb.h`)
- Test logger → Sensor facade: records readings (evidence: `src/TestLogger.h`)
- Test logger → LiDAR geometry: uses geometry (evidence: `src/TestLogger.h`)
- Logger web view → Test logger: serves controls (evidence: `src/TestLoggerWeb.h`)
- Web HMI → Survey web view: registers view (evidence: `src/WebHMI.cpp`)
- Web HMI → Logger web view: registers view (evidence: `src/WebHMI.cpp`)
