这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
9c3cb8c
Update values.py
mvl-boston Feb 19, 2025
1130f0e
bosch imperial BP
mvl-boston Feb 19, 2025
2c31184
update speed BP
mvl-boston Feb 19, 2025
c10875d
Separated RDX 2022
mvl-boston Feb 19, 2025
94d5b06
added 2022 RDX
mvl-boston Feb 19, 2025
668e882
RDX_2022
mvl-boston Feb 19, 2025
6767fea
RDX_2022
mvl-boston Feb 19, 2025
f92d1d8
2022 RDX
mvl-boston Feb 19, 2025
ea62b28
RDX_2022
mvl-boston Feb 19, 2025
d814c71
RDX_2022
mvl-boston Feb 19, 2025
121dc01
updating 2022 RDX
mvl-boston Feb 19, 2025
72a923b
RDX_2022
mvl-boston Feb 19, 2025
189e1fd
RDX_2022
mvl-boston Feb 19, 2025
3e5091d
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
a4f0fc5
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
67536c6
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
f2305ef
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
c3649d1
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
ea4df30
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
151ca41
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
cbc1e03
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
e2a41e8
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
83f8210
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
533ce58
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
7cad756
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
3c45073
Odyssey_5G_MMR
mvl-boston Mar 5, 2025
af36168
Odyssey_5G_MMR
mvl-boston Mar 6, 2025
daf1be0
Odyssey_5G_MMR
mvl-boston Mar 6, 2025
050292d
Odyssey_5G_MMR
mvl-boston Mar 6, 2025
08976cb
Odyssey_5G_MMR
mvl-boston Mar 6, 2025
41f033b
Odyssey_5G_MMR
mvl-boston Mar 6, 2025
2ef9394
Odyssey_5G_MMR
mvl-boston Mar 6, 2025
ad01f5c
Merge branch 'commaai:master' into Odyssey_21_25
mvl-boston Mar 7, 2025
8f4fd44
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
cf28649
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
9ac5b58
Merge branch 'master' into Odyssey_21_25
mvl-boston Mar 7, 2025
59fb36e
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
a1c8fbf
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
a1832e1
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
4c52c91
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
aec73d8
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
d5b4cd0
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
a6bafc4
Merge branch 'commaai:master' into Odyssey_21_25
mvl-boston Mar 7, 2025
04d649e
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
9a8c3fe
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
ef9a4fb
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
67c5f66
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
90edcc1
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
7b878c2
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
a0249c1
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
90d6729
Odyssey_5G_MMR
mvl-boston Mar 7, 2025
14a60b2
RDX_2022
mvl-boston Mar 7, 2025
61986d9
RDX_2022
mvl-boston Mar 7, 2025
cd099ed
RDX_2022
mvl-boston Mar 7, 2025
42c1348
RDX_2022
mvl-boston Mar 7, 2025
e899944
RDX_2022
mvl-boston Mar 7, 2025
bf873fe
Merge branch 'commaai:master' into RDX_2022
mvl-boston Mar 7, 2025
dee515e
RDX_2022
mvl-boston Mar 7, 2025
5abf732
RDX_2022
mvl-boston Mar 7, 2025
787c4ff
RDX_2022
mvl-boston Mar 7, 2025
a89300b
RDX_2022
mvl-boston Mar 7, 2025
35dec5e
long startup issue
mvl-boston Mar 8, 2025
cd4b697
test long fix
mvl-boston Mar 8, 2025
e4be471
RDX_2022
mvl-boston Mar 8, 2025
ac5551f
RDX_2022
mvl-boston Mar 8, 2025
89f75d8
Merge branch 'commaai:master' into RDX_2022
mvl-boston Mar 10, 2025
0a01823
RDX_2022
mvl-boston Mar 10, 2025
0047e87
Revert to master openpilot
mvl-boston Mar 10, 2025
7ef5c04
Merge branch 'RDX_2022' of https://github.com/mvl-boston/opendbc into…
mvl-boston Mar 10, 2025
1c72a5b
Revert "Merge branch 'RDX_2022' of https://github.com/mvl-boston/open…
mvl-boston Mar 10, 2025
1183bef
Revert "Revert to master openpilot"
mvl-boston Mar 10, 2025
9882178
Revert "RDX_2022"
mvl-boston Mar 10, 2025
235442a
RDX_2022
mvl-boston Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ car:
- changed-files:
- any-glob-to-any-file: 'opendbc/car/**'

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

can:
- changed-files:
- any-glob-to-any-file: 'opendbc/can/**'
Expand Down
60 changes: 0 additions & 60 deletions .github/workflows/test_models_trigger.yaml

This file was deleted.

