# fappsde/leoneers_qdi architecture

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

- Interactive diagram: https://gitdiagram.com/fappsde/leoneers_qdi
- Repository: https://github.com/fappsde/leoneers_qdi

## Overview

Leoneers_QDi documents an autonomous WRO robot car, not a standalone software product. Its principal workflow is onboard sensing and camera-based perception, environment mapping, then Raspberry Pi-to-ESP32 control of steering and drive. The README also describes a second Raspberry Pi and third camera, an IMU, LiDAR experiments, and a second ESP32 for optional accessories. The source excerpts show mapping, sensor, and vision responsibilities, but do not expose the main-loop calls or full control protocol; those links are therefore documented at a high level or left unverified.

Main entry points: [`Programmcode/Raspberry Pis/mainQDIloop.cxx`](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/mainQDIloop.cxx) (Autonomy loop), [`Programmcode/Arduino/esp1critical_struct_driver-v0.1.ino`](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Arduino/esp1critical_struct_driver-v0.1.ino) (Critical ESP32), [`Programmcode/Raspberry Pis/ddpmapper.cpp`](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/ddpmapper.cpp) (Occupancy mapper), [`Programmcode/Raspberry Pis/QDicamii.hpp`](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/QDicamii.hpp) (Camera perception)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_perception["Sensing and perception"]
  node_cameras["Camera array"]
  node_vision["Camera perception<br/>[QDicamii.hpp]"]
  node_lidar["LiDAR scanner<br/>[DDlidarscanner.cpp]"]
  node_motion["Motion sensor<br/>[poscamthrd.py]"]
  node_imu["IMU orientation<br/>[IMUG2.cpp]"]
  node_imu_driver["MPU6050 driver<br/>[MPU6050G2.cpp]"]
end

subgraph group_mapping["World model"]
  node_mapper["Occupancy mapper<br/>[ddpmapper.cpp]"]
  node_mapper_copy["Mapper copy<br/>[ddpmapper.cpp]"]
end

subgraph group_control["Vehicle control"]
  node_main["Autonomy loop<br/>[mainQDIloop.cxx]"]
end

subgraph group_hardware["Robot hardware"]
  node_raspberry["Raspberry Pi computers"]
  node_esp_critical["Critical ESP32"]
  node_esp_optional["Optional ESP32"]
  node_steering["Dual-axle steering"]
  node_drive["Drive motor"]
  node_accessories["Optional accessories"]
  node_cad["Mechanical designs<br/>[README.md]"]
end

node_field(("Course and obstacles"))

node_field -->|"provides imagery"| node_cameras
node_field -.->|"provides range data"| node_lidar
node_cameras -->|"feeds images"| node_vision
node_vision -.->|"supports mapping"| node_mapper
node_lidar -.->|"adds ranges"| node_mapper
node_motion -.->|"provides motion"| node_main
node_imu_driver -->|"reads sensor"| node_imu
node_imu -.->|"provides orientation"| node_main
node_mapper -.->|"provides map"| node_main
node_mapper_copy -.->|"alternate mapping"| node_main
node_main -.->|"runs on"| node_raspberry
node_raspberry -.->|"sends control"| node_esp_critical
node_esp_critical -.->|"actuates"| node_steering
node_esp_critical -.->|"actuates"| node_drive
node_raspberry -.->|"sends accessory commands"| node_esp_optional
node_esp_optional -.->|"controls"| node_accessories

