A car port enables openpilot support on a particular car. Each car model openpilot supports needs to be individually ported. The complexity of a car port varies depending on many factors including:
Virtually all car-specific code is contained in two other repositories: opendbc and panda.
Each car brand is supported by a standard interface structure in opendbc/car/[brand]
:
interface.py
: Interface for the car, defines the CarInterface classcarstate.py
: Reads CAN messages from the car and builds openpilot CarState messagescarcontroller.py
: Control logic for executing openpilot CarControl actions on the car[brand]can.py
: Composes CAN messages for carcontroller to sendvalues.py
: Limits for actuation, general constants for cars, and supported car documentationradar_interface.py
: Interface for parsing radar points from the car, if applicableboard/safety/safety_[brand].h
: Brand-specific safety logictests/safety/test_[brand].py
: Brand-specific safety CI testsFor historical reasons, openpilot still contains a small amount of car-specific logic. This will eventually be migrated to opendbc or otherwise removed.
selfdrive/car/car_specific.py
: Brand-specific event logicJason Young gave a talk at COMMA_CON with an overview of the car porting process. The talk is available on YouTube: