diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5ab3dac992..d3c95f5cd4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,7 +3,7 @@ name: tests on: [push, pull_request] env: - RUN: docker run -v $GITHUB_WORKSPACE:/project/opendbc -w /project/opendbc -e PYTHONWARNINGS=error --shm-size 1G --rm opendbc /bin/bash -c + RUN: docker run -v $GITHUB_WORKSPACE:/project/opendbc -w /project/opendbc -e PYTHONWARNINGS="error,default::DeprecationWarning" --shm-size 1G --rm opendbc /bin/bash -c BUILD: | docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile) || true docker pull ghcr.io/commaai/opendbc:latest || true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ed88fed43..0a6c034e10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: check-merge-conflict - id: check-symlinks - repo: https://github.com/codespell-project/codespell - rev: v2.2.4 + rev: v2.2.5 hooks: - id: codespell exclude: '\.dbc$' @@ -15,7 +15,7 @@ repos: - --check-hidden - --builtins clear,rare,informal,usage,code,names,en-GB_to_en-US - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.4.1 hooks: - id: mypy - repo: https://github.com/PyCQA/flake8 diff --git a/Dockerfile b/Dockerfile index c406413aee..69c851c49c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,13 +34,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ 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.8.10 -RUN pyenv global 3.8.10 +RUN pyenv install 3.11.4 +RUN pyenv global 3.11.4 RUN pyenv rehash COPY requirements.txt /tmp/ RUN pip install --no-cache-dir -r /tmp/requirements.txt -RUN pip install --no-cache-dir pre-commit==2.15.0 pylint==2.5.2 +RUN pip install --no-cache-dir pre-commit==2.15.0 pylint==2.17.4 ENV PYTHONPATH=/project diff --git a/can/packer.cc b/can/packer.cc index 6cee2eb1b5..ad762828bc 100644 --- a/can/packer.cc +++ b/can/packer.cc @@ -1,8 +1,9 @@ -#include -#include #include -#include +#include #include +#include +#include +#include #include "opendbc/can/common.h" diff --git a/can/packer_pyx.pyx b/can/packer_pyx.pyx index b0179d7f90..3304339086 100644 --- a/can/packer_pyx.pyx +++ b/can/packer_pyx.pyx @@ -14,8 +14,7 @@ cdef class CANPacker: cdef: cpp_CANPacker *packer const DBC *dbc - map[string, (int, int)] name_to_address_and_size - map[int, int] address_to_size + map[string, int] name_to_address def __init__(self, dbc_name): self.dbc = dbc_lookup(dbc_name) @@ -25,8 +24,7 @@ cdef class CANPacker: self.packer = new cpp_CANPacker(dbc_name) for i in range(self.dbc[0].msgs.size()): msg = self.dbc[0].msgs[i] - self.name_to_address_and_size[string(msg.name)] = (msg.address, msg.size) - self.address_to_size[msg.address] = msg.size + self.name_to_address[string(msg.name)] = msg.address cdef vector[uint8_t] pack(self, addr, values): cdef vector[SignalPackValue] values_thing @@ -41,12 +39,11 @@ cdef class CANPacker: return self.packer.pack(addr, values_thing) cpdef make_can_msg(self, name_or_addr, bus, values): - cdef int addr, size + cdef int addr if type(name_or_addr) == int: addr = name_or_addr - size = self.address_to_size[name_or_addr] else: - addr, size = self.name_to_address_and_size[name_or_addr.encode("utf8")] + addr = self.name_to_address[name_or_addr.encode("utf8")] cdef vector[uint8_t] val = self.pack(addr, values) - return [addr, 0, (&val[0])[:size], bus] + return [addr, 0, (&val[0])[:val.size()], bus] diff --git a/can/parser_pyx.pyx b/can/parser_pyx.pyx index 1a387cfee5..f9cf87e04c 100644 --- a/can/parser_pyx.pyx +++ b/can/parser_pyx.pyx @@ -41,12 +41,17 @@ cdef class CANParser: self.vl_all = {} self.ts_nanos = {} msg_name_to_address = {} + msg_address_to_signals = {} for i in range(self.dbc[0].msgs.size()): msg = self.dbc[0].msgs[i] name = msg.name.decode("utf8") msg_name_to_address[name] = msg.address + msg_address_to_signals[msg.address] = set() + for sig in msg.sigs: + msg_address_to_signals[msg.address].add(sig.name.decode("utf8")) + self.address_to_msg_name[msg.address] = name self.vl[msg.address] = {} self.vl[name] = self.vl[msg.address] @@ -58,12 +63,13 @@ cdef class CANParser: # Convert message names into addresses for i in range(len(signals)): s = signals[i] - if not isinstance(s[1], numbers.Number): - if s[1] not in msg_name_to_address: - print(msg_name_to_address) - raise RuntimeError(f"could not find message {repr(s[1])} in DBC {self.dbc_name}") - s = (s[0], msg_name_to_address[s[1]]) - signals[i] = s + address = s[1] if isinstance(s[1], numbers.Number) else msg_name_to_address.get(s[1]) + if address not in msg_address_to_signals: + raise RuntimeError(f"could not find message {repr(s[1])} in DBC {self.dbc_name}") + if s[0] not in msg_address_to_signals[address]: + raise RuntimeError(f"could not find signal {repr(s[0])} in {repr(s[1])}, DBC {self.dbc_name}") + + signals[i] = (s[0], address) for i in range(len(checks)): c = checks[i] diff --git a/can/tests/__init__.py b/can/tests/__init__.py index e69de29bb2..3bf02fdae0 100644 --- a/can/tests/__init__.py +++ b/can/tests/__init__.py @@ -0,0 +1,8 @@ +import glob +import os + +from opendbc import DBC_PATH + +ALL_DBCS = [os.path.basename(dbc).split('.')[0] for dbc in + glob.glob(f"{DBC_PATH}/*.dbc")] +TEST_DBC = os.path.abspath(os.path.join(os.path.dirname(__file__), "test.dbc")) diff --git a/can/tests/test.dbc b/can/tests/test.dbc index 0134c7a4c0..05104fb068 100644 --- a/can/tests/test.dbc +++ b/can/tests/test.dbc @@ -23,3 +23,5 @@ BO_ 245 CAN_FD_MESSAGE: 32 XXX SG_ SIGNED : 22|16@0- (1,0) [0|1] "" XXX SG_ 64_BIT_LE : 159|64@1+ (1,0) [0|1] "" XXX SG_ 64_BIT_BE : 80|64@0+ (1,0) [0|1] "" XXX + +VAL_ 80 NON_EXISTENT_ADDR 0 "test"; diff --git a/can/tests/test_dbc_exceptions.py b/can/tests/test_dbc_exceptions.py index b594893ea5..02956eca8c 100755 --- a/can/tests/test_dbc_exceptions.py +++ b/can/tests/test_dbc_exceptions.py @@ -4,6 +4,8 @@ from opendbc.can.parser import CANParser, CANDefine from opendbc.can.packer import CANPacker +from opendbc.can.tests import TEST_DBC + class TestCanParserPackerExceptions(unittest.TestCase): def test_civic_exceptions(self): @@ -20,6 +22,8 @@ def test_civic_exceptions(self): CANPacker(dbc_invalid) with self.assertRaises(RuntimeError): CANDefine(dbc_invalid) + with self.assertRaises(KeyError): + CANDefine(TEST_DBC) with self.assertRaises(RuntimeError): CANParser(dbc_file, signals, [], 0) diff --git a/can/tests/test_dbc_parser.py b/can/tests/test_dbc_parser.py index b28392606d..72cacd7f16 100755 --- a/can/tests/test_dbc_parser.py +++ b/can/tests/test_dbc_parser.py @@ -1,19 +1,11 @@ #!/usr/bin/env python3 -import glob -import os import unittest -from opendbc import DBC_PATH from opendbc.can.parser import CANParser +from opendbc.can.tests import ALL_DBCS class TestDBCParser(unittest.TestCase): - @classmethod - def setUpClass(cls): - cls.dbcs = [] - for dbc in glob.glob(f"{DBC_PATH}/*.dbc"): - cls.dbcs.append(os.path.basename(dbc).split('.')[0]) - def test_parse_all_dbcs(self): """ Dynamic DBC parser checks: @@ -23,7 +15,7 @@ def test_parse_all_dbcs(self): - All BO_, SG_, VAL_ lines for syntax errors """ - for dbc in self.dbcs: + for dbc in ALL_DBCS: with self.subTest(dbc=dbc): CANParser(dbc, [], [], 0) diff --git a/can/tests/test_define.py b/can/tests/test_define.py index d9a6f7d671..ed35e87f9f 100755 --- a/can/tests/test_define.py +++ b/can/tests/test_define.py @@ -2,6 +2,7 @@ import unittest from opendbc.can.can_define import CANDefine +from opendbc.can.tests import ALL_DBCS class TestCADNDefine(unittest.TestCase): @@ -22,6 +23,12 @@ def test_civic(self): } ) + def test_all_dbcs(self): + # Asserts no exceptions on all DBCs + for dbc in ALL_DBCS: + with self.subTest(dbc=dbc): + CANDefine(dbc) + if __name__ == "__main__": unittest.main() diff --git a/can/tests/test_packer_parser.py b/can/tests/test_packer_parser.py index e504c90b94..1b7399c40f 100755 --- a/can/tests/test_packer_parser.py +++ b/can/tests/test_packer_parser.py @@ -1,14 +1,11 @@ #!/usr/bin/env python3 -import os import unittest import random import cereal.messaging as messaging from opendbc.can.parser import CANParser from opendbc.can.packer import CANPacker - - -TEST_DBC = os.path.abspath(os.path.join(os.path.dirname(__file__), "test.dbc")) +from opendbc.can.tests import TEST_DBC # Python implementation so we don't have to depend on boardd @@ -317,6 +314,24 @@ def test_timestamp_nanos(self): ts_nanos = parser.ts_nanos["POWERTRAIN_DATA"].values() self.assertEqual(set(ts_nanos), {0}) + def test_undefined_signals(self): + # Ensure we don't allow messages or signals not in the DBC + existing_signals = { + "STEERING_CONTROL": ["STEER_TORQUE_REQUEST", "SET_ME_X00_2", "COUNTER"], + 228: ["STEER_TORQUE_REQUEST", "SET_ME_X00_2", "COUNTER"], + "CAN_FD_MESSAGE": ["SIGNED", "64_BIT_LE", "64_BIT_BE", "COUNTER"], + 245: ["SIGNED", "64_BIT_LE", "64_BIT_BE", "COUNTER"], + } + + for msg, sigs in existing_signals.items(): + for sig in sigs: + CANParser(TEST_DBC, [(sig, msg)], [(msg, 0)]) + new_msg = msg + "1" if isinstance(msg, str) else msg + 1 + self.assertRaises(RuntimeError, CANParser, TEST_DBC, [(sig + "1", msg)], [(msg, 0)]) + self.assertRaises(RuntimeError, CANParser, TEST_DBC, [(sig, new_msg)], [(msg, 0)]) + self.assertRaises(RuntimeError, CANParser, TEST_DBC, [(sig, msg)], [(new_msg, 0)]) + self.assertRaises(RuntimeError, CANParser, TEST_DBC, [(sig, new_msg)], [(new_msg, 0)]) + if __name__ == "__main__": unittest.main() diff --git a/can/tests/test_parser.py b/can/tests/test_parser_performance.py similarity index 100% rename from can/tests/test_parser.py rename to can/tests/test_parser_performance.py diff --git a/generator/chrysler/_stellantis_common_ram.py b/generator/chrysler/_stellantis_common_ram.py index b117db0dda..5072985ebc 100755 --- a/generator/chrysler/_stellantis_common_ram.py +++ b/generator/chrysler/_stellantis_common_ram.py @@ -32,7 +32,7 @@ chrysler_path = os.path.dirname(os.path.realpath(__file__)) for out, addr_lookup in chrysler_to_ram.items(): - with open(os.path.join(chrysler_path, src)) as in_f, open(os.path.join(chrysler_path, out), 'w') as out_f: + with open(os.path.join(chrysler_path, src), encoding='utf-8') as in_f, open(os.path.join(chrysler_path, out), 'w', encoding='utf-8') as out_f: out_f.write(f'CM_ "Generated from {src}"\n\n') wrote_addrs = set() diff --git a/generator/generator.py b/generator/generator.py index 9d5b37b5db..214c8fb1a5 100755 --- a/generator/generator.py +++ b/generator/generator.py @@ -11,7 +11,7 @@ def read_dbc(src_dir: str, filename: str) -> str: - with open(os.path.join(src_dir, filename)) as file_in: + with open(os.path.join(src_dir, filename), encoding='utf-8') as file_in: return file_in.read() @@ -23,7 +23,7 @@ def create_dbc(src_dir: str, filename: str, output_path: str): output_filename = filename.replace('.dbc', generated_suffix) output_file_location = os.path.join(output_path, output_filename) - with open(output_file_location, 'w') as dbc_file_out: + with open(output_file_location, 'w', encoding='utf-8') as dbc_file_out: dbc_file_out.write('CM_ "AUTOGENERATED FILE, DO NOT EDIT";\n') for include_filename in includes: diff --git a/generator/hyundai/hyundai_kia_mando_corner_radar.py b/generator/hyundai/hyundai_kia_mando_corner_radar.py index d4bcf67e5f..aad417e32a 100755 --- a/generator/hyundai/hyundai_kia_mando_corner_radar.py +++ b/generator/hyundai/hyundai_kia_mando_corner_radar.py @@ -5,7 +5,7 @@ if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc") hyundai_path = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(hyundai_path, dbc_name), "w") as f: + with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: f.write(""" VERSION "" diff --git a/generator/hyundai/hyundai_kia_mando_front_radar.py b/generator/hyundai/hyundai_kia_mando_front_radar.py index 8870bf0cda..ee8dde64d4 100755 --- a/generator/hyundai/hyundai_kia_mando_front_radar.py +++ b/generator/hyundai/hyundai_kia_mando_front_radar.py @@ -4,7 +4,7 @@ if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc") hyundai_path = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(hyundai_path, dbc_name), "w") as f: + with open(os.path.join(hyundai_path, dbc_name), "w", encoding='utf-8') as f: f.write(""" VERSION "" diff --git a/generator/subaru/_subaru_global.dbc b/generator/subaru/_subaru_global.dbc index 96ca9bab3a..7b56f20af4 100644 --- a/generator/subaru/_subaru_global.dbc +++ b/generator/subaru/_subaru_global.dbc @@ -83,10 +83,14 @@ BO_ 314 Wheel_Speeds: 8 XXX SG_ FL : 51|13@1+ (0.057,0) [0|255] "kph" XXX SG_ RL : 38|13@1+ (0.057,0) [0|255] "kph" XXX -BO_ 280 STOP_START: 8 XXX +BO_ 280 Steering_Torque_2: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX - SG_ State : 63|1@1+ (1,0) [0|1] "" XXX + SG_ Steer_Torque_Output : 13|11@1- (-10,0) [0|255] "" XXX + SG_ Signal1 : 24|8@1+ (1,0) [0|511] "" XXX + SG_ Steer_Torque_Sensor : 45|11@1- (-1,0) [0|255] "" XXX + SG_ Steering_Active : 61|1@0+ (1,0) [0|1] "" XXX + SG_ Steering_Disabled : 63|1@1+ (1,0) [0|1] "" XXX BO_ 281 Steering_Torque: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX @@ -98,6 +102,11 @@ BO_ 281 Steering_Torque: 8 XXX SG_ Steering_Angle : 32|16@1- (-0.0217,0) [-600|600] "" X SG_ Steer_Torque_Output : 48|11@1- (-10,0) [-1000|1000] "" XXX +BO_ 282 Steering_2: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|1] "" XXX + SG_ Steering_Angle : 24|17@1- (-0.01,0) [0|1] "" XXX + BO_ 312 Brake_Pressure_L_R: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX @@ -127,12 +136,19 @@ BO_ 290 ES_LKAS: 8 XXX SG_ LKAS_Output : 16|13@1- (-1,0) [-8191|8191] "" XXX SG_ LKAS_Request : 29|1@0+ (1,0) [0|1] "" XXX +BO_ 292 ES_LKAS_ALT: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Request : 12|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Output : 40|17@1- (-1,0) [0|1] "" XXX + SG_ SET_3 : 60|2@1+ (1,0) [0|1] "" XXX + BO_ 544 ES_Brake: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX SG_ Brake_Pressure : 16|16@1+ (1,0) [0|65535] "" XXX - SG_ Signal2 : 32|4@1+ (1,0) [0|15] "" XXX + SG_ AEB_Status : 32|4@1+ (1,0) [0|15] "" XXX SG_ Cruise_Brake_Lights : 36|1@1+ (1,0) [0|1] "" XXX SG_ Cruise_Brake_Fault : 37|1@1+ (1,0) [0|1] "" XXX SG_ Cruise_Brake_Active : 38|1@1+ (1,0) [0|1] "" XXX @@ -240,6 +256,9 @@ BO_ 1677 Dash_State: 8 XXX CM_ SG_ 64 Throttle_Combo "Throttle Cruise + Pedal"; CM_ SG_ 313 Brake_Lights "Driver or Cruise Brake on"; CM_ SG_ 544 Cruise_Brake_Lights "1 = switch on brake lights"; +CM_ SG_ 544 Brake_Pressure "Winds down after cruise disabled. Also can be non-zero when likely preparing for AEB"; +CM_ SG_ 544 Signal3 "Usually goes to 2 if AEB_Status is 4"; +CM_ SG_ 544 AEB_Status "Occasionally is 4 instead of 8 while Brake_Pressure is non-zero, unsure why"; CM_ SG_ 801 PCB_Off "Pre-Collision Braking off"; CM_ SG_ 801 Brake_Lights "Driver or Cruise brake on"; CM_ SG_ 801 Cruise_State "0 = Normal, 1 = Hold+User Brake, 2 = Ready, 3 = Hold"; @@ -256,3 +275,4 @@ CM_ SG_ 802 LKAS_Dash_State "0 = Off, 1 = Ready, 2 = Active"; CM_ SG_ 802 LKAS_Right_Line_Visible "0 = Off, 1 = White, 2 = Green, 3 = Orange"; CM_ SG_ 912 UNITS "0 = Metric, 1 = Imperial"; CM_ SG_ 912 ICY_ROAD "1 = DASHLIGHT ON, 2 = WARNING, 3 = OFF"; +VAL_ 544 AEB_Status 12 "AEB related" 8 "AEB actuation" 4 "AEB related" 0 "No AEB actuation"; diff --git a/generator/subaru/subaru_global_2017.dbc b/generator/subaru/subaru_global_2017.dbc index 0d358aea06..d03a6a3f9b 100644 --- a/generator/subaru/subaru_global_2017.dbc +++ b/generator/subaru/subaru_global_2017.dbc @@ -53,7 +53,7 @@ BO_ 576 CruiseControl: 8 XXX SG_ Cruise_Activated : 41|1@1+ (1,0) [0|1] "" XXX SG_ Signal2 : 42|22@1+ (1,0) [0|4194303] "" XXX -BO_ 803 INFOTAINMENT_STATUS: 8 XXX +BO_ 803 ES_Infotainment: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX SG_ LKAS_Blue_Lines : 15|4@0+ (1,0) [0|15] "" XXX diff --git a/generator/toyota/_toyota_2017.dbc b/generator/toyota/_toyota_2017.dbc index e6148ca6af..8b8edea7a8 100644 --- a/generator/toyota/_toyota_2017.dbc +++ b/generator/toyota/_toyota_2017.dbc @@ -38,7 +38,7 @@ BU_: XXX DSU HCU EPS IPAS CGW BGM BO_ 36 KINEMATICS: 8 XXX SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/s" XXX - SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + SG_ ACCEL_X : 17|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX BO_ 37 STEER_ANGLE_SENSOR: 8 XXX SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX @@ -241,7 +241,7 @@ BO_ 1042 LKAS_HUD: 8 DSU SG_ LDA_UNAVAILABLE : 16|1@0+ (1,0) [0|1] "" XXX SG_ LDA_SENSITIVITY : 18|2@0+ (1,0) [0|3] "" XXX SG_ LDA_SA_TOGGLE : 20|2@0+ (1,0) [0|3] "" XXX - SG_ LDA_SPEED_TOO_LOW : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MESSAGES : 23|3@0+ (1,0) [0|1] "" XXX SG_ LDA_ON_MESSAGE : 31|2@0+ (1,0) [0|3] "" XXX SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX SG_ LANE_SWAY_TOGGLE : 43|1@0+ (1,0) [0|1] "" XXX @@ -265,6 +265,11 @@ BO_ 1043 TIME : 8 CGW SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX +BO_ 1044 AUTO_HIGH_BEAM: 8 FCM + SG_ AHB_DUTY : 47|8@0+ (0.5,0) [0|0] "%" Vector__XXX + SG_ F_AHB : 55|4@0+ (1,0) [0|0] "" Vector__XXX + SG_ C_AHB : 51|4@0+ (1,0) [0|0] "" Vector__XXX + BO_ 1083 AUTOPARK_STATUS: 8 IPAS SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX @@ -423,7 +428,7 @@ CM_ SG_ 1042 LDA_SENSITIVITY "LDA Sensitivity"; CM_ SG_ 1042 LDA_ON_MESSAGE "Display LDA Turned ON message"; CM_ SG_ 1042 REPEATED_BEEPS "LDA audible warning"; CM_ SG_ 1042 LDA_UNAVAILABLE_QUIET "LDA toggles and sensitivity settings are greyed out if set to 1"; -CM_ SG_ 1042 LDA_SPEED_TOO_LOW "length is 3 bits in the leaked DBC, displays LDA unavailable below approx 50 km/h if set to 1"; +CM_ SG_ 1042 LDA_MESSAGES "Various LDA Messages"; CM_ SG_ 1042 LDA_FRONT_CAMERA_BLOCKED "originally LDAFCVB, LDA related settings are greyed out if set to 1"; CM_ SG_ 1042 TAKE_CONTROL "Please Control Steering Wheel warning"; CM_ SG_ 1042 LANE_SWAY_TOGGLE "Lane Sway Warning System SWS Switch"; @@ -487,7 +492,7 @@ VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; VAL_ 1042 LDA_ON_MESSAGE 2 "Lane Departure Alert Turned ON, Steering Assist Inactive" 1 "Lane Departure Alert Turned ON, Steering Assist Active" 0 "clear"; VAL_ 1042 LDA_SA_TOGGLE 2 "steering assist off" 1 "steering assist on"; VAL_ 1042 LDA_SENSITIVITY 2 "standard" 1 "high" 0 "undefined"; -VAL_ 1042 LDA_SPEED_TOO_LOW 1 "lda unavailable, speed too low" 0 "ok"; +VAL_ 1042 LDA_MESSAGES 4 "lda unavailable at this speed" 1 "lda unavailable below approx 50km/h" 0 "ok"; VAL_ 1042 LDA_FRONT_CAMERA_BLOCKED 1 "lda unavailable" 0 "ok"; VAL_ 1042 TAKE_CONTROL 1 "take control" 0 "ok"; VAL_ 1042 LANE_SWAY_WARNING 3 "ok" 2 "orange please take a break" 1 "prompt would you like to take a break" 0 "ok"; diff --git a/generator/toyota/toyota_nodsu_pt.dbc b/generator/toyota/toyota_nodsu_pt.dbc index fe0ab32323..909a198a31 100644 --- a/generator/toyota/toyota_nodsu_pt.dbc +++ b/generator/toyota/toyota_nodsu_pt.dbc @@ -10,7 +10,7 @@ BO_ 401 STEERING_LTA: 8 XXX SG_ STEER_ANGLE_CMD : 15|16@0- (0.0573,0) [-540|540] "" XXX SG_ STEER_REQUEST_2 : 25|1@0+ (1,0) [0|1] "" XXX SG_ LKA_ACTIVE : 26|1@0+ (1,0) [0|1] "" XXX - SG_ BIT : 30|1@0+ (1,0) [0|1] "" XXX + SG_ CLEAR_HOLD_STEERING_ALERT : 30|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 6|6@0+ (1,0) [0|255] "" XXX SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX SG_ SETME_X1 : 7|1@0+ (1,0) [0|1] "" XXX @@ -27,6 +27,16 @@ BO_ 610 EPS_STATUS: 8 EPS SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX +BO_ 881 LTA_RELATED: 8 FCM + SG_ GAS_PEDAL : 15|8@0+ (0.005,0) [0|1] "" XXX + SG_ STEER_ANGLE : 23|16@0- (0.0573,0) [-500|500] "" XXX + SG_ TURN_SIGNALS : 35|2@0+ (1,0) [0|3] "" XXX + SG_ UNKNOWN_2 : 58|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_SA_TOGGLE : 59|1@0+ (1,0) [0|1] "" XXX + SG_ LTA_STEER_REQUEST : 60|1@0+ (1,0) [0|1] "" XXX + SG_ UNKNOWN : 61|1@0+ (1,0) [0|1] "" XXX + SG_ STEERING_PRESSED : 63|1@0+ (1,0) [0|1] "" XXX + BO_ 1014 BSM: 8 XXX SG_ L_ADJACENT : 0|1@0+ (1,0) [0|1] "" XXX SG_ L_APPROACHING : 8|1@0+ (1,0) [0|1] "" XXX @@ -39,13 +49,22 @@ CM_ SG_ 401 PERCENTAGE "driver override percentage (0-100), very close to steeri CM_ SG_ 401 SETME_X64 "ramps to 0 smoothly then back on falling edge of STEER_REQUEST if BIT isn't 1"; CM_ SG_ 401 ANGLE "angle of car relative to lane center on LTA camera"; CM_ SG_ 401 STEER_ANGLE_CMD "desired angle, OEM steers up to 95 degrees, no angle limit but torque will bottom out"; -CM_ SG_ 401 BIT "has correlation to STEER_REQUEST"; +CM_ SG_ 401 CLEAR_HOLD_STEERING_ALERT "set to 1 when user clears LKAS_HUD->LDA_ALERT ('Hold Steering') by applying torque to steering wheel"; CM_ SG_ 401 STEER_REQUEST "enable bit for steering, 1 to steer, 0 to not"; CM_ SG_ 401 STEER_REQUEST_2 "enable bit for steering, 1 to steer, 0 to not"; CM_ SG_ 401 LKA_ACTIVE "1 when using LTA for LKA"; +CM_ SG_ 401 SETME_X1 "usually 1, seen at 0 on some South American Corollas indicating lack of stock Lane Tracing Assist"; +CM_ SG_ 401 SETME_X3 "almost completely correlates with Toyota Safety Sense version, but may instead describe max torque when using LTA. if TSS 2.5 or 2022 RAV4, this is always 1. if TSS 2.0 this is always 3 (or 0 on Alphard, Highlander, NX)"; CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +CM_ SG_ 881 GAS_PEDAL "not set on all cars, only seen on TSS 2.5 Camry Hybrid so far"; +CM_ SG_ 881 STEER_ANGLE "matches STEER_TORQUE_SENSOR->STEER_ANGLE"; +CM_ SG_ 881 TURN_SIGNALS "flipped on some cars"; +CM_ SG_ 881 LDA_SA_TOGGLE "not applicable for all cars"; +CM_ SG_ 881 LTA_STEER_REQUEST "only applicable for TSS 2.5: matches STEERING_LTA->STEER_REQUEST"; +CM_ SG_ 881 UNKNOWN "related to steering wheel angle"; +CM_ SG_ 881 STEERING_PRESSED "only applicable for TSS 2.5: low sensitivity steering wheel pressed by driver signal"; CM_ SG_ 1014 L_ADJACENT "vehicle adjacent left side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; CM_ SG_ 1014 L_APPROACHING "vehicle approaching from left side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; CM_ SG_ 1014 R_ADJACENT "vehicle adjacent right side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; @@ -53,6 +72,7 @@ CM_ SG_ 1014 R_APPROACHING "vehicle approaching from right side of car. enabled CM_ SG_ 1014 ADJACENT_ENABLED "when BSM is enabled in settings, this is on along with APPROACHING_ENABLED. this controls bsm alert visibility"; CM_ SG_ 1014 APPROACHING_ENABLED "when BSM is enabled in settings, this is on along with ADJACENT_ENABLED. this controls bsm alert visibility"; +VAL_ 401 SETME_X3 3 "TSS 2.0" 1 "TSS 2.5 or 2022 RAV4" 0 "TSS 2.0 on Alphard, Highlander, NX"; VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; VAL_ 610 LKA_STATE 25 "temporary_fault" 17 "permanent_fault" 11 "lka_missing_unavailable2" 9 "temporary_fault2" 5 "active" 3 "lka_missing_unavailable" 1 "standby"; VAL_ 610 LTA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 3 "lta_missing_unavailable" 1 "standby"; diff --git a/hyundai_kia_generic.dbc b/hyundai_kia_generic.dbc index c141934403..f1af8f9d2e 100644 --- a/hyundai_kia_generic.dbc +++ b/hyundai_kia_generic.dbc @@ -698,6 +698,7 @@ BO_ 1365 FPCM11: 8 FPCM BO_ 871 LVR12: 8 LVR SG_ CF_Lvr_CruiseSet : 0|8@1+ (1.0,0.0) [0.0|255.0] "" CLU,TCU + SG_ CF_Lvr_IsgState : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,TCU SG_ CF_Lvr_Gear : 32|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,TCU BO_ 872 LVR11: 8 LVR @@ -1639,11 +1640,15 @@ BO_ 1042 ICM_412h: 8 ICM BO_ 1348 Navi_HU: 8 XXX SG_ SpeedLim_Nav_Clu : 7|8@0+ (1,0) [0|255] "" XXX + SG_ SpeedLim_Nav_General : 29|1@0+ (1,0) [0|1] "" XXX + SG_ SpeedLim_Nav_Cam : 30|1@0+ (1,0) [0|1] "" XXX CM_ "BO_ E_EMS11: All (plug-in) hybrids use this gas signal: CR_Vcu_AccPedDep_Pos, and all EVs use the Accel_Pedal_Pos signal. See hyundai/values.py for a specific car list"; +CM_ SG_ 871 CF_Lvr_IsgState "Idle Stop and Go"; CM_ SG_ 1348 SpeedLim_Nav_Clu "Speed limit displayed on Nav, Cluster and HUD"; VAL_ 274 CUR_GR 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 7 "D" 8 "D" 14 "R" 0 "P"; +VAL_ 871 CF_Lvr_IsgState 0 "enabled" 1 "activated" 2 "unknown" 3 "disabled"; VAL_ 871 CF_Lvr_Gear 12 "T" 5 "D" 8 "S" 6 "N" 7 "R" 0 "P"; VAL_ 882 Elect_Gear_Shifter 5 "D" 8 "S" 6 "N" 7 "R" 0 "P"; VAL_ 905 ACCMode 0 "off" 1 "enabled" 2 "driver_override" 3 "off_maybe_fault" 4 "cancelled"; diff --git a/pyproject.toml b/pyproject.toml index d5d543cf90..26af720fa9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,9 @@ +[tool.poetry] name = "opendbc" +version = "1.0.0" +description = "CAN bus databases and tools" license = "MIT" +authors = ["Vehicle Researcher "] readme = "README.md" repository = "https://github.com/commaai/opendbc" diff --git a/requirements.txt b/requirements.txt index 62b29a25ad..f767d02670 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -Cython==0.29.34 -flake8==6.0.0 -Jinja2==3.1.2 -numpy==1.24.2 -pycapnp==1.3.0 -pylint==2.17.2 -pyyaml==6.0 +Cython<3.0.0 +flake8 +Jinja2 +numpy +pycapnp +pylint==2.17.4 +pyyaml scons diff --git a/subaru_global_2017_generated.dbc b/subaru_global_2017_generated.dbc index b572d1b644..75f15ea946 100644 --- a/subaru_global_2017_generated.dbc +++ b/subaru_global_2017_generated.dbc @@ -87,10 +87,14 @@ BO_ 314 Wheel_Speeds: 8 XXX SG_ FL : 51|13@1+ (0.057,0) [0|255] "kph" XXX SG_ RL : 38|13@1+ (0.057,0) [0|255] "kph" XXX -BO_ 280 STOP_START: 8 XXX +BO_ 280 Steering_Torque_2: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX - SG_ State : 63|1@1+ (1,0) [0|1] "" XXX + SG_ Steer_Torque_Output : 13|11@1- (-10,0) [0|255] "" XXX + SG_ Signal1 : 24|8@1+ (1,0) [0|511] "" XXX + SG_ Steer_Torque_Sensor : 45|11@1- (-1,0) [0|255] "" XXX + SG_ Steering_Active : 61|1@0+ (1,0) [0|1] "" XXX + SG_ Steering_Disabled : 63|1@1+ (1,0) [0|1] "" XXX BO_ 281 Steering_Torque: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX @@ -102,6 +106,11 @@ BO_ 281 Steering_Torque: 8 XXX SG_ Steering_Angle : 32|16@1- (-0.0217,0) [-600|600] "" X SG_ Steer_Torque_Output : 48|11@1- (-10,0) [-1000|1000] "" XXX +BO_ 282 Steering_2: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|1] "" XXX + SG_ Steering_Angle : 24|17@1- (-0.01,0) [0|1] "" XXX + BO_ 312 Brake_Pressure_L_R: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX @@ -131,12 +140,19 @@ BO_ 290 ES_LKAS: 8 XXX SG_ LKAS_Output : 16|13@1- (-1,0) [-8191|8191] "" XXX SG_ LKAS_Request : 29|1@0+ (1,0) [0|1] "" XXX +BO_ 292 ES_LKAS_ALT: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Request : 12|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Output : 40|17@1- (-1,0) [0|1] "" XXX + SG_ SET_3 : 60|2@1+ (1,0) [0|1] "" XXX + BO_ 544 ES_Brake: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX SG_ Brake_Pressure : 16|16@1+ (1,0) [0|65535] "" XXX - SG_ Signal2 : 32|4@1+ (1,0) [0|15] "" XXX + SG_ AEB_Status : 32|4@1+ (1,0) [0|15] "" XXX SG_ Cruise_Brake_Lights : 36|1@1+ (1,0) [0|1] "" XXX SG_ Cruise_Brake_Fault : 37|1@1+ (1,0) [0|1] "" XXX SG_ Cruise_Brake_Active : 38|1@1+ (1,0) [0|1] "" XXX @@ -244,6 +260,9 @@ BO_ 1677 Dash_State: 8 XXX CM_ SG_ 64 Throttle_Combo "Throttle Cruise + Pedal"; CM_ SG_ 313 Brake_Lights "Driver or Cruise Brake on"; CM_ SG_ 544 Cruise_Brake_Lights "1 = switch on brake lights"; +CM_ SG_ 544 Brake_Pressure "Winds down after cruise disabled. Also can be non-zero when likely preparing for AEB"; +CM_ SG_ 544 Signal3 "Usually goes to 2 if AEB_Status is 4"; +CM_ SG_ 544 AEB_Status "Occasionally is 4 instead of 8 while Brake_Pressure is non-zero, unsure why"; CM_ SG_ 801 PCB_Off "Pre-Collision Braking off"; CM_ SG_ 801 Brake_Lights "Driver or Cruise brake on"; CM_ SG_ 801 Cruise_State "0 = Normal, 1 = Hold+User Brake, 2 = Ready, 3 = Hold"; @@ -260,6 +279,7 @@ CM_ SG_ 802 LKAS_Dash_State "0 = Off, 1 = Ready, 2 = Active"; CM_ SG_ 802 LKAS_Right_Line_Visible "0 = Off, 1 = White, 2 = Green, 3 = Orange"; CM_ SG_ 912 UNITS "0 = Metric, 1 = Imperial"; CM_ SG_ 912 ICY_ROAD "1 = DASHLIGHT ON, 2 = WARNING, 3 = OFF"; +VAL_ 544 AEB_Status 12 "AEB related" 8 "AEB actuation" 4 "AEB related" 0 "No AEB actuation"; CM_ "subaru_global_2017.dbc starts here"; @@ -316,7 +336,7 @@ BO_ 576 CruiseControl: 8 XXX SG_ Cruise_Activated : 41|1@1+ (1,0) [0|1] "" XXX SG_ Signal2 : 42|22@1+ (1,0) [0|4194303] "" XXX -BO_ 803 INFOTAINMENT_STATUS: 8 XXX +BO_ 803 ES_Infotainment: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX SG_ LKAS_Blue_Lines : 15|4@0+ (1,0) [0|15] "" XXX diff --git a/subaru_global_2020_hybrid_generated.dbc b/subaru_global_2020_hybrid_generated.dbc index 86358c4505..2d93bde1c6 100644 --- a/subaru_global_2020_hybrid_generated.dbc +++ b/subaru_global_2020_hybrid_generated.dbc @@ -87,10 +87,14 @@ BO_ 314 Wheel_Speeds: 8 XXX SG_ FL : 51|13@1+ (0.057,0) [0|255] "kph" XXX SG_ RL : 38|13@1+ (0.057,0) [0|255] "kph" XXX -BO_ 280 STOP_START: 8 XXX +BO_ 280 Steering_Torque_2: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX - SG_ State : 63|1@1+ (1,0) [0|1] "" XXX + SG_ Steer_Torque_Output : 13|11@1- (-10,0) [0|255] "" XXX + SG_ Signal1 : 24|8@1+ (1,0) [0|511] "" XXX + SG_ Steer_Torque_Sensor : 45|11@1- (-1,0) [0|255] "" XXX + SG_ Steering_Active : 61|1@0+ (1,0) [0|1] "" XXX + SG_ Steering_Disabled : 63|1@1+ (1,0) [0|1] "" XXX BO_ 281 Steering_Torque: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX @@ -102,6 +106,11 @@ BO_ 281 Steering_Torque: 8 XXX SG_ Steering_Angle : 32|16@1- (-0.0217,0) [-600|600] "" X SG_ Steer_Torque_Output : 48|11@1- (-10,0) [-1000|1000] "" XXX +BO_ 282 Steering_2: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|1] "" XXX + SG_ Steering_Angle : 24|17@1- (-0.01,0) [0|1] "" XXX + BO_ 312 Brake_Pressure_L_R: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX @@ -131,12 +140,19 @@ BO_ 290 ES_LKAS: 8 XXX SG_ LKAS_Output : 16|13@1- (-1,0) [-8191|8191] "" XXX SG_ LKAS_Request : 29|1@0+ (1,0) [0|1] "" XXX +BO_ 292 ES_LKAS_ALT: 8 XXX + SG_ CHECKSUM : 0|8@1+ (1,0) [0|1] "" XXX + SG_ COUNTER : 8|4@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Request : 12|1@1+ (1,0) [0|1] "" XXX + SG_ LKAS_Output : 40|17@1- (-1,0) [0|1] "" XXX + SG_ SET_3 : 60|2@1+ (1,0) [0|1] "" XXX + BO_ 544 ES_Brake: 8 XXX SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX SG_ COUNTER : 8|4@1+ (1,0) [0|15] "" XXX SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX SG_ Brake_Pressure : 16|16@1+ (1,0) [0|65535] "" XXX - SG_ Signal2 : 32|4@1+ (1,0) [0|15] "" XXX + SG_ AEB_Status : 32|4@1+ (1,0) [0|15] "" XXX SG_ Cruise_Brake_Lights : 36|1@1+ (1,0) [0|1] "" XXX SG_ Cruise_Brake_Fault : 37|1@1+ (1,0) [0|1] "" XXX SG_ Cruise_Brake_Active : 38|1@1+ (1,0) [0|1] "" XXX @@ -244,6 +260,9 @@ BO_ 1677 Dash_State: 8 XXX CM_ SG_ 64 Throttle_Combo "Throttle Cruise + Pedal"; CM_ SG_ 313 Brake_Lights "Driver or Cruise Brake on"; CM_ SG_ 544 Cruise_Brake_Lights "1 = switch on brake lights"; +CM_ SG_ 544 Brake_Pressure "Winds down after cruise disabled. Also can be non-zero when likely preparing for AEB"; +CM_ SG_ 544 Signal3 "Usually goes to 2 if AEB_Status is 4"; +CM_ SG_ 544 AEB_Status "Occasionally is 4 instead of 8 while Brake_Pressure is non-zero, unsure why"; CM_ SG_ 801 PCB_Off "Pre-Collision Braking off"; CM_ SG_ 801 Brake_Lights "Driver or Cruise brake on"; CM_ SG_ 801 Cruise_State "0 = Normal, 1 = Hold+User Brake, 2 = Ready, 3 = Hold"; @@ -260,6 +279,7 @@ CM_ SG_ 802 LKAS_Dash_State "0 = Off, 1 = Ready, 2 = Active"; CM_ SG_ 802 LKAS_Right_Line_Visible "0 = Off, 1 = White, 2 = Green, 3 = Orange"; CM_ SG_ 912 UNITS "0 = Metric, 1 = Imperial"; CM_ SG_ 912 ICY_ROAD "1 = DASHLIGHT ON, 2 = WARNING, 3 = OFF"; +VAL_ 544 AEB_Status 12 "AEB related" 8 "AEB actuation" 4 "AEB related" 0 "No AEB actuation"; CM_ "subaru_global_2020_hybrid.dbc starts here"; diff --git a/toyota_new_mc_pt_generated.dbc b/toyota_new_mc_pt_generated.dbc index 3bd6792054..b5667101d5 100644 --- a/toyota_new_mc_pt_generated.dbc +++ b/toyota_new_mc_pt_generated.dbc @@ -83,7 +83,7 @@ BU_: XXX DSU HCU EPS IPAS CGW BGM BO_ 36 KINEMATICS: 8 XXX SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/s" XXX - SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + SG_ ACCEL_X : 17|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX BO_ 37 STEER_ANGLE_SENSOR: 8 XXX SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX @@ -286,7 +286,7 @@ BO_ 1042 LKAS_HUD: 8 DSU SG_ LDA_UNAVAILABLE : 16|1@0+ (1,0) [0|1] "" XXX SG_ LDA_SENSITIVITY : 18|2@0+ (1,0) [0|3] "" XXX SG_ LDA_SA_TOGGLE : 20|2@0+ (1,0) [0|3] "" XXX - SG_ LDA_SPEED_TOO_LOW : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MESSAGES : 23|3@0+ (1,0) [0|1] "" XXX SG_ LDA_ON_MESSAGE : 31|2@0+ (1,0) [0|3] "" XXX SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX SG_ LANE_SWAY_TOGGLE : 43|1@0+ (1,0) [0|1] "" XXX @@ -310,6 +310,11 @@ BO_ 1043 TIME : 8 CGW SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX +BO_ 1044 AUTO_HIGH_BEAM: 8 FCM + SG_ AHB_DUTY : 47|8@0+ (0.5,0) [0|0] "%" Vector__XXX + SG_ F_AHB : 55|4@0+ (1,0) [0|0] "" Vector__XXX + SG_ C_AHB : 51|4@0+ (1,0) [0|0] "" Vector__XXX + BO_ 1083 AUTOPARK_STATUS: 8 IPAS SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX @@ -468,7 +473,7 @@ CM_ SG_ 1042 LDA_SENSITIVITY "LDA Sensitivity"; CM_ SG_ 1042 LDA_ON_MESSAGE "Display LDA Turned ON message"; CM_ SG_ 1042 REPEATED_BEEPS "LDA audible warning"; CM_ SG_ 1042 LDA_UNAVAILABLE_QUIET "LDA toggles and sensitivity settings are greyed out if set to 1"; -CM_ SG_ 1042 LDA_SPEED_TOO_LOW "length is 3 bits in the leaked DBC, displays LDA unavailable below approx 50 km/h if set to 1"; +CM_ SG_ 1042 LDA_MESSAGES "Various LDA Messages"; CM_ SG_ 1042 LDA_FRONT_CAMERA_BLOCKED "originally LDAFCVB, LDA related settings are greyed out if set to 1"; CM_ SG_ 1042 TAKE_CONTROL "Please Control Steering Wheel warning"; CM_ SG_ 1042 LANE_SWAY_TOGGLE "Lane Sway Warning System SWS Switch"; @@ -532,7 +537,7 @@ VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; VAL_ 1042 LDA_ON_MESSAGE 2 "Lane Departure Alert Turned ON, Steering Assist Inactive" 1 "Lane Departure Alert Turned ON, Steering Assist Active" 0 "clear"; VAL_ 1042 LDA_SA_TOGGLE 2 "steering assist off" 1 "steering assist on"; VAL_ 1042 LDA_SENSITIVITY 2 "standard" 1 "high" 0 "undefined"; -VAL_ 1042 LDA_SPEED_TOO_LOW 1 "lda unavailable, speed too low" 0 "ok"; +VAL_ 1042 LDA_MESSAGES 4 "lda unavailable at this speed" 1 "lda unavailable below approx 50km/h" 0 "ok"; VAL_ 1042 LDA_FRONT_CAMERA_BLOCKED 1 "lda unavailable" 0 "ok"; VAL_ 1042 TAKE_CONTROL 1 "take control" 0 "ok"; VAL_ 1042 LANE_SWAY_WARNING 3 "ok" 2 "orange please take a break" 1 "prompt would you like to take a break" 0 "ok"; diff --git a/toyota_nodsu_pt_generated.dbc b/toyota_nodsu_pt_generated.dbc index f409b5c3c7..2ea426557f 100644 --- a/toyota_nodsu_pt_generated.dbc +++ b/toyota_nodsu_pt_generated.dbc @@ -83,7 +83,7 @@ BU_: XXX DSU HCU EPS IPAS CGW BGM BO_ 36 KINEMATICS: 8 XXX SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/s" XXX - SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + SG_ ACCEL_X : 17|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX BO_ 37 STEER_ANGLE_SENSOR: 8 XXX SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX @@ -286,7 +286,7 @@ BO_ 1042 LKAS_HUD: 8 DSU SG_ LDA_UNAVAILABLE : 16|1@0+ (1,0) [0|1] "" XXX SG_ LDA_SENSITIVITY : 18|2@0+ (1,0) [0|3] "" XXX SG_ LDA_SA_TOGGLE : 20|2@0+ (1,0) [0|3] "" XXX - SG_ LDA_SPEED_TOO_LOW : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MESSAGES : 23|3@0+ (1,0) [0|1] "" XXX SG_ LDA_ON_MESSAGE : 31|2@0+ (1,0) [0|3] "" XXX SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX SG_ LANE_SWAY_TOGGLE : 43|1@0+ (1,0) [0|1] "" XXX @@ -310,6 +310,11 @@ BO_ 1043 TIME : 8 CGW SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX +BO_ 1044 AUTO_HIGH_BEAM: 8 FCM + SG_ AHB_DUTY : 47|8@0+ (0.5,0) [0|0] "%" Vector__XXX + SG_ F_AHB : 55|4@0+ (1,0) [0|0] "" Vector__XXX + SG_ C_AHB : 51|4@0+ (1,0) [0|0] "" Vector__XXX + BO_ 1083 AUTOPARK_STATUS: 8 IPAS SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX @@ -468,7 +473,7 @@ CM_ SG_ 1042 LDA_SENSITIVITY "LDA Sensitivity"; CM_ SG_ 1042 LDA_ON_MESSAGE "Display LDA Turned ON message"; CM_ SG_ 1042 REPEATED_BEEPS "LDA audible warning"; CM_ SG_ 1042 LDA_UNAVAILABLE_QUIET "LDA toggles and sensitivity settings are greyed out if set to 1"; -CM_ SG_ 1042 LDA_SPEED_TOO_LOW "length is 3 bits in the leaked DBC, displays LDA unavailable below approx 50 km/h if set to 1"; +CM_ SG_ 1042 LDA_MESSAGES "Various LDA Messages"; CM_ SG_ 1042 LDA_FRONT_CAMERA_BLOCKED "originally LDAFCVB, LDA related settings are greyed out if set to 1"; CM_ SG_ 1042 TAKE_CONTROL "Please Control Steering Wheel warning"; CM_ SG_ 1042 LANE_SWAY_TOGGLE "Lane Sway Warning System SWS Switch"; @@ -532,7 +537,7 @@ VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; VAL_ 1042 LDA_ON_MESSAGE 2 "Lane Departure Alert Turned ON, Steering Assist Inactive" 1 "Lane Departure Alert Turned ON, Steering Assist Active" 0 "clear"; VAL_ 1042 LDA_SA_TOGGLE 2 "steering assist off" 1 "steering assist on"; VAL_ 1042 LDA_SENSITIVITY 2 "standard" 1 "high" 0 "undefined"; -VAL_ 1042 LDA_SPEED_TOO_LOW 1 "lda unavailable, speed too low" 0 "ok"; +VAL_ 1042 LDA_MESSAGES 4 "lda unavailable at this speed" 1 "lda unavailable below approx 50km/h" 0 "ok"; VAL_ 1042 LDA_FRONT_CAMERA_BLOCKED 1 "lda unavailable" 0 "ok"; VAL_ 1042 TAKE_CONTROL 1 "take control" 0 "ok"; VAL_ 1042 LANE_SWAY_WARNING 3 "ok" 2 "orange please take a break" 1 "prompt would you like to take a break" 0 "ok"; @@ -560,7 +565,7 @@ BO_ 401 STEERING_LTA: 8 XXX SG_ STEER_ANGLE_CMD : 15|16@0- (0.0573,0) [-540|540] "" XXX SG_ STEER_REQUEST_2 : 25|1@0+ (1,0) [0|1] "" XXX SG_ LKA_ACTIVE : 26|1@0+ (1,0) [0|1] "" XXX - SG_ BIT : 30|1@0+ (1,0) [0|1] "" XXX + SG_ CLEAR_HOLD_STEERING_ALERT : 30|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 6|6@0+ (1,0) [0|255] "" XXX SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX SG_ SETME_X1 : 7|1@0+ (1,0) [0|1] "" XXX @@ -577,6 +582,16 @@ BO_ 610 EPS_STATUS: 8 EPS SG_ TYPE : 24|1@0+ (1,0) [0|1] "" XXX SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX +BO_ 881 LTA_RELATED: 8 FCM + SG_ GAS_PEDAL : 15|8@0+ (0.005,0) [0|1] "" XXX + SG_ STEER_ANGLE : 23|16@0- (0.0573,0) [-500|500] "" XXX + SG_ TURN_SIGNALS : 35|2@0+ (1,0) [0|3] "" XXX + SG_ UNKNOWN_2 : 58|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_SA_TOGGLE : 59|1@0+ (1,0) [0|1] "" XXX + SG_ LTA_STEER_REQUEST : 60|1@0+ (1,0) [0|1] "" XXX + SG_ UNKNOWN : 61|1@0+ (1,0) [0|1] "" XXX + SG_ STEERING_PRESSED : 63|1@0+ (1,0) [0|1] "" XXX + BO_ 1014 BSM: 8 XXX SG_ L_ADJACENT : 0|1@0+ (1,0) [0|1] "" XXX SG_ L_APPROACHING : 8|1@0+ (1,0) [0|1] "" XXX @@ -589,13 +604,22 @@ CM_ SG_ 401 PERCENTAGE "driver override percentage (0-100), very close to steeri CM_ SG_ 401 SETME_X64 "ramps to 0 smoothly then back on falling edge of STEER_REQUEST if BIT isn't 1"; CM_ SG_ 401 ANGLE "angle of car relative to lane center on LTA camera"; CM_ SG_ 401 STEER_ANGLE_CMD "desired angle, OEM steers up to 95 degrees, no angle limit but torque will bottom out"; -CM_ SG_ 401 BIT "has correlation to STEER_REQUEST"; +CM_ SG_ 401 CLEAR_HOLD_STEERING_ALERT "set to 1 when user clears LKAS_HUD->LDA_ALERT ('Hold Steering') by applying torque to steering wheel"; CM_ SG_ 401 STEER_REQUEST "enable bit for steering, 1 to steer, 0 to not"; CM_ SG_ 401 STEER_REQUEST_2 "enable bit for steering, 1 to steer, 0 to not"; CM_ SG_ 401 LKA_ACTIVE "1 when using LTA for LKA"; +CM_ SG_ 401 SETME_X1 "usually 1, seen at 0 on some South American Corollas indicating lack of stock Lane Tracing Assist"; +CM_ SG_ 401 SETME_X3 "almost completely correlates with Toyota Safety Sense version, but may instead describe max torque when using LTA. if TSS 2.5 or 2022 RAV4, this is always 1. if TSS 2.0 this is always 3 (or 0 on Alphard, Highlander, NX)"; CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; CM_ SG_ 610 TYPE "seems 1 on Corolla, 0 on all others"; +CM_ SG_ 881 GAS_PEDAL "not set on all cars, only seen on TSS 2.5 Camry Hybrid so far"; +CM_ SG_ 881 STEER_ANGLE "matches STEER_TORQUE_SENSOR->STEER_ANGLE"; +CM_ SG_ 881 TURN_SIGNALS "flipped on some cars"; +CM_ SG_ 881 LDA_SA_TOGGLE "not applicable for all cars"; +CM_ SG_ 881 LTA_STEER_REQUEST "only applicable for TSS 2.5: matches STEERING_LTA->STEER_REQUEST"; +CM_ SG_ 881 UNKNOWN "related to steering wheel angle"; +CM_ SG_ 881 STEERING_PRESSED "only applicable for TSS 2.5: low sensitivity steering wheel pressed by driver signal"; CM_ SG_ 1014 L_ADJACENT "vehicle adjacent left side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; CM_ SG_ 1014 L_APPROACHING "vehicle approaching from left side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; CM_ SG_ 1014 R_ADJACENT "vehicle adjacent right side of car. enabled above 10mph, regardless of ADJACENT_ENABLED or APPROACHING_ENABLED"; @@ -603,6 +627,7 @@ CM_ SG_ 1014 R_APPROACHING "vehicle approaching from right side of car. enabled CM_ SG_ 1014 ADJACENT_ENABLED "when BSM is enabled in settings, this is on along with APPROACHING_ENABLED. this controls bsm alert visibility"; CM_ SG_ 1014 APPROACHING_ENABLED "when BSM is enabled in settings, this is on along with ADJACENT_ENABLED. this controls bsm alert visibility"; +VAL_ 401 SETME_X3 3 "TSS 2.0" 1 "TSS 2.5 or 2022 RAV4" 0 "TSS 2.0 on Alphard, Highlander, NX"; VAL_ 610 IPAS_STATE 5 "override" 3 "enabled" 1 "disabled"; VAL_ 610 LKA_STATE 25 "temporary_fault" 17 "permanent_fault" 11 "lka_missing_unavailable2" 9 "temporary_fault2" 5 "active" 3 "lka_missing_unavailable" 1 "standby"; VAL_ 610 LTA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 3 "lta_missing_unavailable" 1 "standby"; diff --git a/toyota_tnga_k_pt_generated.dbc b/toyota_tnga_k_pt_generated.dbc index 22c0a1ca2a..c16b9f1234 100644 --- a/toyota_tnga_k_pt_generated.dbc +++ b/toyota_tnga_k_pt_generated.dbc @@ -83,7 +83,7 @@ BU_: XXX DSU HCU EPS IPAS CGW BGM BO_ 36 KINEMATICS: 8 XXX SG_ ACCEL_Y : 33|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX SG_ YAW_RATE : 1|10@0+ (0.244,-125) [0|65535] "deg/s" XXX - SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + SG_ ACCEL_X : 17|10@0+ (0.03589,-18.375) [0|65535] "m/s^2" XXX BO_ 37 STEER_ANGLE_SENSOR: 8 XXX SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX @@ -286,7 +286,7 @@ BO_ 1042 LKAS_HUD: 8 DSU SG_ LDA_UNAVAILABLE : 16|1@0+ (1,0) [0|1] "" XXX SG_ LDA_SENSITIVITY : 18|2@0+ (1,0) [0|3] "" XXX SG_ LDA_SA_TOGGLE : 20|2@0+ (1,0) [0|3] "" XXX - SG_ LDA_SPEED_TOO_LOW : 21|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MESSAGES : 23|3@0+ (1,0) [0|1] "" XXX SG_ LDA_ON_MESSAGE : 31|2@0+ (1,0) [0|3] "" XXX SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX SG_ LANE_SWAY_TOGGLE : 43|1@0+ (1,0) [0|1] "" XXX @@ -310,6 +310,11 @@ BO_ 1043 TIME : 8 CGW SG_ GMTDIFF_MINUTES : 50|6@0+ (1,0) [0|0] "minutes" XXX SG_ SUMMER : 60|1@0+ (1,0) [0|0] "" XXX +BO_ 1044 AUTO_HIGH_BEAM: 8 FCM + SG_ AHB_DUTY : 47|8@0+ (0.5,0) [0|0] "%" Vector__XXX + SG_ F_AHB : 55|4@0+ (1,0) [0|0] "" Vector__XXX + SG_ C_AHB : 51|4@0+ (1,0) [0|0] "" Vector__XXX + BO_ 1083 AUTOPARK_STATUS: 8 IPAS SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX @@ -468,7 +473,7 @@ CM_ SG_ 1042 LDA_SENSITIVITY "LDA Sensitivity"; CM_ SG_ 1042 LDA_ON_MESSAGE "Display LDA Turned ON message"; CM_ SG_ 1042 REPEATED_BEEPS "LDA audible warning"; CM_ SG_ 1042 LDA_UNAVAILABLE_QUIET "LDA toggles and sensitivity settings are greyed out if set to 1"; -CM_ SG_ 1042 LDA_SPEED_TOO_LOW "length is 3 bits in the leaked DBC, displays LDA unavailable below approx 50 km/h if set to 1"; +CM_ SG_ 1042 LDA_MESSAGES "Various LDA Messages"; CM_ SG_ 1042 LDA_FRONT_CAMERA_BLOCKED "originally LDAFCVB, LDA related settings are greyed out if set to 1"; CM_ SG_ 1042 TAKE_CONTROL "Please Control Steering Wheel warning"; CM_ SG_ 1042 LANE_SWAY_TOGGLE "Lane Sway Warning System SWS Switch"; @@ -532,7 +537,7 @@ VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none"; VAL_ 1042 LDA_ON_MESSAGE 2 "Lane Departure Alert Turned ON, Steering Assist Inactive" 1 "Lane Departure Alert Turned ON, Steering Assist Active" 0 "clear"; VAL_ 1042 LDA_SA_TOGGLE 2 "steering assist off" 1 "steering assist on"; VAL_ 1042 LDA_SENSITIVITY 2 "standard" 1 "high" 0 "undefined"; -VAL_ 1042 LDA_SPEED_TOO_LOW 1 "lda unavailable, speed too low" 0 "ok"; +VAL_ 1042 LDA_MESSAGES 4 "lda unavailable at this speed" 1 "lda unavailable below approx 50km/h" 0 "ok"; VAL_ 1042 LDA_FRONT_CAMERA_BLOCKED 1 "lda unavailable" 0 "ok"; VAL_ 1042 TAKE_CONTROL 1 "take control" 0 "ok"; VAL_ 1042 LANE_SWAY_WARNING 3 "ok" 2 "orange please take a break" 1 "prompt would you like to take a break" 0 "ok";