click node_vision "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/QDicamii.hpp"
click node_lidar "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/DDlidarscanner.cpp"
click node_motion "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/poscamthrd.py"
click node_imu "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/IMUG2.cpp"
click node_imu_driver "https://github.com/fappsde/leoneers_qdi/blob/main/Raspicode/MPU6050-C-CPP-Library-for-Raspberry-Pi/MPU6050G2.cpp"
click node_mapper "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/ddpmapper.cpp"
click node_mapper_copy "https://github.com/fappsde/leoneers_qdi/blob/main/Raspicode/ddpmapper.cpp"
click node_main "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/mainQDIloop.cxx"
click node_esp_critical "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Arduino/esp1critical_struct_driver-v0.1.ino"
click node_esp_optional "https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Arduino/esp2optional_struct_driver-v0.1.ino.ino"
click node_cad "https://github.com/fappsde/leoneers_qdi/blob/main/Technische%20Zeichnungen/STL-Dateien/README.md"

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_cameras,node_vision,node_lidar,node_motion,node_imu,node_imu_driver toneBlue
class node_mapper,node_mapper_copy toneAmber
class node_main toneMint
class node_raspberry,node_esp_critical,node_esp_optional,node_steering,node_drive,node_accessories,node_cad toneRose
class node_field toneIndigo
```

## Components

### Sensing and perception

- **Camera array**
- [Camera perception](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/QDicamii.hpp): `Programmcode/Raspberry Pis/QDicamii.hpp`
- [LiDAR scanner](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/DDlidarscanner.cpp): `Programmcode/Raspberry Pis/DDlidarscanner.cpp`
- [Motion sensor](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/poscamthrd.py): `Programmcode/Raspberry Pis/poscamthrd.py`
- [IMU orientation](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/IMUG2.cpp): `Programmcode/Raspberry Pis/IMUG2.cpp`
- [MPU6050 driver](https://github.com/fappsde/leoneers_qdi/blob/main/Raspicode/MPU6050-C-CPP-Library-for-Raspberry-Pi/MPU6050G2.cpp): `Raspicode/MPU6050-C-CPP-Library-for-Raspberry-Pi/MPU6050G2.cpp`

### World model

- [Occupancy mapper](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/ddpmapper.cpp): `Programmcode/Raspberry Pis/ddpmapper.cpp`
- [Mapper copy](https://github.com/fappsde/leoneers_qdi/blob/main/Raspicode/ddpmapper.cpp): `Raspicode/ddpmapper.cpp`

### Vehicle control

- [Autonomy loop](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Raspberry%20Pis/mainQDIloop.cxx): `Programmcode/Raspberry Pis/mainQDIloop.cxx`

### Robot hardware

- **Raspberry Pi computers**
- [Critical ESP32](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Arduino/esp1critical_struct_driver-v0.1.ino): `Programmcode/Arduino/esp1critical_struct_driver-v0.1.ino`
- [Optional ESP32](https://github.com/fappsde/leoneers_qdi/blob/main/Programmcode/Arduino/esp2optional_struct_driver-v0.1.ino.ino): `Programmcode/Arduino/esp2optional_struct_driver-v0.1.ino.ino`
- **Dual-axle steering**
- **Drive motor**
- **Optional accessories**
- [Mechanical designs](https://github.com/fappsde/leoneers_qdi/blob/main/Technische%20Zeichnungen/STL-Dateien/README.md): `Technische Zeichnungen/STL-Dateien/README.md`

### Other components

- **Course and obstacles**

## Connections

- Course and obstacles → Camera array: provides imagery (evidence: `README.md`)
- Course and obstacles → LiDAR scanner: provides range data
- Camera array → Camera perception: feeds images (evidence: `README.md`)
- Camera perception → Occupancy mapper: supports mapping
- LiDAR scanner → Occupancy mapper: adds ranges
- Motion sensor → Autonomy loop: provides motion
- MPU6050 driver → IMU orientation: reads sensor
- IMU orientation → Autonomy loop: provides orientation
- Occupancy mapper → Autonomy loop: provides map
- Mapper copy → Autonomy loop: alternate mapping
- Autonomy loop → Raspberry Pi computers: runs on
- Raspberry Pi computers → Critical ESP32: sends control
- Critical ESP32 → Dual-axle steering: actuates (evidence: `README.md`)
- Critical ESP32 → Drive motor: actuates (evidence: `README.md`)
- Raspberry Pi computers → Optional ESP32: sends accessory commands
- Optional ESP32 → Optional accessories: controls (evidence: `README.md`)
