Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit c8beb97
Author: Shane Smiskol <[email protected]>
Date:   Mon Sep 16 17:30:34 2024 -0700

    Toyota: add brake force signal for hybrids (commaai#1247)

    add brake force signal

commit de025ae
Author: Shane Smiskol <[email protected]>
Date:   Mon Sep 16 17:05:56 2024 -0700

    Toyota: add drive force signal for hybrids (commaai#1246)

    * add new signal

    * set minmax

    * better comments

    * clarify

    * add FDRVREAL for hybrids

    * forgot scaling factor

commit cb92fc8
Author: Shane Smiskol <[email protected]>
Date:   Mon Sep 16 16:15:40 2024 -0700

    Toyota: add another acceleration request signal (commaai#1245)

    * add new signal

    * set minmax

    * better comments

    * clarify

commit 6f08c8a
Author: Shane Smiskol <[email protected]>
Date:   Mon Sep 16 14:48:20 2024 -0700

    Toyota: add ENG2F41 (commaai#1244)

    add ENG2F41

commit 57ebdbf
Author: Jakub Czekański <[email protected]>
Date:   Sun Sep 15 17:17:09 2024 +0200

    VW MQB: Keep CAN IDs in order (commaai#1243)

    ACC_02 had address in decimal format and was out of order.

commit 811ed77
Author: Jakub Czekański <[email protected]>
Date:   Sat Sep 14 00:04:34 2024 +0200

    VW MQB: Add missing ESP_33 messages and tests (commaai#1242)

    Added new CRC without coverage - oversight from rebasing commaai#1016

commit d55feec
Author: Jakub Czekański <[email protected]>
Date:   Fri Sep 13 18:22:34 2024 +0200

    VW MQB: Add CRC for Airbag_01, ESP_02, ESP10, ESP33, Licht_Anf_01 (commaai#1016)

    VW MQB: Add crc for Airbag_01, ESP_02, ESP_10, ESP_33 and Licht_Anf_01

commit 0994697
Author: Jakub Czekański <[email protected]>
Date:   Fri Sep 13 16:43:16 2024 +0200

    VW MQB: Refactored CRC calculation (commaai#1236)

    * VW MQB: Refactor CRC constants

    Big switch statement in volkswagen_mqb_checksum was refactored with map of arrays.
    With this approach there's no need for specifying all 16 byte values if constant is the same for all of them.

    * temporary, repeat packing step 1M times

    * follow comma convention for include order

    * comma indent convention, tighten message annotations

    * whitespace

    * cleanup

    * more comma indent convention

    * Revert "temporary, repeat packing step 1M times"

    This reverts commit 06d8f46.

    * comment touch-up

    * beautify spacing

    * codespell says you're gonna have to Google it

    * fully initialize all data ID arrays

    * clarify array name as part of VW support

    * fix comment typo

    ---------

    Co-authored-by: Jason Young <[email protected]>

commit 2b85882
Author: Adeeb Shihadeh <[email protected]>
Date:   Thu Sep 12 17:03:18 2024 -0700

    toyota doesn't have gas

commit 56c7afa
Author: Shane Smiskol <[email protected]>
Date:   Thu Sep 12 16:55:06 2024 -0700

    rm longitudinal profiles (commaai#1240)

    rm

commit b43d300
Author: Shane Smiskol <[email protected]>
Date:   Thu Sep 12 16:36:04 2024 -0700

    fix spacing for test_checksums (commaai#1239)

commit 751404a
Author: Jakub Czekański <[email protected]>
Date:   Thu Sep 12 21:02:08 2024 +0200

    VW MQB: Added unittests for CRC calculation (commaai#1235)

    * VW MQB: Added unittests for CRC calculation

    Some of the messages are either missing fields that causes serialization to skip bits
    or CRC/BZ fields aren't picked up by packers leading to invalid values.

    * VW MQB: Add missing fields in Getriebe_11

    Test case is reenabled and now passes

    * EV_Gearshift -> Motor_EV_01, enable test

    * skip Getribe_11 testing with a note about why

    * reenable all others, except SWA_01

    * turns out we can still test Getriebe_11

    * New test data for SWA_01, re-enable test

    * no longer a need for test skipping

    * no longer a need for custom tests

    * more concise

    * prefix with VW for clarity

    ---------

    Co-authored-by: Jason Young <[email protected]>

commit 4b31c18
Author: Jason Young <[email protected]>
Date:   Thu Sep 12 14:00:50 2024 -0400

    VW MQB: Various message and signal updates (commaai#1238)

    * VehicleSpeed -> ESP_08

    * ESP_21 updates

    * Motor_20 updates

    * SWA_01 updates

    * ESP_20 updates

    * Getriebe_11 updates

commit d8aba58
Author: Jason Young <[email protected]>
Date:   Thu Sep 12 12:39:20 2024 -0400

    VW MQB: EV_Gearshift -> Motor_EV_01 (commaai#1237)

    * DBC updates

    * update comment in CRC function

    * updates to carstate and interface

    * update shifter VAL lookup

commit c43cd3a
Author: Shane Smiskol <[email protected]>
Date:   Tue Sep 10 19:07:24 2024 -0700

    Nidec: add longitudinal control comment

    This name is confusion

commit 3ff9057
Author: Shane Smiskol <[email protected]>
Date:   Tue Sep 10 15:20:34 2024 -0700

    Test all torque cars' lateral limits (commaai#1232)

    * test more models!

    * Impreza 2020: reach max in ~0.8s instead of ~0.6

    * leave todo for gen2, not safety critical since jerk is under threshold (1000/40*2/100=0.5s)

    * fix honda

commit ef7102a
Author: Adeeb Shihadeh <[email protected]>
Date:   Sat Sep 7 16:32:53 2024 -0700

    Toyota: AEB actuation setup (commaai#1227)

    * try this

    * cleanup

    * lil more

    ---------

    Co-authored-by: Shane Smiskol <[email protected]>

commit c0a9ab5
Author: Shane Smiskol <[email protected]>
Date:   Thu Sep 5 15:45:42 2024 -0700

    Move radar delay to carParams (commaai#1224)

    move radar delay to CP

commit 3dde383
Author: Shane Smiskol <[email protected]>
Date:   Thu Sep 5 14:15:40 2024 -0700

    Radar interface getter (commaai#1220)

    * ret it now

    * don't forget

    * better

commit 86be858
Author: Jason Young <[email protected]>
Date:   Thu Sep 5 13:23:46 2024 -0400

    Hongqi: Add DBC for Hongqi HS5 (commaai#580)

commit 1994800
Author: dkiiv <[email protected]>
Date:   Thu Sep 5 12:47:35 2024 -0400

    VW PQ: Volkswagen Jetta 6th Gen (commaai#1208)

    VW PQ: add fingerprint for new car model

commit 6619c18
Author: Maxime Desroches <[email protected]>
Date:   Wed Sep 4 14:48:02 2024 -0700

    distutils comment (commaai#1222)

    comment

commit 1e6e045
Author: Maxime Desroches <[email protected]>
Date:   Wed Sep 4 14:20:59 2024 -0700

    add setuptools for python3.12 (commaai#1221)

    setuptools

commit ebb6d22
Author: Shane Smiskol <[email protected]>
Date:   Wed Sep 4 14:11:29 2024 -0700

    Revert "pytest: add default fixture option for pytest-asyncio"

    This reverts commit 81b081b.

commit 81b081b
Author: Shane Smiskol <[email protected]>
Date:   Wed Sep 4 13:59:50 2024 -0700

    pytest: add default fixture option for pytest-asyncio

    commaai/openpilot#33442

commit 936bd83
Author: Shane Smiskol <[email protected]>
Date:   Wed Sep 4 13:59:21 2024 -0700

    Kia EV6: change non-US entry back to Southeast Asia

    A EV6 user in AUS has a Kia EV6 GT 2023 with no adas ecu, so they needed the without HDA II harness instead

commit ff198e9
Author: Shane Smiskol <[email protected]>
Date:   Wed Sep 4 12:55:50 2024 -0700

    GM: add TODO for feature sets

commit 8a4b246
Author: Shane Smiskol <[email protected]>
Date:   Wed Sep 4 12:53:49 2024 -0700

    Reapply "GM: Car Port for 2019 Chevy Volt" (commaai#1218) (commaai#1219)

    * Reapply "GM: Car Port for 2019 Chevy Volt" (commaai#1218)

    This reverts commit 1c19fd0.

    * fix safety mismatch

commit f383e5c
Author: Shane Smiskol <[email protected]>
Date:   Tue Sep 3 19:11:31 2024 -0700

    fix interfaces usage

commit 1c19fd0
Author: Shane Smiskol <[email protected]>
Date:   Tue Sep 3 19:06:36 2024 -0700

    Revert "GM: Car Port for 2019 Chevy Volt" (commaai#1218)

    Revert "GM: Car Port for 2019 Chevy Volt (commaai#1210)"

    This reverts commit ca3b5c4.

commit e1318f2
Author: Shane Smiskol <[email protected]>
Date:   Tue Sep 3 15:53:06 2024 -0700

    interfaces returns RadarInterface (commaai#1217)

    interfaces returns radarinterface

commit ca3b5c4
Author: garrettpall <[email protected]>
Date:   Tue Sep 3 16:37:42 2024 -0400

    GM: Car Port for 2019 Chevy Volt (commaai#1210)

    * Add 2019 Volt Support

    * Add Route

    * Add Package

    I think LKA is part of Driver Confidence II Package and ACC is it's own add one

commit 7bf0ecd
Author: Adeeb Shihadeh <[email protected]>
Date:   Mon Sep 2 11:24:05 2024 -0700

    fix typo

commit 727f5c1
Author: Adeeb Shihadeh <[email protected]>
Date:   Mon Sep 2 11:16:28 2024 -0700

    add roadmpa

commit 6de42e3
Author: Adeeb Shihadeh <[email protected]>
Date:   Sun Sep 1 15:08:49 2024 -0700

    remove unused

commit 48ab55f
Author: Adeeb Shihadeh <[email protected]>
Date:   Sun Sep 1 15:03:30 2024 -0700

    panda_runner: fixup safety mode setting

commit b4d39b9
Author: Adeeb Shihadeh <[email protected]>
Date:   Sat Aug 31 16:00:02 2024 -0700

    Toyota: more ACC-related definitions (commaai#1215)

commit 26dfa1d
Author: Alexandre Nobuharu Sato <[email protected]>
Date:   Sat Aug 31 15:41:11 2024 -0300

    ci: Bot comment only for first timers (commaai#1213)

    * ci: Bot comment only for first timers and collapsible sections for UI screenshots

    Added also implement collapsible sections for UI screenshots #33415 <commaai/openpilot#33415>

    * fix

    * Update auto_pr_review.yaml

commit 227908e
Author: garrettpall <[email protected]>
Date:   Sat Aug 31 13:28:03 2024 -0400

    GM: Car Port for XT4 2023 (commaai#1177)

    * GM: Car Port for XT4 2023

    * Remove Comment to Match

    * Update opendbc/car/gm/values.py

    ---------

    Co-authored-by: Adeeb Shihadeh <[email protected]>

commit 732bf8f
Author: Adeeb Shihadeh <[email protected]>
Date:   Fri Aug 30 21:54:15 2024 -0700

    longitudinal maneuvers fixups (commaai#1209)

    * corolla updates

    * lil more

    * lil more

    * fix

    ---------

    Co-authored-by: Comma Device <[email protected]>

commit f99bb69
Author: Adeeb Shihadeh <[email protected]>
Date:   Fri Aug 30 20:04:46 2024 -0700

    longitudinal maneuvers: proper ratekeeping

commit c928f6b
Author: Adeeb Shihadeh <[email protected]>
Date:   Fri Aug 30 16:45:10 2024 -0700

    longitudinal maneuvers: add gas/brake step responses (commaai#1207)

    * longitudinal maneuvers: add gas/brake step responses

    * corolla updates

    * initial speed

    * try beep

    * beep

    * corolla updates

    * add vego

    * enable all

    ---------

    Co-authored-by: Comma Device <[email protected]>

commit f2fa755
Author: Adeeb Shihadeh <[email protected]>
Date:   Fri Aug 30 13:48:13 2024 -0700

    longitudinal profile runner (commaai#1197)

    * long profiles

    * start with creep

    * lil cleanup

    * corolla updates

    * cleanup

    * 2s

    * plot is a little nicer

    * strict mode

    * cleanup

    * unused

    * fix that

    ---------

    Co-authored-by: Comma Device <[email protected]>

commit cbad7f0
Author: Adeeb Shihadeh <[email protected]>
Date:   Thu Aug 29 15:12:44 2024 -0700

    simple joystick example (commaai#1200)

    * setup runner

    * port over joystickd

    * fix mypy

    * set accel and steer

commit a1b95d7
Author: Shane Smiskol <[email protected]>
Date:   Thu Aug 29 12:21:25 2024 -0700

    Honda: distance bars always cycle 1, 2, 3 (commaai#1201)

    1 is 1

commit c0aa729
Author: Adeeb Shihadeh <[email protected]>
Date:   Wed Aug 28 19:28:52 2024 -0700

    new optional syntax

commit 6cb7851
Author: Adeeb Shihadeh <[email protected]>
Date:   Wed Aug 28 19:27:13 2024 -0700

    car: default now_nanos value

commit aa1d21b
Author: Adeeb Shihadeh <[email protected]>
Date:   Wed Aug 28 17:51:06 2024 -0700

    ignore uv.lock for now

commit 3a8a864
Author: Shane Smiskol <[email protected]>
Date:   Tue Aug 27 16:10:41 2024 -0700

    Toyota: add a VSC message (commaai#1190)

    * add a vsc message

    * rename

    * rename

    * add comments

    * rename

    * rename

commit c9650ff
Author: Irene <[email protected]>
Date:   Wed Aug 28 08:47:46 2024 +1000

    Toyota: add misc adas/toggle signal definitions (commaai#1076)

    * Toyota: add signals

    * run generator

    * better name

    * engine running signal

commit 7009381
Author: Shane Smiskol <[email protected]>
Date:   Mon Aug 26 22:26:32 2024 -0700

    Revert "GM: implement allow throttle/brakes" (commaai#1187)

    Revert "GM: implement allow throttle/brakes (commaai#1185)"

    This reverts commit 8e20376.

commit 8e20376
Author: Shane Smiskol <[email protected]>
Date:   Mon Aug 26 21:47:18 2024 -0700

    GM: implement allow throttle/brakes (commaai#1185)

    implement allow gnb for GM

commit 46790af
Author: Adeeb Shihadeh <[email protected]>
Date:   Mon Aug 26 17:04:32 2024 -0700

    CI should use the defaults

commit 81fcc40
Author: Adeeb Shihadeh <[email protected]>
Date:   Mon Aug 26 17:02:38 2024 -0700

    openpilot isn't required for a car port PR (commaai#1183)

    * move test routes here

    * check for missing

    * no shebang

commit f6f0674
Author: Shane Smiskol <[email protected]>
Date:   Wed Aug 21 00:58:28 2024 -0700

    tests: some speed optimizations (commaai#1181)

    * mock sleep via monotonic

    * rm

    * no need to generate 8 buses

    * this doesn't actually make a big diff

    * lower loop

    * can reduce

    * here too

    * Revert "here too"

    This reverts commit 06b4cad.

    * Revert "can reduce"

    This reverts commit 55cae02.

commit 06c51c1
Author: Shane Smiskol <[email protected]>
Date:   Wed Aug 21 00:26:32 2024 -0700

    add test_car_interfaces.py (commaai#1178)

    * add test_car_interfaces.py

    * rm op stuff

    * fix

    * justsee

    * optimize get_fuzzy_car_interface_args a bit

    * Revert "optimize get_fuzzy_car_interface_args a bit"

    This reverts commit ba4d07f.

    * lower examples for now

    * sheesh

    * revert time

commit c02e83d
Author: Shane Smiskol <[email protected]>
Date:   Tue Aug 20 23:36:08 2024 -0700

    speedup CI (commaai#1179)

    * no setup python

    * replace with uv

    * test

    * test

    * test

    * test

    * test

    * test

    * test

    * test

    * test

    * test

    * test

    * test

    * slightly faster

    * this doesnt do anything without seen ecus

    * test

    * is durations slow?

    * not now

    * test in another pr

    * same to static

    * static

    * test

    * test

    * test

    * the action used to cache as well

    * test

commit 7d6f7cb
Author: Shane Smiskol <[email protected]>
Date:   Tue Aug 20 15:45:43 2024 -0700

    add banned apis

commit 3229aa2
Author: Shane Smiskol <[email protected]>
Date:   Tue Aug 20 15:41:30 2024 -0700

    add test_lateral_limits.py

commit fa1d7e7
Author: Shane Smiskol <[email protected]>
Date:   Mon Aug 19 17:59:36 2024 -0700

    fixup auto labeler (commaai#1089)

    * test

    * test

    * test

    * make sure to detect subdirectories like tests/

    * test

    * this should work

    * this should work

    * wtf is this

    * test

    * clean up

    * test

    * test

    * clean up

    * clean up

commit ff1c8b4
Author: Adeeb Shihadeh <[email protected]>
Date:   Mon Aug 19 15:18:50 2024 -0700

    add opendbc/can/ to LIBPATH

commit dc4de1a
Author: Shane Smiskol <[email protected]>
Date:   Mon Aug 19 14:34:32 2024 -0700

    rename car label

commit 8866aa7
Author: Adeeb Shihadeh <[email protected]>
Date:   Sun Aug 18 12:08:53 2024 -0700

    this was getting installed from panda

commit 5ed7a83
Author: Adeeb Shihadeh <[email protected]>
Date:   Sun Aug 18 11:32:03 2024 -0700

    more robust libdbc linking

commit d377af6
Author: Adeeb Shihadeh <[email protected]>
Date:   Sun Aug 18 11:01:09 2024 -0700

    pyyaml is unused

commit 74e042d
Author: Dean Lee <[email protected]>
Date:   Mon Aug 19 00:24:50 2024 +0800

    Remove Static Library from Build Script (commaai#1084)

    remove static lib

commit 357e43f
Author: Adeeb Shihadeh <[email protected]>
Date:   Sat Aug 17 12:42:16 2024 -0700

    simple README (commaai#1083)

    * init

    * Update README.md

commit 17e21fe
Author: Adeeb Shihadeh <[email protected]>
Date:   Sat Aug 17 12:16:30 2024 -0700

    CI: auto PR review (commaai#1082)

commit 3537404
Author: Adeeb Shihadeh <[email protected]>
Date:   Sat Aug 17 12:04:46 2024 -0700

    no docker (commaai#1081)

    * cleanup dependencies

    * all

    * install

    * less

    * try this

    * slimmm

    * skip docker

    * silence that one

    * disable for now

    * e

    * fix build

    * bring that back

    * not ready yet

commit 0a9727a
Author: Adeeb Shihadeh <[email protected]>
Date:   Sat Aug 17 10:28:49 2024 -0700

    one minute ci (commaai#1080)

    * speeeeed

    * version

    * disable

    * cppcheck

    * pip install

    * no update?

    * timeout

commit 9a53f08
Author: Shane Smiskol <[email protected]>
Date:   Sat Aug 17 00:38:33 2024 -0700

    move selfdrive/car to opendbc (commaai#1049)

    * move most of /car

    * rename selfdrive.car imports to opendbc.car

    * move some car tests

    move some car tests

    * fix car tests

    * fix actions?

    * add panda ignore to pytest

    * need these ignores from openpilot

    * fix tests for outside pip install (openpilot/local)

    forgot

commit 132b1a6
Author: Shane Smiskol <[email protected]>
Date:   Fri Aug 16 22:24:44 2024 -0700

    Bump pre-commit hooks, more coverage (similar to openpilot) (commaai#1078)

    * pytest defaults

    * move some stuff to pyproject

    * bump codespell

    * more like openpilot

commit f4d077b
Author: Shane Smiskol <[email protected]>
Date:   Wed Aug 7 17:30:23 2024 -0500

    CANPacker: msg type is tuple (commaai#1077)

    not mutable list

commit 1e9f853
Author: Adeeb Shihadeh <[email protected]>
Date:   Thu Aug 1 23:17:16 2024 -0700

    fix ruff warnings

commit 5c16f7e
Author: Shane Smiskol <[email protected]>
Date:   Thu Aug 1 16:40:51 2024 -0700

    define project (commaai#1073)

    * define project

    * spacing

    * cleanup
  • Loading branch information
adurham committed Sep 20, 2024
1 parent 26dda29 commit 3058b7e
Show file tree
Hide file tree
Showing 171 changed files with 25,322 additions and 363 deletions.
68 changes: 68 additions & 0 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
CI / testing:
- changed-files:
- any-glob-to-any-file: '.github/**'

car:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/**'

can:
- changed-files:
- any-glob-to-any-file: 'opendbc/can/**'

DBC signals:
- changed-files:
- any-glob-to-any-file: 'opendbc/dbc/**'


body:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/body/**'

chrysler:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/chrysler/**'

ford:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/ford/**'

gm:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/gm/**'

honda:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/honda/**'

hyundai:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/hyundai/**'

mazda:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/mazda/**'

nissan:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/nissan/**'

subaru:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/subaru/**'

tesla:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/tesla/**'

toyota:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/toyota/**'

volkswagen:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/volkswagen/**'

fingerprint:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/*/fingerprints.py'
49 changes: 49 additions & 0 deletions .github/workflows/auto_pr_review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "PR review"
on:
pull_request_target:
types: [opened, reopened, synchronize, edited, edited]

jobs:
labeler:
name: review
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Label PRs
- uses: actions/[email protected]
with:
dot: true
configuration-path: .github/labeler.yaml

# Check PR target branch
- name: check branch
uses: Vankka/pr-target-branch-action@def32ec9d93514138d6ac0132ee62e120a72aed5
if: github.repository == 'commaai/opendbc'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target: /^(?!master$).*/
exclude: /commaai:.*/
change-to: ${{ github.base_ref }}
already-exists-action: close_this
already-exists-comment: "Your PR should be made against the `master` branch"

# Welcome comment
- name: "First timers PR"
uses: actions/first-interaction@v1
if: github.event.pull_request.head.repo.full_name != 'commaai/opendbc'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: |
<!-- _(run_id **${{ github.run_id }}**)_ -->
Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:
* Convert your PR to a draft unless it's ready to review
* Read the [contributing docs](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md)
* Before marking as "ready for review", ensure:
* the goal is clearly stated in the description
* all the tests are passing
* include a route or your device' dongle ID if relevant
62 changes: 33 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
name: tests

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:

env:
RUN: docker run -e PYTHONWARNINGS="error,default::DeprecationWarning" --shm-size 1G --rm opendbc /bin/bash -c
BUILD: docker buildx build --pull --load --cache-to type=inline --cache-from type=registry,ref=ghcr.io/commaai/opendbc:latest -t opendbc -f Dockerfile .
PYTHONWARNINGS: error
# TODO: enable this
#env:
# PYTHONWARNINGS: error,default::DeprecationWarning

jobs:
unit-tests:
name: unit tests
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 1
#strategy:
# fail-fast: false
# matrix:
# run: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: eval "$BUILD"
- name: Unit tests
run: ${{ env.RUN }} "pytest -n logical --durations=0"
- name: setup python
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
# TODO: remove setuptools once https://github.com/cython/cython/issues/5751 is fixed
uv pip install -e .[testing,docs] setuptools
- run: uv run scons -j$(nproc)
- run: uv run pytest .

static-analysis:
name: static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: eval "$BUILD"
- name: pre-commit
# TODO: a package pre-commit installs has a warning, remove the unset once that's fixed
run: ${{ env.RUN }} "git init && git add -A && unset PYTHONWARNINGS && pre-commit run --all"

docker-push:
name: docker push
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/opendbc'
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: eval "$BUILD"
- name: Push to dockerhub
- run: sudo apt install --no-install-recommends -y cppcheck
- name: setup python
run: |
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
docker tag opendbc ghcr.io/commaai/opendbc:latest
docker push ghcr.io/commaai/opendbc:latest
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
uv pip install -e . pre-commit
- name: cache pre-commit environments
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- run: uv run pre-commit run --all
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build/
.mypy_cache/
*.pyc
*.os
Expand All @@ -7,6 +8,10 @@
.*.swp
.DS_Store
.sconsign.dblite
.hypothesis
*.egg-info/
*.html
uv.lock

opendbc/can/*.so
opendbc/can/*.a
Expand Down
9 changes: 3 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ repos:
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
exclude: '\.dbc$'
args:
- --check-hidden
- --builtins clear,rare,informal,usage,code,names,en-GB_to_en-US
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.11.1
hooks:
- id: mypy
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
rev: v0.5.7
hooks:
- id: ruff
- repo: https://github.com/MarcoGorelli/cython-lint
Expand Down
47 changes: 0 additions & 47 deletions Dockerfile

This file was deleted.

98 changes: 49 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
## 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](http://www.socialledge.com/sjsu/index.php?title=DBC_Format) and [Here](https://github.com/stefanhoelzl/CANpy/blob/master/docs/DBC_Specification.md) a couple of good overviews.

## How to start reverse engineering cars

[opendbc](https://github.com/commaai/opendbc) is integrated with [cabana](https://github.com/commaai/openpilot/tree/master/tools/cabana).

Use [panda](https://github.com/commaai/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](https://github.com/GENIVI/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](https://community.comma.ai/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.
# opendbc

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

## Structure
* [`opendbc/dbc/`](opendbc/dbc/) is a repository of [DBC](https://en.wikipedia.org/wiki/CAN_bus#DBC) files
* [`opendbc/can/`](opendbc/can/) is a library for parsing and building CAN messages from DBC files
* [`opendbc/car/`](opendbc/car/) is a high-level library for interfacing with cars using Python

## Quick start

```bash
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
```

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

## Roadmap

This project was pulled out from [openpilot](https://github.com/commaai/openpilot).
We're still figuring out the exact API between openpilot and opendbc, so some of these
may end up going in openpilot.

* Extend support to every car with LKAS + ACC interfaces
* Automatic lateral and longitudinal control/tuning evaluation
* Auto-tuning for [lateral](https://blog.comma.ai/090release/#torqued-an-auto-tuner-for-lateral-control) and longitudinal control
* [Automatic Emergency Braking](https://en.wikipedia.org/wiki/Automated_emergency_braking_system)
* `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: https://github.com/commaai/opendbc/issues/1144

Contributions towards anything here is welcome. Join the [Discord](https://discord.comma.ai)!
Loading

0 comments on commit 3058b7e

Please sign in to comment.