openpilot is an open-source advanced driver assistance system that performs adaptive cruise control (ACC) and automated lane centering (ALC). Described as an "operating system for robotics," it currently upgrades the driver assistance systems in over 300 supported cars README.md3-9 openpilot runs on commodity hardware, primarily the comma 3X and comma four devices, and is developed by comma.ai and a global community of contributors README.md41-50
The system is designed for high reliability, observing ISO26262 guidelines and utilizing a safety model enforced by the Panda hardware interface README.md77-83
For details on hardware requirements and supported car models, see Supported Vehicles and Releases. For information on the build system and python environment, see Project Configuration and Dependencies.
Sources: README.md1-21 RELEASES.md33-35
openpilot is structured as a message-driven process architecture where independent processes communicate via a publish-subscribe messaging infrastructure. This modular design allows for clear separation between hardware abstraction, perception, planning, control, and user interface layers.
The system lifecycle is managed by manager.py, which orchestrates the spawning and monitoring of various daemons based on the configuration in process_config.py. These processes communicate using the cereal messaging format (based on Cap'n Proto) over a zero-copy shared memory IPC mechanism managed by msgq.
Runtime Process Interaction and Code Entities
The selfdrived daemon manages the high-level system state and handles onroad events. It coordinates inputs from carState, modelV2, and deviceState to determine if the system is ready to engage. Execution priorities are often tuned for hardware performance; for example, the UI is given higher priority than modeld to maintain a consistent 60fps launch_env.sh9-16
Sources: README.md81-86 launch_env.sh9-23 launch_openpilot.sh1-3
openpilot abstracts manufacturer-specific logic into a standard interface. The card daemon serves as the bridge between the vehicle's CAN bus and openpilot's internal state. Supported vehicles range across major brands including Acura, Audi, Chevrolet, Ford, Honda, Hyundai, Kia, Lexus, and Toyota docs/CARS.md11-128
Vehicle Abstraction and Event Logic
Vehicle integration relies on fingerprinting to identify the specific car model and ECU firmware versions RELEASES.md103-104 This allows openpilot to load the correct CarInterface and safety parameters for the 332+ supported cars docs/CARS.md7-9
Sources: docs/CARS.md1-128 RELEASES.md103-104
openpilot is developed with a focus on safety, stability, and quality docs/CONTRIBUTING.md15-16 The codebase includes extensive software-in-the-loop (SIL) and hardware-in-the-loop (HIL) testing infrastructure.
The project uses the SCons build system to compile C++ and Cython modules docs/how-to/turn-the-speed-blue.md21-24 Dependency management is handled via uv, with configurations defined in pyproject.toml and locked in uv.lock uv.lock1-9 Development typically occurs in a Python virtual environment docs/how-to/turn-the-speed-blue.md15-19
Sources: docs/CONTRIBUTING.md44-56 docs/how-to/turn-the-speed-blue.md8-35 uv.lock1-33 docs/how-to/connect-to-comma.md1-30
| Component | Code Entity | Description |
|---|---|---|
| Orchestrator | manager.py | Manages the lifecycle and transition of all processes. |
| State Machine | selfdrived.py | High-level daemon managing engagement and system events. |
| Hardware State | hardwared.py | Monitors thermals, network, and hardware health. |
| IPC | cereal | Cap'n Proto based messaging system for inter-process communication. |
| OS | AGNOS | The underlying Ubuntu-based operating system for comma hardware launch_env.sh18-20 |
Sources: README.md6-9 launch_env.sh18-20 docs/how-to/connect-to-comma.md3-4
pyproject.toml, uv.lock, SCons, and IDE setup.