Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/commaai/openpilot/llms.txt

Use this file to discover all available pages before exploring further.

Ubuntu 24.04 is the primary development target for openpilot, and all CI runs against it. Most of openpilot also works natively on macOS. On Windows, WSL2 provides a near-native Ubuntu experience and is the recommended path for Windows developers. Running natively on any other system is not currently supported. openpilot requires Python 3.12.3 (up to, but not including, 3.13). The build system is SCons.

Setup

1

Clone the repository

git clone https://github.com/commaai/openpilot.git
cd openpilot
2

Run the setup script

The setup script installs all system dependencies and creates a Python virtual environment under .venv/:
tools/op.sh setup
3

Activate the Python virtual environment

All Python tooling must run inside the virtual environment:
source .venv/bin/activate
Add this line to your ~/.bashrc to activate the environment automatically in new shells.
4

Build openpilot

openpilot uses SCons as its build system. The -u flag runs the build from any subdirectory:
scons -u
The first build takes several minutes. Subsequent builds are incremental.

Verify the setup

After building, confirm everything is working by running the unit tests:
pytest selfdrive/tests/

Project structure

The tools/ directory contains the developer utilities you will use most often:
tools/
├── cabana/        # View and plot CAN messages from drives or in realtime
├── camerastream/  # Stream cameras over the network
├── joystick/      # Control your car with a joystick
├── lib/           # Libraries for reading openpilot logs
├── plotjuggler/   # Plot openpilot logs
├── replay/        # Replay drives and mock openpilot services
├── scripts/       # Miscellaneous scripts
├── serial/        # Tools for the comma serial
├── sim/           # Run openpilot in a simulator
└── webcam/        # Run openpilot on a PC with webcams
Learn the openpilot ecosystem hands-on by playing the CTF. It walks through many of the tools and workflows used in day-to-day development.

Build docs developers (and LLMs) love