• Stars
    star
    1,393
  • Rank 33,729 (Top 0.7 %)
  • Language
    C++
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

democratize access to car decoder rings

DBC file basics

A DBC file encodes, in a humanly readable way, the information needed to understand a vehicle's CAN bus traffic. A vehicle might have multiple CAN buses and every CAN bus is represented by its own dbc file. Wondering what's the DBC file format? Here and Here a couple of good overviews.

How to start reverse engineering cars

opendbc is integrated with cabana.

Use panda to connect your car to a computer.

How to use reverse engineered DBC

To create custom CAN simulations or send reverse engineered signals back to the car you can use CANdevStudio project.

DBC file preprocessor

DBC files for different models of the same brand have a lot of overlap. Therefore, we wrote a preprocessor to create DBC files from a brand DBC file and a model specific DBC file. The source DBC files can be found in the generator folder. After changing one of the files run the generator.py script to regenerate the output files. These output files will be placed in the root of the opendbc repository and are suffixed by _generated.

Good practices for contributing to opendbc

  • Comments: the best way to store comments is to add them directly to the DBC files. For example:

    CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
    

    is a comment that refers to signal LONG_ACCEL in message 490. Using comments is highly recommended, especially for doubts and uncertainties. cabana can easily display/add/edit comments to signals and messages.

  • Units: when applicable, it's recommended to convert signals into physical units, by using a proper signal factor. Using a SI unit is preferred, unless a non-SI unit rounds the signal factor much better. For example:

    SG_ VEHICLE_SPEED : 7|15@0+ (0.00278,0) [0|70] "m/s" PCM
    

    is better than:

    SG_ VEHICLE_SPEED : 7|15@0+ (0.00620,0) [0|115] "mph" PCM
    

    However, the cleanest option is really:

    SG_ VEHICLE_SPEED : 7|15@0+ (0.01,0) [0|250] "kph" PCM
    
  • Signal size: always use the smallest amount of bits possible. For example, let's say I'm reverse engineering the gas pedal position and I've determined that it's in a 3 bytes message. For 0% pedal position I read a message value of 0x00 0x00 0x00, while for 100% of pedal position I read 0x64 0x00 0x00: clearly, the gas pedal position is within the first byte of the message and I might be tempted to define the signal GAS_POS as:

    SG_ GAS_POS : 7|8@0+ (1,0) [0|100] "%" PCM
    

    However, I can't be sure that the very first bit of the message is referred to the pedal position: I haven't seen it changing! Therefore, a safer way of defining the signal is:

    SG_ GAS_POS : 6|7@0+ (1,0) [0|100] "%" PCM
    

    which leaves the first bit unallocated. This prevents from very erroneous reading of the gas pedal position, in case the first bit is indeed used for something else.

More Repositories

1

openpilot

openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
Python
40,192
star
2

research

dataset and code for 2016 paper "Learning a Driving Simulator"
Python
4,105
star
3

neo

comma neo research platform
1,627
star
4

panda

code powering the comma.ai panda
C
1,340
star
5

speedchallenge

The comma.ai Speed Prediction Challenge!
784
star
6

calib_challenge

The comma.ai Calibration Challenge!
Python
780
star
7

comma10k

10k crowdsourced images for training segnets
Python
670
star
8

laika

Simple Python GNSS processing library
Python
647
star
9

comma2k19

A driving dataset for the development and validation of fused pose estimators and mapping algorithms
Jupyter Notebook
572
star
10

rednose

Kalman filter library
Python
297
star
11

commavq

commaVQ is a dataset of compressed driving video
Jupyter Notebook
291
star
12

cereal

capnp struct definitions and messaging used in comma ecosystem
Cap'n Proto
157
star
13

cabana

CAN visualizer and DBC maker
JavaScript
154
star
14

chffrplus

open source dashcam software
C
133
star
15

eon-neos

Operating System for your comma two and EON
Python
122
star
16

connect

comma connect PWA
JavaScript
108
star
17

commacoloring

you like coloring books?
JavaScript
101
star
18

body

firmware for the comma body robotics dev kit
C
56
star
19

chffr-api

API to access chffr data!
JavaScript
51
star
20

monitoring

The comma.ai Driver Monitoring Challenge!
51
star
21

openpilot-apks

The source code for the APK that runs inside openpilot.
JavaScript
47
star
22

pandajs

JavaScript
46
star
23

agnos

the operating system for your comma 3/3X
Python
39
star
24

depth10k