87 changes: 1 addition & 86 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,93 +13,8 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- os: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- os: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-macos-8x14' || 'macos-latest' }}
os: [ubuntu-24.04, macos-latest]
steps:
- uses: commaai/timeout@v1
- uses: actions/checkout@v4
- run: ./test.sh

safety_tests:
name: safety
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
flags: ['', '--ubsan']
steps:
- uses: commaai/timeout@v1
- uses: actions/checkout@v4
- name: Run safety tests
run: ./opendbc/safety/tests/test.sh ${{ matrix.flags }}

misra_linter:
name: MISRA C:2012 Linter
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
timeout-minutes: 20
steps:
- name: Set up
run: sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
- uses: actions/checkout@v4
- name: Restore cached cppcheck
uses: actions/cache@v4
with:
path: opendbc/safety/tests/misra/cppcheck/
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}
restore-keys: |
cppcheck-cache-${{ runner.os }}-${{ github.ref }}
cppcheck-cache-${{ runner.os }}-
- name: Run MISRA C:2012 analysis
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 1 || 2) }}
run: cd opendbc/safety/tests/misra && ./test_misra.sh
- name: Save cppcheck cache
uses: actions/cache@v4
with:
path: opendbc/safety/tests/misra/cppcheck/
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}

misra_mutation:
name: MISRA C:2012 Mutation
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
timeout-minutes: 20
steps:
- name: Set up
run: sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi libnewlib-arm-none-eabi
- uses: actions/checkout@v4
- name: Restore cached cppcheck
uses: actions/cache@v4
with:
path: opendbc/safety/tests/misra/cppcheck/
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}
restore-keys: |
cppcheck-cache-${{ runner.os }}-${{ github.ref }}
cppcheck-cache-${{ runner.os }}-
- name: MISRA mutation tests
timeout-minutes: 1
run: |
source setup.sh
scons -j8
cd opendbc/safety/tests/misra
./install.sh # cppcheck
pytest -s -n8 --randomly-seed $RANDOM test_mutation.py
- name: Save cppcheck cache
uses: actions/cache@v4
with:
path: opendbc/safety/tests/misra/cppcheck/
key: cppcheck-cache-${{ runner.os }}-${{ github.ref }}

mutation:
name: Safety mutation tests
runs-on: ${{ github.repository == 'commaai/opendbc' && 'namespace-profile-amd64-8x16' || 'ubuntu-latest' }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # need master to get diff
- name: Run mutation tests
timeout-minutes: 5
run: |
source setup.sh
scons -j8
GIT_REF=${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.event.before || 'origin/master' }} cd opendbc/safety/tests && ./mutation.sh
12 changes: 3 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
*.pyc
*.os
*.o
*.so
*.a
*.tmp
*.dylib
.*.swp
Expand All @@ -13,18 +11,14 @@
.hypothesis
*.egg-info/
*.html
*.gcda
*.gcno

uv.lock

