# yankailab/openkai architecture

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

- Interactive diagram: https://gitdiagram.com/yankailab/openkai
- Repository: https://github.com/yankailab/openkai

## Overview

OpenKAI is a configurable C++ framework for unmanned vehicles and robots, built around a modular, multithreaded runtime. The principal workflow is: an operator supplies a JSON configuration, the application loads it, creates and initializes configured modules, links them, and starts them; those modules can then support sensing, navigation, control, and device communication. The tree and README document broad capabilities, but most implementation links were not sampled, so those connections are shown as unverified rather than asserted.

Main entry points: [`src/Instance`](https://github.com/yankailab/openkai/tree/master/src/Instance) (Module Manager), [`html/viewer`](https://github.com/yankailab/openkai/tree/master/html/viewer) (Web Viewers), [`src/main.cpp`](https://github.com/yankailab/openkai/blob/master/src/main.cpp) (Application), [`src/Base/_ModuleBase.cpp`](https://github.com/yankailab/openkai/blob/master/src/Base/_ModuleBase.cpp) (Module Lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_application["Application<br/>[main.cpp]"]
  node_module_manager["Module Manager"]
  node_module_base["Module Lifecycle<br/>[_ModuleBase.cpp]"]
  node_threading["Threading<br/>[_Thread.cpp]"]
  node_data_objects["Data Objects"]
end

subgraph group_sensing["Sensing and Perception"]
  node_realsense["RealSense<br/>[viewer3D.js]"]
  node_orbbec["Orbbec<br/>[_Orbbec.cpp]"]
  node_livox["Livox LiDAR<br/>[_Livox2.cpp]"]
  node_leddar["LeddarVu<br/>[_LeddarVu.cpp]"]
  node_yolo["Depth Detection"]
  node_slam["GLIM SLAM<br/>[_GLIM.cpp]"]
end

subgraph group_control["Navigation and Control"]
  node_autopilot["Autopilot Base<br/>[_AutopilotBase.cpp]"]
  node_ardupilot["ArduPilot MAVLink<br/>[_APmav_base.cpp]"]
  node_geofence["Geofence<br/>[_GeoFence.cpp]"]
  node_actuators["Actuators"]
end

subgraph group_interfaces["Interfaces and Visualization"]
  node_protocol["MAVLink Protocol<br/>[_Mavlink.cpp]"]
  node_tcp["TCP Client<br/>[_TCPclient.cpp]"]
  node_web_viewers["Web Viewers"]
  node_octgrid_viewer["OctGrid Viewer<br/>[main.js]"]
  node_web_glim["GLIM Web Viewer<br/>[_WebGLIM.cpp]"]
end

node_operator(("Operator"))

node_operator -->|"provides JSON"| node_application
node_application -->|"loads and starts"| node_module_manager
node_module_manager -.->|"manages lifecycle"| node_module_base
node_module_manager -.->|"runs modules"| node_threading
node_module_manager -.->|"configures modules"| node_data_objects
node_module_manager -.->|"configures"| node_realsense
node_module_manager -.->|"configures"| node_orbbec
node_module_manager -.->|"configures"| node_livox
node_module_manager -.->|"configures"| node_leddar
node_module_manager -.->|"configures"| node_yolo
node_module_manager -.->|"configures"| node_slam
node_module_manager -.->|"configures"| node_autopilot
node_module_manager -.->|"configures"| node_geofence
node_module_manager -.->|"configures"| node_actuators
node_module_manager -.->|"configures"| node_protocol
node_module_manager -.->|"configures"| node_tcp
node_module_manager -.->|"configures"| node_web_viewers
node_web_viewers -.->|"includes viewer"| node_octgrid_viewer
node_web_viewers -.->|"supports visualization"| node_web_glim

click node_application "https://github.com/yankailab/openkai/blob/master/src/main.cpp"
click node_module_manager "https://github.com/yankailab/openkai/tree/master/src/Instance"
click node_module_base "https://github.com/yankailab/openkai/blob/master/src/Base/_ModuleBase.cpp"
click node_threading "https://github.com/yankailab/openkai/blob/master/src/Base/_Thread.cpp"
click node_data_objects "https://github.com/yankailab/openkai/tree/master/src/DataObject"
click node_realsense "https://github.com/yankailab/openkai/blob/master/html/viewer/_RealSense/js/viewer3D.js"
click node_orbbec "https://github.com/yankailab/openkai/blob/master/src/Vision/RGBD/_Orbbec.cpp"
click node_livox "https://github.com/yankailab/openkai/blob/master/src/Sensor/LiDAR/_Livox2.cpp"
click node_leddar "https://github.com/yankailab/openkai/blob/master/src/Sensor/Distance/_LeddarVu.cpp"
click node_yolo "https://github.com/yankailab/openkai/blob/master/src/Detector/_YOLO26depthEstONNX.cpp"
click node_slam "https://github.com/yankailab/openkai/blob/master/src/SLAM/_GLIM.cpp"
click node_autopilot "https://github.com/yankailab/openkai/blob/master/src/Autopilot/_AutopilotBase.cpp"
click node_ardupilot "https://github.com/yankailab/openkai/blob/master/src/Autopilot/FC/ArduPilot/_APmav_base.cpp"
click node_geofence "https://github.com/yankailab/openkai/blob/master/src/Navigation/_GeoFence.cpp"
click node_actuators "https://github.com/yankailab/openkai/tree/master/src/Actuator"
click node_protocol "https://github.com/yankailab/openkai/blob/master/src/Protocol/_Mavlink.cpp"
click node_tcp "https://github.com/yankailab/openkai/blob/master/src/IO/_TCPclient.cpp"
click node_web_viewers "https://github.com/yankailab/openkai/tree/master/html/viewer"
click node_octgrid_viewer "https://github.com/yankailab/openkai/blob/master/html/viewer/_SelectableOctGrid/js/main.js"
click node_web_glim "https://github.com/yankailab/openkai/blob/master/src/UI/Viewer/Web/_WebGLIM.cpp"

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_application,node_module_manager,node_module_base,node_threading,node_data_objects toneBlue
class node_realsense,node_orbbec,node_livox,node_leddar,node_yolo,node_slam toneAmber
class node_autopilot,node_ardupilot,node_geofence,node_actuators toneMint
class node_protocol,node_tcp,node_web_viewers,node_octgrid_viewer,node_web_glim toneRose
class node_operator toneIndigo
```

## Components

### Runtime

- [Application](https://github.com/yankailab/openkai/blob/master/src/main.cpp): `src/main.cpp`
- [Module Manager](https://github.com/yankailab/openkai/tree/master/src/Instance): `src/Instance`
- [Module Lifecycle](https://github.com/yankailab/openkai/blob/master/src/Base/_ModuleBase.cpp): `src/Base/_ModuleBase.cpp`
- [Threading](https://github.com/yankailab/openkai/blob/master/src/Base/_Thread.cpp): `src/Base/_Thread.cpp`
- [Data Objects](https://github.com/yankailab/openkai/tree/master/src/DataObject): `src/DataObject`

### Sensing and Perception

- [RealSense](https://github.com/yankailab/openkai/blob/master/html/viewer/_RealSense/js/viewer3D.js): `html/viewer/_RealSense/js/viewer3D.js`
- [Orbbec](https://github.com/yankailab/openkai/blob/master/src/Vision/RGBD/_Orbbec.cpp): `src/Vision/RGBD/_Orbbec.cpp`
- [Livox LiDAR](https://github.com/yankailab/openkai/blob/master/src/Sensor/LiDAR/_Livox2.cpp): `src/Sensor/LiDAR/_Livox2.cpp`
- [LeddarVu](https://github.com/yankailab/openkai/blob/master/src/Sensor/Distance/_LeddarVu.cpp): `src/Sensor/Distance/_LeddarVu.cpp`
- [Depth Detection](https://github.com/yankailab/openkai/blob/master/src/Detector/_YOLO26depthEstONNX.cpp): `src/Detector/_YOLO26depthEstONNX.cpp`
- [GLIM SLAM](https://github.com/yankailab/openkai/blob/master/src/SLAM/_GLIM.cpp): `src/SLAM/_GLIM.cpp`

### Navigation and Control

- [Autopilot Base](https://github.com/yankailab/openkai/blob/master/src/Autopilot/_AutopilotBase.cpp): `src/Autopilot/_AutopilotBase.cpp`
- [ArduPilot MAVLink](https://github.com/yankailab/openkai/blob/master/src/Autopilot/FC/ArduPilot/_APmav_base.cpp): `src/Autopilot/FC/ArduPilot/_APmav_base.cpp`
- [Geofence](https://github.com/yankailab/openkai/blob/master/src/Navigation/_GeoFence.cpp): `src/Navigation/_GeoFence.cpp`
- [Actuators](https://github.com/yankailab/openkai/tree/master/src/Actuator): `src/Actuator`

### Interfaces and Visualization

- [MAVLink Protocol](https://github.com/yankailab/openkai/blob/master/src/Protocol/_Mavlink.cpp): `src/Protocol/_Mavlink.cpp`
- [TCP Client](https://github.com/yankailab/openkai/blob/master/src/IO/_TCPclient.cpp): `src/IO/_TCPclient.cpp`
- [Web Viewers](https://github.com/yankailab/openkai/tree/master/html/viewer): `html/viewer`
- [OctGrid Viewer](https://github.com/yankailab/openkai/blob/master/html/viewer/_SelectableOctGrid/js/main.js): `html/viewer/_SelectableOctGrid/js/main.js`
- [GLIM Web Viewer](https://github.com/yankailab/openkai/blob/master/src/UI/Viewer/Web/_WebGLIM.cpp): `src/UI/Viewer/Web/_WebGLIM.cpp`

### Other components

- **Operator**

## Connections

- Operator → Application: provides JSON (evidence: `src/main.cpp`)
- Application → Module Manager: loads and starts (evidence: `src/main.cpp`)
- Module Manager → Module Lifecycle: manages lifecycle
- Module Manager → Threading: runs modules
- Module Manager → Data Objects: configures modules
- Module Manager → RealSense: configures
- Module Manager → Orbbec: configures
- Module Manager → Livox LiDAR: configures
- Module Manager → LeddarVu: configures
- Module Manager → Depth Detection: configures
- Module Manager → GLIM SLAM: configures
- Module Manager → Autopilot Base: configures
- Module Manager → Geofence: configures
- Module Manager → Actuators: configures
- Module Manager → MAVLink Protocol: configures
- Module Manager → TCP Client: configures
- Module Manager → Web Viewers: configures
- Web Viewers → OctGrid Viewer: includes viewer (evidence: `html/viewer/_SelectableOctGrid/js/main.js`)
- Web Viewers → GLIM Web Viewer: supports visualization