10k images for unsupervised depthnets
HTML
37
star
25

agnos-builder

Build AGNOS, the operating system for your comma 3/3X
Python
32
star
26

eon-neos-builder

Build NEOS, the operating system for your EON
C
27
star
27

comma-steering-control

Jupyter Notebook
25
star
28

entium

A helper for converting entwine tile data into cesium tiles
Python
21
star
29

connect-app

comma Connect Mobile App
JavaScript
21
star
30

trafficlights

Simple neural network to recognize the color of traffic lights
Jupyter Notebook
20
star
31

panda-artifacts

Releases of panda code.
Python
16
star
32

eon-neos-leeco

Operating System for your EON Gold
Shell
13
star
33

android_kernel_comma_msm8996

C
12
star
34

comma-x-native

X UI Library for React Native
JavaScript
12
star
35

vidutil.js

Decode H.264 and HEVC bitstreams in the browser using FFmpeg and WebAssembly
C
10
star
36

log_reader_js

Javascript implementation of the capnp log reader
JavaScript
10
star
37

android_device_oneplus_oneplus3

upstream: https://github.com/sultanxda/android_device_oneplus_oneplus3
C
8
star
38

gnss-data

Shell
8
star
39

agnos-kernel-sdm845

Kernel for the SDM845 modules
C
8
star
40

usr

usr directory from NEOS
Python
8
star
41

jobs

work @ comma.ai
8
star
42

new-connect

a rewrite of comma connect
TypeScript
8
star
43

android_kernel_leeco_msm8996

upstream: https://github.com/LineageOS/android_kernel_leeco_msm8996/commits/cm-13.0
C
6
star
44

android_system_core

upstream: https://github.com/CyanogenMod/android_system_core
C++
6
star
45

gnss-data-alt

Shell
5
star
46

android_vendor_oneplus_oneplus3

Makefile
5
star
47

android_frameworks_base

upstream: https://github.com/CyanogenMod/android_frameworks_base
Java
5
star
48

comma-api

JavaScript
5
star
49

android_build

upstream: https://github.com/cyanogenmod/android_build
Makefile
5
star
50

flash

JavaScript
5
star
51

panda_jungle

Code powering the Panda Jungle debug board
C
4
star
52

can-message

JavaScript
4
star
53

openpilot-pyextra

Python
4
star
54

tipsi-stripe

Fork of tipsi-stripe removing Android firebase dependency
JavaScript
4
star
55

android_system_extras_su

upstream: https://github.com/CyanogenMod/android_system_extras_su
C
3
star
56

android_packages_apps_NEOSSetup

JavaScript
3
star
57

my-comma-auth

shared auth utils for my.comma.ai apps (explorer, cabana)
JavaScript
3
star
58

tensorflow-autodetect

Automatically install the cpu or gpu version of Tensorflow
Python
3
star
59

cabana-issues

Public issue tracker for https://cabana.comma.ai
3
star
60

android_packages_apps_Settings

upstream: https://github.com/CyanogenMod/android_packages_apps_Settings
Java
3
star
61

qtlocation

C++
2
star
62

gnss-data-hourly

Shell
2
star
63

android

upstream: https://github.com/CyanogenMod/android -b cm-13.0
2
star
64

android_kernel_oneplus_msm8996

upstream: https://github.com/CyanogenMod/android_kernel_oneplus_msm8996
C
2
star
65

apkpatch

generates and applies efficient patch files to whole apks
Java
2
star
66

android_frameworks_opt_net_wifi

upstream: https://github.com/CyanogenMod/android_frameworks_opt_net_wifi
Java
2
star
67

android_packages_inputmethods_LatinIME

upstream: https://github.com/CyanogenMod/android_packages_inputmethods_LatinIME
Java
2
star
68

slurm-builder

Shell
1
star
69

android_hardware_quectel

Prebuilt RIL binaries for Quectel modems
Makefile
1
star
70

android_frameworks_opt_telephony

upstream: https://github.com/CyanogenMod/android_frameworks_opt_telephony
Java
1
star
71

android_device_oppo_common

upstream: https://github.com/CyanogenMod/android_device_oppo_common
Java
1
star
72

android_vendor_cm

upstream: https://github.com/CyanogenMod/android_vendor_cm
CSS
1
star
73

opencv-python-builder

Dockerfile
1
star
74

android_packages_apps_Bluetooth

upstream: https://github.com/CyanogenMod/android_packages_apps_Bluetooth
Java
1
star