opendbc/can/*.so
opendbc/can/*.a
opendbc/can/build/
opendbc/can/obj/
opendbc/can/packer_pyx.cpp
opendbc/can/parser_pyx.cpp
opendbc/can/packer_pyx.html
opendbc/can/parser_pyx.html
opendbc/dbc/*_generated.dbc

cppcheck-addon-ctu-file-list
opendbc/safety/tests/coverage-out
opendbc/dbc/*_generated.dbc
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ repos:
- --counting=detailed
- --linelength=240
- --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces
- repo: local
hooks:
- id: generator
name: dbc generator
entry: opendbc/dbc/generator/test_generator.py
language: script
pass_filenames: false
36 changes: 6 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ pre-commit run --all-files # run the linter
* [`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
* [`opendbc/safety/`](opendbc/safety/) is the functional safety for all the cars supported by `opendbc/car/`

## How to Port a Car

Expand All @@ -70,7 +69,7 @@ At its most basic, a car port will control the steering on a car. A "complete" c
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 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
Expand All @@ -79,11 +78,11 @@ Depending on , most of this basic structure will already be in place.

The entirery of a car port lives in `opendbc/car/<brand>/`:
* `carstate.py`: parses out the relevant information from the CAN stream using the car's DBC file
* `carcontroller.py`: outputs CAN messages to control the car
* `carcontroller.py`: outputs CAN messages to control the car
* `<brand>can.py`: thin Python helpers around the DBC file to build CAN messages
* `fingerprints.py`: database of ECU firmware versions for identifying car models
* `interface.py`: high level class for interfacing with the car
* `radar_interface.py`: parses out the radar
* `radar_interface.py`: parses out the radar
* `values.py`: enumerates the brand's supported cars

### Reverse Engineer CAN messages
Expand All @@ -98,7 +97,7 @@ Use the [longitudinal maneuvers](https://github.com/commaai/openpilot/tree/maste

## Contributing

All opendbc development is coordinated on GitHub and [Discord](https://discord.comma.ai). Check out the `#dev-opendbc-cars` channel and `Vehicle Specific` section.
All opendbc development is coordinated on GitHub and [Discord](https://discord.comma.ai). Check out the `#dev-opendbc-cars` channel and `Vehicle Specific` section.

### Roadmap

Expand All @@ -117,29 +116,6 @@ Longer term

Contributions towards anything here are welcome.

## Safety Model

When a [panda](https://comma.ai/shop/panda) powers up with [opendbc safety firmware](opendbc/safety), by default it's in `SAFETY_SILENT` mode. While in `SAFETY_SILENT` mode, the CAN buses are forced to be silent. In order to send messages, you have to select a safety mode. Some of safety modes (for example `SAFETY_ALLOUTPUT`) are disabled in release firmwares. In order to use them, compile and flash your own build.

Safety modes optionally support `controls_allowed`, which allows or blocks a subset of messages based on a customizable state in the board.

## Code Rigor

The opendbc safety firmware is written for its use in conjunction with [openpilot](https://github.com/commaai/openpilot) and [panda](https://github.com/commaai/panda). The safety firmware, through its safety model, provides and enforces the
[openpilot safety](https://github.com/commaai/openpilot/blob/master/docs/SAFETY.md). Due to its critical function, it's important that the application code rigor within the `safety` folder is held to high standards.

These are the [CI regression tests](https://github.com/commaai/opendbc/actions) we have in place:
* A generic static code analysis is performed by [cppcheck](https://github.com/danmar/cppcheck/).
* In addition, [cppcheck](https://github.com/danmar/cppcheck/) has a specific addon to check for [MISRA C:2012](https://misra.org.uk/) violations. See [current coverage](opendbc/safety/tests/misra/coverage_table).
* Compiler options are relatively strict: the flags `-Wall -Wextra -Wstrict-prototypes -Werror` are enforced.
* The [safety logic](opendbc/safety) is tested and verified by [unit tests](opendbc/safety/tests) for each supported car variant.

The above tests are themselves tested by:
* a [mutation test](opendbc/safety/tests/misra/test_mutation.py) on the MISRA coverage
* 100% line coverage enforced on the safety unit tests

In addition, we run the [ruff linter](https://github.com/astral-sh/ruff) and [mypy](https://mypy-lang.org/) on the car interface library.

### Bounties

Every car port is eligible for a bounty:
Expand All @@ -161,7 +137,7 @@ In addition to the standard bounties, we also offer higher value bounties for mo

***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](https://www.youtube.com/watch?v=FL8CxUSfipM) 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.
***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

Expand All @@ -187,7 +163,7 @@ In addition to the standard bounties, we also offer higher value bounties for mo
* [*How to Port a Car*](https://www.youtube.com/watch?v=XxPS5TpTUnI&t=142s&pp=ygUPamFzb24gY29tbWEgY29u) by [@jyoung8607](https://github.com/jyoung8607) from COMMA_CON 2023
* [commaCarSegments](https://huggingface.co/datasets/commaai/commaCarSegments): a massive dataset of CAN data from 300 different car models
* [cabana](https://github.com/commaai/openpilot/tree/master/tools/cabana#readme): our tool for reverse engineering CAN messages
* [can_print_changes.py](https://github.com/commaai/openpilot/blob/master/selfdrive/debug/can_print_changes.py): diff the whole CAN bus across two drives, such as one without any LKAS and one with LKAS
* [can_print_changes.py](https://github.com/commaai/openpilot/blob/master/selfdrive/debug/can_print_changes.py): diff the whole CAN bus across two drives, such as one without any LKAS and one with LKAS
* [longitudinal maneuvers](https://github.com/commaai/openpilot/tree/master/tools/longitudinal_maneuvers): a tool for evaluating and tuning longitudinal control
* [opendbc data](https://commaai.github.io/opendbc-data/): a repository of longitudinal maneuver evaluations

Expand Down
4 changes: 0 additions & 4 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ Import("env")

SConscript(['opendbc/can/SConscript'], exports={'env': env})
SConscript(['opendbc/dbc/SConscript'], exports={'env': env})

# test files
if GetOption('extras'):
SConscript('opendbc/safety/tests/libsafety/SConscript')
13 changes: 0 additions & 13 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ AddOption('--asan',
action='store_true',
help='turn on ASAN')

# safety options
AddOption('--ubsan',
action='store_true',
help='turn on UBSan')

AddOption('--coverage',
action='store_true',
help='build with test coverage options')

AddOption('--mutation',
action='store_true',
help='generate mutation-ready code')

ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []

Expand Down
4 changes: 0 additions & 4 deletions conftest.py

This file was deleted.

Loading
Loading