Skip to content

commaai/opendbc

Repository files navigation

opendbc

opendbc is a Python API for your car.
Read the speed, steering angle, and more. Send gas, braking, and steering commands.

License: MIT X Follow Discord


Most cars since 2016 have electronically-actuatable steering, gas, and brakes thanks to LKAS and ACC. The goal of this project is to support controlling every single one of those cars. See docs/CARS.md for the current supported cars list.

While the primary focus is on supporting ADAS interfaces for openpilot, we're also interested in reading and writing as many things as we can: EV charge status, lock/unlocking doors, etc.

Contributing

All opendbc development is coordinated on GitHub and Discord. Check out the #dev-opendbc-cars channel and Vehicle Specific section.

Roadmap

Short term

  • pip install opendbc
  • 100% type coverage
  • 100% line coverage
  • Make car ports easier: refactors, tools, tests, and docs
  • Expose the state of all supported cars better: #1144

Longer term

  • Extend support to every car with LKAS + ACC interfaces
  • Automatic lateral and longitudinal control/tuning evaluation
  • Auto-tuning for lateral and longitudinal control
  • Automatic Emergency Braking

Contributions towards anything here are welcome.

Bounties

Every car port is eligible for a bounty:

In addition to the standard bounties, we also offer higher value bounties for more popular cars. See those at comma.ai/bounties.

Project Structure

  • opendbc/dbc/ is a repository of DBC files
  • opendbc/can/ is a library for parsing and building CAN messages from DBC files
  • opendbc/car/ is a high-level library for interfacing with cars using Python

Quick start

git clone https://github.com/commaai/opendbc.git

cd opendbc

# Install the dependencies
pip3 install -e .[testing,docs]

# Build
scons -j8

# Run the tests
pytest .

# Run the linter
pre-commit run --all-files

# ./test.sh is the all-in-one that will install deps, build, lint, and test
./test.sh

examples/ contains small example programs that can read state from the car and control the steering, gas, and brakes. examples/joystick.py allows you to control a car with a joystick.

FAQ

How do I use this?

Depends on what you want to do. openpilot is our development target and offers a replacement for your car's ADAS, but you can also use a panda for basic control or just reading state from your car.

What hardware do I need?

Which cars are supported?

See the supported cars list.

Can I add support for my car?

Yes, most car support comes from the community. Join the Discord and watch this talk to get started. (We also offer paid bounties on car ports.)

Which cars can be supported?

Any car with LKAS and ACC. More info here.

How does this work?

In short, we designed hardware to sit at a convenient spot on your car's communication bus that allows for filtering out interesting messages and replacing them with our own.
See this talk for an in-depth explanation.

Come work with us -- comma.ai/jobs

comma is hiring engineers to work on opendbc and openpilot. We love contributors.