commaai/opendbc

a Python API for your car

What it solves

opendbc provides a standardized Python API to interface with a wide variety of modern vehicles. It solves the problem of fragmented and proprietary vehicle communication protocols, allowing developers to read car state (like speed and steering angle) and control vehicle actuators (gas, brake, and steering) across different car brands and models.

How it works

The project operates by interacting with a car's CAN bus—the internal network that connects a vehicle's electronic control units (ECUs). It uses DBC files (CAN database files) to translate raw binary CAN messages into human-readable data and vice versa. The architecture consists of:

  • DBC Repository: A collection of database files defining the messages for various cars.
  • CAN Library: Tools for parsing and building CAN messages based on those DBC files.
  • Car Interface: A high-level Python library that abstracts the hardware and protocol details into a usable API.
  • Safety Model: Firmware that enforces safety constraints to prevent dangerous actuation commands.

Who it’s for

It is primarily designed for developers building Advanced Driver Assistance Systems (ADAS), such as openpilot, as well as researchers and engineers interested in vehicle management apps or autonomous driving research.

Highlights

  • Broad Compatibility: Targets any car produced since 2016 with electronically-actuatable steering, gas, and brakes (LKAS and ACC).
  • Full Control: Supports both lateral (steering) and longitudinal (gas/brake) control.
  • Reverse Engineering Tools: Integrates with tools like Cabana to help developers decode proprietary CAN messages for new car ports.
  • Rigorous Safety: Employs a safety firmware model with strict code standards (including MISRA C:2012) and high test coverage to ensure vehicle safety.

Related

  • Project
  • Project
  • Project
  • Project
  • Project