commaai / opendbc

a Python API for your car
MIT License
1.98k stars 1.17k forks source link
automotive can dbc reverse-engineering

opendbc

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

Docs · Contribute · Discord

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![X Follow](https://img.shields.io/twitter/follow/comma_ai)](https://x.com/comma_ai) [![Discord](https://img.shields.io/discord/469524606043160576)](https://discord.comma.ai)

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

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.

Project Structure

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.