# openpilot/openpilot architecture

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

- Interactive diagram: https://gitdiagram.com/openpilot/openpilot
- Repository: https://github.com/openpilot/openpilot

## Overview

OpenPilot is an autopilot and ground-control platform for configurable vehicles. Its principal workflow is vehicle sensing and state estimation, followed by flight-mode/control decisions and actuator commands; UAVObjects carry shared state and UAVTalk provides a communications subsystem, while the Ground Control Station configures and monitors the vehicle. The README documents GCS-loaded programming-language configuration and a multi-platform package. Most flight-module wiring was not sampled, so those relationships are shown as unverified rather than asserted as direct calls.

Main entry points: [`flight/uavobjects/uavobjectmanager.c`](https://github.com/openpilot/openpilot/blob/master/flight/uavobjects/uavobjectmanager.c) (UAVObject manager), [`flight/modules/StateEstimation/stateestimation.c`](https://github.com/openpilot/openpilot/blob/master/flight/modules/StateEstimation/stateestimation.c) (State estimation), [`flight/modules/ManualControl/manualcontrol.c`](https://github.com/openpilot/openpilot/blob/master/flight/modules/ManualControl/manualcontrol.c) (Manual control), [`ground/openpilotgcs`](https://github.com/openpilot/openpilot/tree/master/ground/openpilotgcs) (Ground Control Station)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flight["Flight runtime"]
  node_sensors["Sensor acquisition<br/>[sensors.c]"]
  node_gps["GPS decoding<br/>[GPS.c]"]
  node_state["State estimation<br/>[stateestimation.c]"]
  node_altitude["Altitude estimation<br/>[altitude.c]"]
  node_attitude["Attitude estimation<br/>[attitude.c]"]
  node_manual["Manual control<br/>[manualcontrol.c]"]
  node_arming["Arming handler<br/>[armhandler.c]"]
  node_stabilization["Stabilization loops<br/>[stabilization.c]"]
  node_pathplan["Path planning<br/>[pathplanner.c]"]
  node_pathfollow["Path following<br/>[pathfollower.c]"]
  node_actuator["Actuator output<br/>[actuator.c]"]
  node_airspeed["Airspeed sensing<br/>[airspeed.c]"]
end

subgraph group_shared["Vehicle data and links"]
  node_uavobjects["UAVObject manager<br/>[uavobjectmanager.c]"]
  node_uavtalk["UAVTalk transport<br/>[uavtalk.c]"]
  node_telemetry["Telemetry<br/>[telemetry.c]"]
  node_receiver["Radio receiver<br/>[receiver.c]"]
end

subgraph group_ground["Ground control"]
  node_gcs["Ground Control Station"]
  node_flightlog["Flight log manager"]
  node_objectgenerator["Object generator<br/>[main.cpp]"]
  node_config["Vehicle configuration"]
end

subgraph group_platform["Platform services"]
  node_rtos["Task scheduler<br/>[tasks.c]"]
  node_pios["Board I/O"]
end

node_pilot(("Pilot"))

node_pilot -.->|"sends controls"| node_receiver
node_receiver -.->|"provides input"| node_manual
node_sensors -.->|"provides measurements"| node_state
node_gps -.->|"provides position"| node_state
node_airspeed -.->|"provides airspeed"| node_state
node_state -.->|"shares estimates"| node_attitude
node_manual -.->|"dispatches command"| node_arming
node_arming -->|"updates flight status"| node_uavobjects
node_manual -.->|"provides setpoints"| node_stabilization
node_pathplan -.->|"defines paths"| node_pathfollow
node_pathfollow -.->|"provides setpoints"| node_stabilization
node_stabilization -.->|"commands outputs"| node_actuator
node_sensors -.->|"reads hardware"| node_pios
node_actuator -.->|"drives hardware"| node_pios
node_uavobjects -.->|"shares vehicle data"| node_telemetry
node_telemetry -.->|"transports telemetry"| node_uavtalk
node_uavtalk -.->|"exchanges data"| node_gcs
node_gcs -->|"loads configuration"| node_config
node_config -.->|"configures vehicle"| node_uavobjects
node_gcs -->|"manages logs"| node_flightlog
node_flightlog -->|"reads object data"| node_uavobjects
node_objectgenerator -.->|"generates definitions"| node_uavobjects
node_rtos -.->|"schedules runtime"| node_sensors

click node_sensors "https://github.com/openpilot/openpilot/blob/master/flight/modules/Sensors/sensors.c"
click node_gps "https://github.com/openpilot/openpilot/blob/master/flight/modules/GPS/GPS.c"
click node_state "https://github.com/openpilot/openpilot/blob/master/flight/modules/StateEstimation/stateestimation.c"
click node_altitude "https://github.com/openpilot/openpilot/blob/master/flight/modules/Altitude/altitude.c"
click node_attitude "https://github.com/openpilot/openpilot/blob/master/flight/modules/Attitude/attitude.c"
click node_manual "https://github.com/openpilot/openpilot/blob/master/flight/modules/ManualControl/manualcontrol.c"
click node_arming "https://github.com/openpilot/openpilot/blob/master/flight/modules/ManualControl/armhandler.c"
click node_stabilization "https://github.com/openpilot/openpilot/blob/master/flight/modules/Stabilization/stabilization.c"
click node_pathplan "https://github.com/openpilot/openpilot/blob/master/flight/modules/PathPlanner/pathplanner.c"
click node_pathfollow "https://github.com/openpilot/openpilot/blob/master/flight/modules/PathFollower/pathfollower.c"
click node_actuator "https://github.com/openpilot/openpilot/blob/master/flight/modules/Actuator/actuator.c"
click node_airspeed "https://github.com/openpilot/openpilot/blob/master/flight/modules/Airspeed/airspeed.c"
click node_uavobjects "https://github.com/openpilot/openpilot/blob/master/flight/uavobjects/uavobjectmanager.c"
click node_uavtalk "https://github.com/openpilot/openpilot/blob/master/flight/uavtalk/uavtalk.c"
click node_telemetry "https://github.com/openpilot/openpilot/blob/master/flight/modules/Telemetry/telemetry.c"
click node_receiver "https://github.com/openpilot/openpilot/blob/master/flight/modules/Receiver/receiver.c"
click node_gcs "https://github.com/openpilot/openpilot/tree/master/ground/openpilotgcs"
click node_flightlog "https://github.com/openpilot/openpilot/blob/master/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp"
click node_objectgenerator "https://github.com/openpilot/openpilot/blob/master/ground/uavobjgenerator/main.cpp"
click node_rtos "https://github.com/openpilot/openpilot/blob/master/flight/pios/common/libraries/FreeRTOS/Source/tasks.c"
click node_pios "https://github.com/openpilot/openpilot/tree/master/flight/pios"

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_sensors,node_gps,node_state,node_altitude,node_attitude,node_manual,node_arming,node_stabilization,node_pathplan,node_pathfollow,node_actuator,node_airspeed toneBlue
class node_uavobjects,node_uavtalk,node_telemetry,node_receiver toneAmber
class node_gcs,node_flightlog,node_objectgenerator,node_config toneMint
class node_rtos,node_pios toneRose
class node_pilot toneIndigo
```

## Components

### Flight runtime

- [Sensor acquisition](https://github.com/openpilot/openpilot/blob/master/flight/modules/Sensors/sensors.c): `flight/modules/Sensors/sensors.c`
- [GPS decoding](https://github.com/openpilot/openpilot/blob/master/flight/modules/GPS/GPS.c): `flight/modules/GPS/GPS.c`
- [State estimation](https://github.com/openpilot/openpilot/blob/master/flight/modules/StateEstimation/stateestimation.c): `flight/modules/StateEstimation/stateestimation.c`
- [Altitude estimation](https://github.com/openpilot/openpilot/blob/master/flight/modules/Altitude/altitude.c): `flight/modules/Altitude/altitude.c`
- [Attitude estimation](https://github.com/openpilot/openpilot/blob/master/flight/modules/Attitude/attitude.c): `flight/modules/Attitude/attitude.c`
- [Manual control](https://github.com/openpilot/openpilot/blob/master/flight/modules/ManualControl/manualcontrol.c): `flight/modules/ManualControl/manualcontrol.c`
- [Arming handler](https://github.com/openpilot/openpilot/blob/master/flight/modules/ManualControl/armhandler.c): `flight/modules/ManualControl/armhandler.c`
- [Stabilization loops](https://github.com/openpilot/openpilot/blob/master/flight/modules/Stabilization/stabilization.c): `flight/modules/Stabilization/stabilization.c`
- [Path planning](https://github.com/openpilot/openpilot/blob/master/flight/modules/PathPlanner/pathplanner.c): `flight/modules/PathPlanner/pathplanner.c`
- [Path following](https://github.com/openpilot/openpilot/blob/master/flight/modules/PathFollower/pathfollower.c): `flight/modules/PathFollower/pathfollower.c`
- [Actuator output](https://github.com/openpilot/openpilot/blob/master/flight/modules/Actuator/actuator.c): `flight/modules/Actuator/actuator.c`
- [Airspeed sensing](https://github.com/openpilot/openpilot/blob/master/flight/modules/Airspeed/airspeed.c): `flight/modules/Airspeed/airspeed.c`

### Vehicle data and links

- [UAVObject manager](https://github.com/openpilot/openpilot/blob/master/flight/uavobjects/uavobjectmanager.c): `flight/uavobjects/uavobjectmanager.c`
- [UAVTalk transport](https://github.com/openpilot/openpilot/blob/master/flight/uavtalk/uavtalk.c): `flight/uavtalk/uavtalk.c`
- [Telemetry](https://github.com/openpilot/openpilot/blob/master/flight/modules/Telemetry/telemetry.c): `flight/modules/Telemetry/telemetry.c`
- [Radio receiver](https://github.com/openpilot/openpilot/blob/master/flight/modules/Receiver/receiver.c): `flight/modules/Receiver/receiver.c`

### Ground control

- [Ground Control Station](https://github.com/openpilot/openpilot/tree/master/ground/openpilotgcs): `ground/openpilotgcs`
- [Flight log manager](https://github.com/openpilot/openpilot/blob/master/ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp): `ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp`
- [Object generator](https://github.com/openpilot/openpilot/blob/master/ground/uavobjgenerator/main.cpp): `ground/uavobjgenerator/main.cpp`
- **Vehicle configuration**

### Platform services

- [Task scheduler](https://github.com/openpilot/openpilot/blob/master/flight/pios/common/libraries/FreeRTOS/Source/tasks.c): `flight/pios/common/libraries/FreeRTOS/Source/tasks.c`
- [Board I/O](https://github.com/openpilot/openpilot/tree/master/flight/pios): `flight/pios`

### Other components

- **Pilot**

## Connections

- Pilot → Radio receiver: sends controls
- Radio receiver → Manual control: provides input
- Sensor acquisition → State estimation: provides measurements
- GPS decoding → State estimation: provides position
- Airspeed sensing → State estimation: provides airspeed
- State estimation → Attitude estimation: shares estimates
- Manual control → Arming handler: dispatches command
- Arming handler → UAVObject manager: updates flight status (evidence: `flight/modules/ManualControl/armhandler.c`)
- Manual control → Stabilization loops: provides setpoints
- Path planning → Path following: defines paths
- Path following → Stabilization loops: provides setpoints
- Stabilization loops → Actuator output: commands outputs
- Sensor acquisition → Board I/O: reads hardware
- Actuator output → Board I/O: drives hardware
- UAVObject manager → Telemetry: shares vehicle data
- Telemetry → UAVTalk transport: transports telemetry
- UAVTalk transport → Ground Control Station: exchanges data
- Ground Control Station → Vehicle configuration: loads configuration
- Vehicle configuration → UAVObject manager: configures vehicle
- Ground Control Station → Flight log manager: manages logs (evidence: `ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp`)
- Flight log manager → UAVObject manager: reads object data (evidence: `ground/openpilotgcs/src/plugins/flightlog/flightlogmanager.cpp`)
- Object generator → UAVObject manager: generates definitions
- Task scheduler → Sensor acquisition: schedules runtime
