This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'opendbc/' changes from c0eba096..bdcd31df
bdcd31df reducing precision 1263500c scale is supposed to be 0-255 7c4d34a shorter scale, shift aftert scale 7971a608 maybe scale was too long be5b34b7 fingers crossed 0-1 is the desired range... 27368e96 accidental dup 79fe914e Added Pedal entries 63540dd2 add interceptor a1aa3b78 Cleanup of Nissan DBC (commaai#218) c1f76482 reverting changes to Chrysler: speed message seems different from car to car 2de8e9e8 Chrysler: Speed msg is 5 bytes f4ac315e Chrysler: add counter to 514 0fb62cf8 Toyota Blind Spot Monitor (TSS2-only?) (commaai#219) 2ae0327e GitHub actions (commaai#217) fbbba94a GM: use common gear VALs dacd8b46 Chrysler commonize gear VALs d338b9fb Add support for 2019 Civic Sedan Diesel. Split GAS_PEDAL_2 out to each car. (commaai#215) d68f8ff0 Clean up .gitignore e82757b9 Add Lexus NX300H (commaai#214) 745a2bb0 Removed non high voltage items. Added units. fafd091a Added High Voltage Management to powertrain file. 15b6b316 Update subaru_global_2017.dbc a12af19a Add steering error signal in subaru global d411c175 correct max value 881c065d add electrical gear and fix driver torque 1bbac4b8 Add reference to CANdevStudio in README file 8f70ea01 Adds 2016 Honda CR-V Executive 5081966f One more fix fa5dc680 Fix honda dbc files after steer torque addition e4dfb2fa update honda steering signals (commaai#208) 53fc4487 added generator test (commaai#207) cb27d6e3 Honda Nidec: add new ACC_HUD signals to all other cars other than the CIVIC 6e6779f9 build on mac AND linux, also gotta not use these python files 79dbfc1a build on mac 4f82d01e gitignore 5cb83454 Honda FCM: diagnostic signals d309cdce Added linter to opendbc (commaai#203) d452706f add requirements.txt ec3b4595 deterministic dependency order a265d351 Azure pipelines ci (commaai#202) bce9a2e1 packer depends on libdbc 5d5fdd6a no more python version of libdbc, everything through cython 541705bf move CANDefine to parser code da25c52a add test for can define 0ba7926b unify can packer and parser 25d88009 consistent naming a5c640a5 fix linter be210fef remove obsolete make file ffd9dca7 opendbc needs cereal b559f63d remove more make d0929496 seems to work now 41e80836 don't make 3254d1fc think scons works eb78f6aa scons sort of working 0ef1e35d fix gitignore e155e017 Can migration (commaai#199) 3eded83a Honda: correct steering torque sensor sign to be consistent with standard convention (left+) 32f70e2f Fix outback endianness consistency (commaai#196) a7da471f Update subaru_outback_2015_eyesight.dbc (commaai#195) git-subtree-dir: opendbc git-subtree-split: bdcd31dff8e38467281e1b0f865abe978b04d990
- Loading branch information
Showing
88 changed files
with
4,584 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-16.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
set -e | ||
docker build -t opendbc . | ||
name: "Build" | ||
- run: | | ||
docker run opendbc bash -c "python -m unittest discover opendbc" | ||
name: "Unit tests" | ||
- run: | | ||
docker run opendbc bash -c "cd opendbc/can/tests/linter_python; PYTHONPATH=/ ./flake8_opendbc.sh" | ||
docker run opendbc bash -c "cd opendbc/can/tests/linter_python; PYTHONPATH=/ ./pylint_opendbc.sh" | ||
name: "Python linter" | ||
- run: | | ||
docker run opendbc bash -c "cd opendbc/can/tests/; PYTHONPATH=/ ./test_generator.sh" | ||
name: "Generator test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
*.pyc | ||
*.os | ||
*.tmp | ||
*.dylib | ||
.*.swp | ||
.DS_Store | ||
|
||
can/*.so | ||
can/build/ | ||
can/obj/ | ||
can/packer_pyx.cpp | ||
can/parser_pyx.cpp | ||
can/packer_impl.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from ubuntu:16.04 | ||
|
||
RUN apt-get update && apt-get install -y libzmq3-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl | ||
|
||
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | ||
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}" | ||
RUN pyenv install 3.7.3 | ||
RUN pyenv global 3.7.3 | ||
RUN pyenv rehash | ||
|
||
COPY requirements.txt /tmp/ | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
ENV PYTHONPATH=/project | ||
|
||
# TODO: Add tag to cereal | ||
RUN git clone https://github.com/commaai/cereal.git /project/cereal | ||
RUN /project/cereal/install_capnp.sh | ||
|
||
WORKDIR /project | ||
|
||
COPY SConstruct . | ||
COPY . /project/opendbc | ||
|
||
RUN scons -c && scons -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import os | ||
import subprocess | ||
|
||
zmq = 'zmq' | ||
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() | ||
|
||
cereal_dir = Dir('.') | ||
|
||
cpppath = [ | ||
'#', | ||
'#cereal', | ||
"#cereal/messaging", | ||
"#opendbc/can", | ||
'/usr/lib/include', | ||
] | ||
|
||
AddOption('--test', | ||
action='store_true', | ||
help='build test files') | ||
|
||
AddOption('--asan', | ||
action='store_true', | ||
help='turn on ASAN') | ||
|
||
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else [] | ||
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else [] | ||
|
||
env = Environment( | ||
ENV=os.environ, | ||
CC='clang', | ||
CXX='clang++', | ||
CCFLAGS=[ | ||
"-g", | ||
"-fPIC", | ||
"-O2", | ||
"-Werror=implicit-function-declaration", | ||
"-Werror=incompatible-pointer-types", | ||
"-Werror=int-conversion", | ||
"-Werror=return-type", | ||
"-Werror=format-extra-args", | ||
] + ccflags_asan, | ||
LDFLAGS=ldflags_asan, | ||
LINKFLAGS=ldflags_asan, | ||
|
||
CFLAGS="-std=gnu11", | ||
CXXFLAGS="-std=c++14", | ||
CPPPATH=cpppath, | ||
) | ||
|
||
Export('env', 'zmq', 'arch') | ||
|
||
cereal = [File('#cereal/libcereal.a')] | ||
messaging = [File('#cereal/libmessaging.a')] | ||
Export('cereal', 'messaging') | ||
|
||
SConscript(['cereal/SConscript']) | ||
SConscript(['opendbc/can/SConscript']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Import('env', 'cereal') | ||
|
||
import os | ||
from opendbc.can.process_dbc import process | ||
|
||
dbcs = [] | ||
for x in sorted(os.listdir('../')): | ||
if x.endswith(".dbc"): | ||
def compile_dbc(target, source, env): | ||
process(source[0].path, target[0].path) | ||
in_fn = [os.path.join('../', x), 'dbc_template.cc'] | ||
out_fn = os.path.join('dbc_out', x.replace(".dbc", ".cc")) | ||
dbc = env.Command(out_fn, in_fn, compile_dbc) | ||
dbcs.append(dbc) | ||
|
||
|
||
libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"]) | ||
|
||
# packer | ||
env.Command(['packer_pyx.so'], | ||
[libdbc, 'packer_pyx.pyx', 'packer_pyx_setup.py'], | ||
"cd opendbc/can && python3 packer_pyx_setup.py build_ext --inplace") | ||
|
||
# parser | ||
env.Command(['parser_pyx.so'], | ||
[libdbc, cereal, 'parser_pyx_setup.py', 'parser_pyx.pyx', 'common.pxd'], | ||
"cd opendbc/can && python3 parser_pyx_setup.py build_ext --inplace") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from opendbc.can.parser_pyx import CANDefine # pylint: disable=no-name-in-module, import-error | ||
assert CANDefine |
Oops, something went wrong.