Home

Awesome

<div align="center" style="text-align: center;"> <h1>opendbc</h1> <p> <b>opendbc is a Python API for your car.</b> <br> Control the gas, brake, steering, and more. Read the speed, steering angle, and more. </p> <h3> <a href="https://docs.comma.ai">Docs</a> <span> · </span> <a href="https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md">Contribute</a> <span> · </span> <a href="https://discord.comma.ai">Discord</a> </h3>

License: MIT X Follow Discord

</div>

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 the steering, gas, and brakes on every single one of those cars.

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) such that we can build the best vehicle management app ever.


This README and the supported cars list are all the docs for the opendbc project. Everything you need to know to use, contribute, and extend opendbc are in these docs.

Quick start

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

# you probably just want to use this. it's an all-in-one for dependency
# installation, compiling, linting, and tests. it's also what runs in CI
./test.sh

# here are the individual commands it runs
pip3 install -e .[testing,docs]  # install dependencies
scons -j8                        # build with 8 cores
pytest .                         # run the tests
pre-commit run --all-files       # run the linter

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.

Project Structure

How to Port a Car

This guide covers everything from adding support to a new car all the way to improving existing cars (e.g. adding longitudinal control or radar parsing). If similar cars to yours are already compatible, most of this work is likely already done for you.

At its most basic, a car port will control the steering on a car. A "complete" car port will have all of: lateral control, longitudinal control, good tuning for both lateral and longitudinal, radar parsing (if equipped), fuzzy fingerprinting, and more. The new car support docs will clearly communicate each car's support level.

Connect to the Car

The first step is to get connected to the car with a comma 3X and a car harness. The car harness gets you connected to two different CAN buses and splits one of those buses to send our own actuation messages.

If you're lucky, a harness compatible with your car will already be designed and sold on comma.ai/shop. If you're not so lucky, start with a "developer harness" from comma.ai/shop and crimp on whatever connector you need.

Structure of a port

Depending on , most of this basic structure will already be in place.

The entirery of a car port lives in opendbc/car/<brand>/:

Reverse Engineer CAN messages

Start off by recording a route with lots of interesting events: enable LKAS and ACC, turn the steering wheel both extremes, etc. Then, load up that route in cabana.

Tuning

Longitudinal

Use the longitudinal maneuvers report to evaluate your car's longitudinal control and tune it.

Contributing

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

Roadmap

Short term

Longer term

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.

FAQ

How do I use this? A comma 3X is custom-designed to be the best way to run and develop opendbc and openpilot.

Which cars are supported? See the supported cars list.

Can I add support for my car? Yes, most car support comes from the community. Read the guide here.

Which cars can be supported? Any car with LKAS and ACC. More info here.

How does this work? In short, we designed hardware to replace your car's built-in lane keep and adaptive cruise features. See this talk for an in-depth explanation.

Is there a timeline or roadmap for adding car support? No, most car support comes from the community, with comma doing final safety and quality validation. The more complete the community car port is and the more popular the car is, the more likely we are to pick it up as the next one to validate.

Terms

More resources

Come work with us -- comma.ai/jobs

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