Skip to content

Commit

Permalink
Squashed 'opendbc/' changes from f1e69a6cf..0430bfa5c
Browse files Browse the repository at this point in the history
0430bfa5c run pre commit in ci (#268)
2ade6eeba Subaru DBC update (#242)
d1185a53e Toyota ACC_CONTROL PERMIT_BRAKING and ACCEL_CMT_ALT speculated definition (#258)
e6766bbbb Update SCC ECU Messages for OP Long Dev. (#267)
b49b9ee75 Add DAW (#175)
3b5cccba0 Fixed up cell voltage readings and added more commands (#220)
8b0449327 Mazda: add missing static bits, tidy up endianness  (#263)
124719992 Add BSD_RCTA to Subaru Global (#244)
af1821f84 fix endianness in signal from new hyundai message
7ef41084b Add gas/brake message for hyundai EVs, from @TK211X
472aabb4f Subaru preglobal update (#260)
45c0d9ecc fix lta message (#262)
11343c108 Library cleanup (#261)
67d70cb86 Fix Toyota message size

git-subtree-dir: opendbc
git-subtree-split: 0430bfa5c2b08f9cc6ab32470fe8ac9465e7a876
  • Loading branch information
Vehicle Researcher committed May 29, 2020
1 parent e0ab166 commit 76df409
Show file tree
Hide file tree
Showing 34 changed files with 921 additions and 832 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
set -e
docker build -t opendbc .
name: "Build"
- name: Static analysis
run: |
docker run opendbc bash -c "cd opendbc && git init && git add -A && pre-commit run --all"
- run: |
docker run opendbc bash -c "python -m unittest discover opendbc"
name: "Unit tests"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.mypy_cache/
*.pyc
*.os
*.tmp
Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
hooks:
- id: check-ast
- id: check-json
- id: check-xml
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-mypy
rev: master
hooks:
- id: mypy
- repo: https://github.com/PyCQA/flake8
rev: master
hooks:
- id: flake8
args:
- --select=F
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
- --disable=R,C,W
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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 apt-get update && apt-get install -y libzmq3-dev capnproto libcapnp-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}"
Expand All @@ -10,16 +10,16 @@ RUN pyenv rehash

COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt
RUN pip install pre-commit==2.4.0 pylint==2.5.2

ENV PYTHONPATH=/project

WORKDIR /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 rm -rf /project/opendbc/.git
RUN scons -c && scons -j$(nproc)
4 changes: 2 additions & 2 deletions can/packer_pyx_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_ext_filename(self, ext_name):


sourcefiles = ['packer_pyx.pyx']
extra_compile_args = ["-std=c++11"]
extra_compile_args = ["-std=c++14"]
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg

if ARCH == "aarch64":
Expand All @@ -54,7 +54,7 @@ def get_ext_filename(self, ext_name):
extra_compile_args=extra_compile_args,
include_dirs=[
BASEDIR,
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
os.path.join(BASEDIR, 'phonelibs'),
],
extra_link_args=[
os.path.join(BASEDIR, 'opendbc', 'can', libdbc),
Expand Down
4 changes: 2 additions & 2 deletions can/parser_pyx_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_ext_filename(self, ext_name):


sourcefiles = ['parser_pyx.pyx']
extra_compile_args = ["-std=c++11"]
extra_compile_args = ["-std=c++14"]
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg

if ARCH == "aarch64":
Expand All @@ -54,7 +54,7 @@ def get_ext_filename(self, ext_name):
extra_compile_args=extra_compile_args,
include_dirs=[
BASEDIR,
os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
os.path.join(BASEDIR, 'phonelibs'),
],
extra_link_args=[
os.path.join(BASEDIR, 'opendbc', 'can', libdbc),
Expand Down
2 changes: 1 addition & 1 deletion can/process_dbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def process(in_fn, out_fn):
checksum_start_bit = 0
counter_start_bit = 0
little_endian = True
elif can_dbc.name.startswith(("subaru_")):
elif can_dbc.name.startswith(("subaru_global_")):
checksum_type = "subaru"
checksum_size = 8
counter_size = None
Expand Down
11 changes: 7 additions & 4 deletions generator/toyota/_toyota_2017.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ BO_ 180 SPEED: 8 XXX
SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX

BO_ 353 DSU_SPEED: 8 XXX
BO_ 353 DSU_SPEED: 7 XXX
SG_ FORWARD_SPEED : 15|16@0- (0.00390625,-30) [0|255] "kph" XXX

BO_ 452 ENGINE_RPM: 8 CGW
SG_ RPM : 7|16@0- (0.78125,0) [0|0] "rpm" SCS

BO_ 466 PCM_CRUISE: 8 XXX
SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX
SG_ CRUISE_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX
Expand Down Expand Up @@ -128,10 +128,11 @@ BO_ 835 ACC_CONTROL: 8 DSU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
SG_ SET_ME_1 : 30|1@0+ (1,0) [0|1] "" HCU
SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU
SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU
SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX

BO_ 836 PRE_COLLISION_2: 8 DSU
SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX
Expand Down Expand Up @@ -285,6 +286,8 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was "SET_ME_1" and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
Expand Down
4 changes: 3 additions & 1 deletion generator/toyota/toyota_nodsu_pt.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ CM_ "IMPORT _comma.dbc"
CM_ "IMPORT _toyota_nodsu_bsm.dbc"

BO_ 401 STEERING_LTA: 8 XXX
SG_ COUNTER : 7|8@0+ (1,0) [0|255] "" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
SG_ SETME_X3 : 29|2@0+ (1,0) [0|3] "" XXX
SG_ PERCENTAGE : 39|8@0+ (1,0) [0|255] "" XXX
Expand All @@ -12,6 +11,9 @@ BO_ 401 STEERING_LTA: 8 XXX
SG_ STEER_ANGLE_CMD : 15|16@0- (0.0573,0) [-540|540] "" XXX
SG_ STEER_REQUEST : 25|1@0+ (1,0) [0|1] "" XXX
SG_ BIT : 30|1@0+ (1,0) [0|1] "" XXX
SG_ COUNTER : 6|6@0+ (1,0) [0|255] "" XXX
SG_ STEER_REQUEST_2 : 0|1@0+ (1,0) [0|1] "" XXX
SG_ SETME_X1 : 7|1@0+ (1,0) [0|1] "" XXX

BO_ 550 BRAKE_MODULE: 8 XXX
SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX
Expand Down
Loading

0 comments on commit 76df409

Please sign in to comment.