PoodlePilot is an open source driver assistance system, forked from comma.ai's openpilot. PoodlePilot enhances compatible vehicles with features like Automated Lane Centering (ALC) and Adaptive Cruise Control (ACC). Originally developed by comma.ai and the community, PoodlePilot aims to provide a safe and reliable driving experience.
This document provides information for developers and contributors looking to understand, build, and extend PoodlePilot. For user-facing documentation, please visit docs.comma.ai (official OpenPilot documentation).
- Getting Started
- Running the Application
- Running Tests
- Building PoodlePilot
- Deployment
- High-Level Architecture
- Contributing
- License
This section guides you through setting up your development environment for PoodlePilot.
Before you begin, ensure you have the following:
- Supported Operating System:
- Ubuntu 20.04 or later (22.04/24.04 LTS recommended).
- macOS.
- Git: For version control (LFS is also used).
- Python: Version >=3.11, <3.13 (defined in
pyproject.toml). - C++ Compiler: A modern C++ compiler (e.g., Clang, GCC). Clang is specified in
SConstruct. - SCons: The build system used by openpilot.
- uv: Python packaging tool, used for dependency management (
uv sync --frozen --all-extras). - OS-Specific Dependencies: Various libraries for UI (Qt5), multimedia (ffmpeg), system tools, etc. See
tools/install_ubuntu_dependencies.shfor Ubuntu andtools/mac_setup.shfor macOS.
-
Clone the Repository:
git clone https://github.com/commaai/openpilot.git cd openpilot -
Initialize Submodules & LFS: PoodlePilot uses Git submodules and LFS.
git submodule update --init --recursive git lfs pull
-
Install Dependencies:
-
For Ubuntu:
./tools/install_ubuntu_dependencies.sh ./tools/install_python_dependencies.sh
The first script installs system-level packages. The second script sets up
uv(if not present) and installs Python packages into a virtual environment (.venv) usinguv sync --frozen --all-extrasbased onpyproject.tomlanduv.lock. -
For macOS:
./tools/mac_setup.sh
This script uses Homebrew to install system-level packages and then calls
tools/install_python_dependencies.shfor Python packages. -
Activate Virtual Environment: After running the Python dependency installation, activate the virtual environment:
source .venv/bin/activate
-
- Using a PC/Laptop:
- Follow the installation steps above.
- Ensure your system is set up for C++ and Python development.
- VS Code is a popular choice, and the repository includes a
.vscode/configuration.
- Developing for a comma device:
- While much development can be done on a PC (especially with simulation), testing on actual hardware is crucial for many features.
- Refer to the official openpilot documentation and community resources for device-specific setup if you intend to deploy directly to a comma 3/3X.
For running PoodlePilot on a comma 3/3X:
- Follow the official OpenPilot installation instructions from comma.ai.
- To use a custom PoodlePilot build (e.g., from your development branch), you typically need to build and transfer it to the device. The
release/directory scripts, particularlyrelease/build_release.sh(which callsrelease/pack.py), are used for creating deployable builds. Further details on deploying custom builds to devices will be added here or in specific Wiki sections once the process is fully documented.
PoodlePilot can be run in a simulator, which is highly beneficial for development and testing without needing a car or comma hardware.
- Setup and Run Simulation:
The
tools/sim/launch_openpilot.shscript configures and starts PoodlePilot in simulation mode. Make sure your virtual environment is active (source .venv/bin/activate).This script sets necessary environment variables (e.g.,# From the root of the openpilot directory ./tools/sim/launch_openpilot.shSIMULATION=1,NOBOARD=1) and then runssystem/manager/manager.py. Refer totools/sim/README.mdif available, or the script itself for more details on simulation capabilities and requirements.
PoodlePilot has an extensive suite of tests, combining Python and C++ tests, primarily run using pytest.
Ensure your Python virtual environment is active (source .venv/bin/activate).
-
General Testing: From the root directory:
# Run all tests (Python and C++ discovered by pytest-cpp) pytest # Run with parallel execution (similar to CI) pytest -n logical # "logical" will use a sensible number of workers # Run specific tests by path or name pytest selfdrive/controls/tests/test_longcontrol.py pytest selfdrive/locationd/test/test_locationd_scenarios.py::test_scenario_a
The
pyproject.tomlfile (undertool.pytest.ini_options) configurespytestto discover C++ tests (test_*files) usingpytest-cppandselfdrive/test/cpp_harness.py. -
Specific Test Suites (examples):
- Process Replay:
pytest selfdrive/test/process_replay/test_processes.py - Car Models:
pytest selfdrive/car/tests/test_models.py - UI Tests: See
selfdrive/ui/tests/. For example,pytest selfdrive/ui/tests/test_translations.py.
- Process Replay:
-
Coverage: To generate a coverage report (as done in CI):
pytest --cov --cov-report=xml --cov-append # View HTML report: coverage html
PoodlePilot is primarily built using SCons. Ensure your Python virtual environment is active (source .venv/bin/activate).
-
Standard Development Build: To build all targets. SCons will typically use about half your CPU cores by default.
# From the root directory scons # Or specify job count, e.g., using all available cores: scons -j$(nproc)
-
Specific Targets: You can build specific parts of the project:
scons selfdrive/modeld/modeld scons system/camerad/camerad # Example, actual target might differ or be part of a larger one -
Clean Build: To clean build artifacts:
scons -c
-
Release Builds: For creating packages suitable for deployment on a device, use scripts in the
release/directory:./release/build_devel.sh # For a development/testing build ./release/build_release.sh # For a full release build
These scripts often involve SCons and additional steps like packaging.
Deployment typically refers to installing PoodlePilot on a comma device.
- Official Releases: Users install official OpenPilot releases via URLs like
openpilot.comma.aiduring the device setup. For PoodlePilot, release mechanisms will be defined by its maintainers. - Custom Builds / Development Builds:
- Build PoodlePilot using the appropriate release scripts (e.g.,
./release/build_devel.sh). This usually creates an update package. - Transfer the package to the comma device. This might involve SSH, USB, or a custom update mechanism. Consult the OpenPilot documentation and community discussions for methods, adapting as necessary for PoodlePilot.
- Install the update on the device. This section will be significantly expanded in the Wiki documentation with detailed procedures.
- Build PoodlePilot using the appropriate release scripts (e.g.,
PoodlePilot's architecture (derived from OpenPilot) is modular, consisting of several key systems and processes that communicate with each other, primarily using the cereal messaging library.
graph TD
subgraph "User Interface"
UI_Process["ui"]
end
subgraph "Vehicle Interface"
Panda["panda"]
Opendbc["opendbc"]
end
subgraph "Core System"
Controls["controls"]
ModelD["modeld"]
LocationD["locationd"]
CameraD["camerad"]
SensorD["sensord"]
end
subgraph "Supporting Systems"
Cereal["cereal (messaging)"]
SystemServices["system (logging, etc.)"]
Common["common (utilities)"]
Tools["tools (dev, simulation)"]
end
UI_Process --> Controls
Controls --> Panda
Panda --> Opendbc
ModelD --> Controls
LocationD --> Controls
CameraD --> ModelD
SensorD --> LocationD
Cereal -- Connects --> CoreSystem
SystemServices -- Supports --> CoreSystem
Common -- Used by --> CoreSystem
Tools -- Interact with --> CoreSystem
-
Core Components (inherited from OpenPilot):
Loadinggraph TD subgraph "Self-Driving Logic" selfdrive["selfdrive"] end subgraph "Vehicle & Communication Interface" panda["panda (firmware)"] opendbc["opendbc (CAN definitions)"] cereal["cereal (messaging)"] end subgraph "System & Utilities" system["system (low-level services)"] common["common (shared code)"] tools["tools (development utilities)"] end selfdrive --> panda selfdrive --> opendbc selfdrive -- Uses --> cereal system -- Supports --> selfdrive common -- Supports --> selfdrive tools -- Used for --> selfdrive panda --> opendbcselfdrive: The primary software for autonomous driving capabilities.controls: Manages vehicle control (steering, acceleration, braking) throughcontrolsd,plannerd, andradard.modeld: Runs machine learning models for perception (e.g., path planning, object detection).locationd: Handles localization and sensor fusion (GPS, IMU).camerad: Manages camera inputs (on device).ui: Provides the user interface on the device.
panda: Firmware for the Panda hardware interface, which connects to the car's CAN bus. It enforces safety rules. (Submodule:panda/)opendbc: A repository of DBC files (CAN database files) for various car models, used to decode and encode CAN messages. (Submodule:opendbc/)cereal: The messaging framework (using Cap'n Proto) used for inter-process communication.system: Low-level services for logging (loggerd,logcatd), hardware management (hardwared), process management (manager), etc.common: Shared utility code, libraries, and data structures.tools: Various utilities for development, simulation, data analysis, etc.
-
Data Flow (Simplified):
Loadinggraph TD subgraph "Sensors & Inputs" Camera["Camera"] GPS["GPS"] IMU["IMU"] CAN["CAN Bus (via Panda)"] end subgraph "Data Acquisition & Processing" Camerad["camerad"] Sensord["sensord"] Locationd["locationd"] Pandad["pandad"] end subgraph "Core Logic" Modeld["modeld"] Plannerd["plannerd"] Controlsd["controlsd"] end subgraph "Outputs & Logging" UI["ui"] Loggerd["loggerd"] VehicleActuators["Vehicle Actuators (via Panda)"] end Camera --> Camerad GPS & IMU --> Sensord Sensord --> Locationd CAN --> Pandad Camerad --> Modeld Locationd --> Modeld Pandad --> Modeld Modeld --> Plannerd Plannerd --> Controlsd Controlsd --> VehicleActuators Modeld --> UI Plannerd --> UI Controlsd --> UI Camerad --> Loggerd Sensord --> Loggerd Locationd --> Loggerd Pandad --> Loggerd Modeld --> Loggerd Plannerd --> Loggerd Controlsd --> Loggerd- Sensors (cameras, GPS, IMU, CAN via Panda) provide data.
- Processes like
camerad(on device),sensord,locationd, andpandad(interfacing with Panda hardware/firmware) acquire and publish this data usingcereal. modeldprocesses vision data and other inputs to make driving predictions (e.g., path, lead vehicles).plannerduses model outputs, vehicle state, and other inputs (like desired cruise speed) to plan trajectories.controlsdtranslates planned trajectories into vehicle commands (steering angle/torque, acceleration/braking) and sends them to the car's actuators via the Panda interface.- The
uiprocess displays relevant information and status to the driver on the comma device. loggerdlogs data from various processes for debugging, replay, and training.
(This is a very high-level overview. Detailed architecture diagrams and component descriptions will be part of the Wiki documentation.)
We welcome contributions to PoodlePilot! Please see our detailed Contribution Guidelines (Note: this currently points to the original OpenPilot guidelines and may need to be adapted for PoodlePilot) and the project's Code of Conduct (link to be added or file created).
Key points:
- Priorities: Safety, stability, quality, features (in that order).
- Check existing issues and discussions before starting work (refer to PoodlePilot's issue tracker if separate from OpenPilot's).
- Follow coding style and submit well-tested pull requests to the PoodlePilot repository.
- Join the OpenPilot community Discord for discussions with other developers and users. (PoodlePilot specific channels may be established here or elsewhere in the future).
If you find this repository helpful and would like to support its development, consider making a donation:
Your support helps maintain and improve this collection of development tools and templates. Thank you for contributing to open source!
PoodlePilot is a fork of OpenPilot and is also released under the MIT License. See the LICENSE file for more details. The original OpenPilot software is copyrighted by comma.ai and its contributors. Some components inherited from OpenPilot may be under different licenses as specified within their respective directories.

