repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/car/vin.py | selfdrive/debug/car/vin.py | #!/usr/bin/env python3
import argparse
import time
import cereal.messaging as messaging
from opendbc.car.carlog import carlog
from opendbc.car.vin import get_vin
from openpilot.selfdrive.car.card import can_comm_callbacks
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Get VIN of the car')
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/car/fw_versions.py | selfdrive/debug/car/fw_versions.py | #!/usr/bin/env python3
import time
import argparse
import cereal.messaging as messaging
from cereal import car
from opendbc.car.carlog import carlog
from opendbc.car.fw_versions import get_fw_versions, match_fw_to_car
from opendbc.car.vin import get_vin
from openpilot.common.params import Params
from openpilot.selfdriv... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/car/disable_ecu.py | selfdrive/debug/car/disable_ecu.py | #!/usr/bin/env python3
import time
import cereal.messaging as messaging
from opendbc.car.disable_ecu import disable_ecu
from openpilot.selfdrive.car.card import can_comm_callbacks
if __name__ == "__main__":
sendcan = messaging.pub_sock('sendcan')
logcan = messaging.sub_sock('can')
can_callbacks = can_comm_callba... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/docs/hooks/glossary.py | docs/hooks/glossary.py | import re
import tomllib
def load_glossary(file_path="docs/glossary.toml"):
with open(file_path, "rb") as f:
glossary_data = tomllib.load(f)
return glossary_data.get("glossary", {})
def generate_anchor_id(name):
return name.replace(" ", "-").replace("_", "-").lower()
def format_markdown_term(name, definiti... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/conftest.py | opendbc_repo/conftest.py | # pytest attempts to execute shell scripts while collecting
collect_ignore_glob = [
"opendbc/safety/tests/misra/*.sh",
"opendbc/safety/tests/misra/cppcheck/",
]
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/site_scons/site_tools/cython.py | opendbc_repo/site_scons/site_tools/cython.py | import re
import SCons
from SCons.Action import Action
from SCons.Scanner import Scanner
pyx_from_import_re = re.compile(r'^from\s+(\S+)\s+cimport', re.M)
pyx_import_re = re.compile(r'^cimport\s+(\S+)', re.M)
cdef_import_re = re.compile(r'^cdef extern from\s+.(\S+).:', re.M)
def pyx_scan(node, env, path, arg=None):
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/examples/kbhit.py | opendbc_repo/examples/kbhit.py | #!/usr/bin/env python3
import sys
import termios
import atexit
from select import select
STDIN_FD = sys.stdin.fileno()
class KBHit:
def __init__(self) -> None:
self.set_kbhit_terminal()
def set_kbhit_terminal(self) -> None:
# Save the terminal settings
self.old_term = termios.tcgetattr(STDIN_FD)
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/examples/joystick.py | opendbc_repo/examples/joystick.py | #!/usr/bin/env python3
import time
import threading
import argparse
import numpy as np
from pprint import pprint
from inputs import get_gamepad
from kbhit import KBHit
from opendbc.car.structs import CarControl
from opendbc.car.panda_runner import PandaRunner
class Keyboard:
def __init__(self):
self.kb = KBHit... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/__init__.py | opendbc_repo/opendbc/__init__.py | import os
DBC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'dbc')
# -I include path for e.g. "#include <opendbc/safety/safety.h>"
INCLUDE_PATH = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/uds.py | opendbc_repo/opendbc/car/uds.py | import time
import struct
from collections import deque
from typing import NamedTuple, cast
from collections.abc import Callable, Generator
from enum import IntEnum
from functools import partial
from opendbc.car.carlog import carlog
class SERVICE_TYPE(IntEnum):
DIAGNOSTIC_SESSION_CONTROL = 0x10
ECU_RESET = 0x11
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | true |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/interfaces.py | opendbc_repo/opendbc/car/interfaces.py | from collections import deque
import json
import os
import numpy as np
import time
import tomllib
import math
from abc import abstractmethod, ABC
from difflib import SequenceMatcher
from enum import StrEnum
from typing import Any, NamedTuple
from collections.abc import Callable
from functools import cache
from opendbc... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/fw_query_definitions.py | opendbc_repo/opendbc/car/fw_query_definitions.py | import copy
from dataclasses import dataclass, field
import struct
from collections.abc import Callable
from opendbc.car import uds
from opendbc.car.structs import CarParams
Ecu = CarParams.Ecu
AddrType = tuple[int, int | None]
EcuAddrBusType = tuple[int, int | None, int]
EcuAddrSubAddr = tuple[Ecu, int, int | None]... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/ccp.py | opendbc_repo/opendbc/car/ccp.py | import sys
import time
import struct
from enum import IntEnum, Enum
from dataclasses import dataclass
@dataclass
class ExchangeStationIdsReturn:
id_length: int
data_type: int
available: int
protected: int
@dataclass
class GetDaqListSizeReturn:
list_size: int
first_pid: int
@dataclass
class GetSessionStat... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/fingerprints.py | opendbc_repo/opendbc/car/fingerprints.py | from opendbc.car.interfaces import get_interface_attr
from opendbc.car.body.values import CAR as BODY
from opendbc.car.chrysler.values import CAR as CHRYSLER
from opendbc.car.ford.values import CAR as FORD
from opendbc.car.gm.values import CAR as GM
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.hyu... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/structs.py | opendbc_repo/opendbc/car/structs.py | import os
import capnp
from opendbc.car.common.basedir import BASEDIR
# TODO: remove car from cereal/__init__.py and always import from opendbc
try:
from cereal import car
except ImportError:
capnp.remove_import_hook()
car = capnp.load(os.path.join(BASEDIR, "car.capnp"))
CarState = car.CarState
RadarData = car.... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/ecu_addrs.py | opendbc_repo/opendbc/car/ecu_addrs.py | import time
from opendbc.car import make_tester_present_msg, uds
from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable
from opendbc.car.carlog import carlog
from opendbc.car.fw_query_definitions import EcuAddrBusType
def _is_tester_present_response(msg: CanData, subaddr: int = None) -> bo... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/vin.py | opendbc_repo/opendbc/car/vin.py | import re
from dataclasses import dataclass, field
from opendbc.car import uds
from opendbc.car.carlog import carlog
from opendbc.car.isotp_parallel_query import IsoTpParallelQuery
from opendbc.car.fw_query_definitions import STANDARD_VIN_ADDRS, StdQueries
VIN_UNKNOWN = "0" * 17
VIN_RE = "[A-HJ-NPR-Z0-9]{17}"
@data... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/vehicle_model.py | opendbc_repo/opendbc/car/vehicle_model.py | #!/usr/bin/env python3
"""
Dynamic bicycle model from "The Science of Vehicle Dynamics (2014), M. Guiggiani"
The state is x = [v, r]^T
with v lateral speed [m/s], and r rotational speed [rad/s]
The input u is the steering angle [rad], and roll [rad]
The system is defined by
x_dot = A*x + B*u
A depends on longitudin... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/car_helpers.py | opendbc_repo/opendbc/car/car_helpers.py | import os
import time
from opendbc.car import gen_empty_fingerprint
from opendbc.car.can_definitions import CanRecvCallable, CanSendCallable
from opendbc.car.carlog import carlog
from opendbc.car.structs import CarParams, CarParamsT
from opendbc.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerpri... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/extra_cars.py | opendbc_repo/opendbc/car/extra_cars.py | from dataclasses import dataclass
from opendbc.car import structs, Platforms, ExtraPlatformConfig
from opendbc.car.docs_definitions import ExtraCarDocs, SupportType
@dataclass
class CommunityCarDocs(ExtraCarDocs):
def init_make(self, CP: structs.CarParams):
self.support_type = SupportType.COMMUNITY
self.su... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/fw_versions.py | opendbc_repo/opendbc/car/fw_versions.py | from collections import defaultdict
from collections.abc import Callable, Iterator
from typing import Protocol, TypeVar
from tqdm import tqdm
from opendbc.car import uds
from opendbc.car.can_definitions import CanRecvCallable, CanSendCallable
from opendbc.car.carlog import carlog
from opendbc.car.structs import CarPa... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/secoc.py | opendbc_repo/opendbc/car/secoc.py | import struct
from Crypto.Hash import CMAC
from Crypto.Cipher import AES
def add_mac(key, trip_cnt, reset_cnt, msg_cnt, msg):
# TODO: clean up conversion to and from hex
addr, payload, bus = msg
reset_flag = reset_cnt & 0b11
msg_cnt_flag = msg_cnt & 0b11
payload = payload[:4]
# Step 1: Build Freshness V... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/docs_definitions.py | opendbc_repo/opendbc/car/docs_definitions.py | import re
from collections import namedtuple
import copy
from dataclasses import dataclass, field
from enum import Enum
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.structs import CarParams
GOOD_TORQUE_THRESHOLD = 1.0 # m/s^2
MODEL_YEARS_RE = r"(?<= )((\d{4}-\d{2})|(\d{4}))(,|$)"
c... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/isotp_parallel_query.py | opendbc_repo/opendbc/car/isotp_parallel_query.py | import time
from collections import defaultdict
from functools import partial
from opendbc.car import uds
from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable
from opendbc.car.carlog import carlog
from opendbc.car.fw_query_definitions import AddrType
class IsoTpParallelQuery:
def __ini... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/crc.py | opendbc_repo/opendbc/car/crc.py |
def _gen_crc8_table(poly: int) -> list[int]:
table = []
for i in range(256):
crc = i
for _ in range(8):
if crc & 0x80:
crc = ((crc << 1) ^ poly) & 0xFF
else:
crc = (crc << 1) & 0xFF
table.append(crc)
return table
def _gen_crc16_table(poly: int) -> list[int]:
table = []... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/__init__.py | opendbc_repo/opendbc/car/__init__.py | # functions common among cars
import numpy as np
from dataclasses import dataclass, field
from enum import IntFlag, ReprEnum, StrEnum, EnumType, auto
from dataclasses import replace
from opendbc.car import structs, uds
from opendbc.car.can_definitions import CanData
from opendbc.car.docs_definitions import CarDocs, Ex... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/xcp.py | opendbc_repo/opendbc/car/xcp.py | import sys
import time
import struct
from enum import IntEnum
class COMMAND_CODE(IntEnum):
CONNECT = 0xFF
DISCONNECT = 0xFE
GET_STATUS = 0xFD
SYNCH = 0xFC
GET_COMM_MODE_INFO = 0xFB
GET_ID = 0xFA
SET_REQUEST = 0xF9
GET_SEED = 0xF8
UNLOCK = 0xF7
SET_MTA = 0xF6
UPLOAD = 0xF5
SHORT_UPLOAD = 0xF4
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/disable_ecu.py | opendbc_repo/opendbc/car/disable_ecu.py | from opendbc.car.carlog import carlog
from opendbc.car.isotp_parallel_query import IsoTpParallelQuery
EXT_DIAG_REQUEST = b'\x10\x03'
EXT_DIAG_RESPONSE = b'\x50\x03'
COM_CONT_RESPONSE = b''
def disable_ecu(can_recv, can_send, bus=0, addr=0x7d0, sub_addr=None, com_cont_req=b'\x28\x83\x01', timeout=0.1, retry=10):
"... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/docs.py | opendbc_repo/opendbc/car/docs.py | #!/usr/bin/env python3
import argparse
import os
from typing import get_args
from collections import defaultdict
import jinja2
from enum import Enum
from natsort import natsorted
from opendbc.car.common.basedir import BASEDIR
from opendbc.car import gen_empty_fingerprint
from opendbc.car.structs import CarParams
from... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/values.py | opendbc_repo/opendbc/car/values.py | from typing import get_args
from opendbc.car.body.values import CAR as BODY
from opendbc.car.chrysler.values import CAR as CHRYSLER
from opendbc.car.ford.values import CAR as FORD
from opendbc.car.gm.values import CAR as GM
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.hyundai.values import CAR as ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/panda_runner.py | opendbc_repo/opendbc/car/panda_runner.py | import time
from contextlib import AbstractContextManager
from panda import Panda
from opendbc.car.car_helpers import get_car
from opendbc.car.can_definitions import CanData
from opendbc.car.structs import CarParams, CarControl
class PandaRunner(AbstractContextManager):
def __enter__(self):
self.p = Panda()
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/isotp.py | opendbc_repo/opendbc/car/isotp.py | import binascii
import time
DEBUG = False
def msg(x):
if DEBUG:
print("S:", binascii.hexlify(x))
assert len(x) <= 7
ret = bytes([len(x)]) + x
return ret.ljust(8, b"\x00")
kmsgs = []
def recv(panda, cnt, addr, nbus):
global kmsgs
ret = []
while len(ret) < cnt:
kmsgs += panda.can_recv()
nmsg... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/can_definitions.py | opendbc_repo/opendbc/car/can_definitions.py | from collections.abc import Callable
from typing import NamedTuple, Protocol
class CanData(NamedTuple):
address: int
dat: bytes
src: int
CanSendCallable = Callable[[list[CanData]], None]
class CanRecvCallable(Protocol):
def __call__(self, wait_for_one: bool = False) -> list[list[CanData]]: ...
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/carlog.py | opendbc_repo/opendbc/car/carlog.py | import os
import logging
# set up logging
LOGPRINT = os.environ.get('LOGPRINT', 'INFO').upper()
carlog = logging.getLogger('carlog')
carlog.setLevel(LOGPRINT)
carlog.propagate = False
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('%(message)s'))
carlog.addHandler(handler)
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/fingerprints.py | opendbc_repo/opendbc/car/honda/fingerprints.py | from opendbc.car.structs import CarParams
from opendbc.car.honda.values import CAR
Ecu = CarParams.Ecu
# Modified FW can be identified by the second dash being replaced by a comma
# For example: `b'39990-TVA,A150\x00\x00'`
#
# TODO: vsa is "essential" for fpv2 but doesn't appear on some CAR.FREED models
FW_VERSIONS... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/hondacan.py | opendbc_repo/opendbc/car/honda/hondacan.py | from opendbc.car import CanBusBase
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, CAR, CarControllerParams
# CAN bus layout with relay
# 0 = ACC-CAN - radar side
# 1 = F-CAN B - powertrain
# 2 = ACC-CAN - camera side
# 3... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/interface.py | opendbc_repo/opendbc/car/honda/interface.py | #!/usr/bin/env python3
import numpy as np
from opendbc.car import get_safety_config, structs
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.disable_ecu import disable_ecu
from opendbc.car.honda.hondacan import CanBus
from opendbc.car.honda.values import CarControllerParams, HondaFlags, CA... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/__init__.py | opendbc_repo/opendbc/car/honda/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/carstate.py | opendbc_repo/opendbc/car/honda/carstate.py | import numpy as np
from collections import defaultdict
from opendbc.can import CANDefine, CANParser
from opendbc.car import Bus, create_button_events, structs
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.honda.hondacan import CanBus, get_cruise_speed_conversion
from opendbc.car.honda.v... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/carcontroller.py | opendbc_repo/opendbc/car/honda/carcontroller.py | import numpy as np
from collections import namedtuple
from opendbc.can import CANPacker
from opendbc.car import Bus, DT_CTRL, rate_limit, make_tester_present_msg, structs
from opendbc.car.honda import hondacan
from opendbc.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NID... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/values.py | opendbc_repo/opendbc/car/honda/values.py | from dataclasses import dataclass
from enum import Enum, IntFlag
from opendbc.car import Bus, CarSpecs, PlatformConfig, Platforms, structs, uds
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.docs_definitions import CarFootnote, CarHarness, CarDocs, CarParts, Column
from opendbc.car.fw_qu... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/radar_interface.py | opendbc_repo/opendbc/car/honda/radar_interface.py | #!/usr/bin/env python3
from opendbc.can import CANParser
from opendbc.car import Bus, structs
from opendbc.car.interfaces import RadarInterfaceBase
from opendbc.car.honda.values import DBC
def _create_nidec_can_parser(car_fingerprint):
radar_messages = [0x400] + list(range(0x430, 0x43A)) + list(range(0x440, 0x446))... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/tests/test_honda.py | opendbc_repo/opendbc/car/honda/tests/test_honda.py | import re
from opendbc.car.honda.fingerprints import FW_VERSIONS
HONDA_FW_VERSION_RE = br"[A-Z0-9]{5}-[A-Z0-9]{3}(-|,)[A-Z0-9]{4}(\x00){2}$"
class TestHondaFingerprint:
def test_fw_version_format(self):
# Asserts all FW versions follow an expected format
for fw_by_ecu in FW_VERSIONS.values():
for fw... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/honda/tests/__init__.py | opendbc_repo/opendbc/car/honda/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/fingerprints.py | opendbc_repo/opendbc/car/toyota/fingerprints.py | from opendbc.car.structs import CarParams
from opendbc.car.toyota.values import CAR
Ecu = CarParams.Ecu
FW_VERSIONS = {
CAR.TOYOTA_AVALON: {
(Ecu.abs, 0x7b0, None): [
b'F152607060\x00\x00\x00\x00\x00\x00',
],
(Ecu.dsu, 0x791, None): [
b'881510701300\x00\x00\x00\x00',
b'881510705100\x00... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | true |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/toyotacan.py | opendbc_repo/opendbc/car/toyota/toyotacan.py | from opendbc.car.structs import CarParams
SteerControlType = CarParams.SteerControlType
def create_steer_command(packer, steer, steer_req):
"""Creates a CAN message for the Toyota Steer Command."""
values = {
"STEER_REQUEST": steer_req,
"STEER_TORQUE_CMD": steer,
"SET_ME_1": 1,
}
return packer.m... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/interface.py | opendbc_repo/opendbc/car/toyota/interface.py | from opendbc.car import Bus, structs, get_safety_config, uds
from opendbc.car.toyota.carstate import CarState
from opendbc.car.toyota.carcontroller import CarController
from opendbc.car.toyota.radar_interface import RadarInterface
from opendbc.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TS... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/__init__.py | opendbc_repo/opendbc/car/toyota/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/carstate.py | opendbc_repo/opendbc/car/toyota/carstate.py | import copy
import numpy as np
from opendbc.can import CANDefine, CANParser
from opendbc.car import Bus, DT_CTRL, create_button_events, structs
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.common.filter_simple import FirstOrderFilter
from opendbc.car.interfaces import CarStateBase
from... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/carcontroller.py | opendbc_repo/opendbc/car/toyota/carcontroller.py | import math
import numpy as np
from opendbc.car import Bus, apply_meas_steer_torque_limits, apply_std_steer_angle_limits, common_fault_avoidance, \
make_tester_present_msg, rate_limit, structs, ACCELERATION_DUE_TO_GRAVITY, DT_CTRL
from opendbc.car.can_definitions import CanData
from opendbc.car.... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/values.py | opendbc_repo/opendbc/car/toyota/values.py | import re
from collections import defaultdict
from dataclasses import dataclass, field
from enum import Enum, IntFlag
from opendbc.car import Bus, CarSpecs, PlatformConfig, Platforms, AngleSteeringLimits
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.structs import CarParams
from opendbc... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/radar_interface.py | opendbc_repo/opendbc/car/toyota/radar_interface.py | #!/usr/bin/env python3
from opendbc.can import CANParser
from opendbc.car import Bus
from opendbc.car.structs import RadarData
from opendbc.car.toyota.values import DBC, TSS2_CAR
from opendbc.car.interfaces import RadarInterfaceBase
def _create_radar_can_parser(car_fingerprint):
if car_fingerprint in TSS2_CAR:
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/tests/test_toyota.py | opendbc_repo/opendbc/car/toyota/tests/test_toyota.py | from hypothesis import given, settings, strategies as st
from opendbc.car import Bus
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.toyota.fingerprints import FW_VERSIONS
from opendbc.car.toyota.values import CAR, DBC, TSS2_CAR, ANGLE_CONTROL_CAR, RADAR_ACC... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/tests/__init__.py | opendbc_repo/opendbc/car/toyota/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/toyota/tests/print_platform_codes.py | opendbc_repo/opendbc/car/toyota/tests/print_platform_codes.py | #!/usr/bin/env python3
from collections import defaultdict
from opendbc.car.toyota.values import PLATFORM_CODE_ECUS, get_platform_codes
from opendbc.car.toyota.fingerprints import FW_VERSIONS
if __name__ == "__main__":
parts_for_ecu: dict = defaultdict(set)
cars_for_code: dict = defaultdict(lambda: defaultdict(set... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/mock/interface.py | opendbc_repo/opendbc/car/mock/interface.py | #!/usr/bin/env python3
from opendbc.car import structs
from opendbc.car.interfaces import CarInterfaceBase
from opendbc.car.mock.carcontroller import CarController
from opendbc.car.mock.carstate import CarState
# mocked car interface for dashcam mode
class CarInterface(CarInterfaceBase):
CarState = CarState
CarCo... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/mock/__init__.py | opendbc_repo/opendbc/car/mock/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/mock/carstate.py | opendbc_repo/opendbc/car/mock/carstate.py | from opendbc.car import structs
from opendbc.car.interfaces import CarStateBase
class CarState(CarStateBase):
def update(self, *_) -> structs.CarState:
return structs.CarState()
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/mock/carcontroller.py | opendbc_repo/opendbc/car/mock/carcontroller.py | from opendbc.car.interfaces import CarControllerBase
class CarController(CarControllerBase):
def update(self, CC, CS, now_nanos):
return CC.actuators.as_builder(), []
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/mock/values.py | opendbc_repo/opendbc/car/mock/values.py | from opendbc.car import CarSpecs, PlatformConfig, Platforms
class CAR(Platforms):
MOCK = PlatformConfig(
[],
CarSpecs(mass=1700, wheelbase=2.7, steerRatio=13),
{}
)
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_routes.py | opendbc_repo/opendbc/car/tests/test_routes.py | import pytest
from opendbc.car.values import PLATFORMS
from opendbc.car.tests.routes import non_tested_cars, routes
@pytest.mark.parametrize("platform", PLATFORMS.keys())
def test_test_route_present(platform):
tested_platforms = [r.car_model for r in routes]
assert platform in set(tested_platforms) | set(non_tes... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_lateral_limits.py | opendbc_repo/opendbc/car/tests/test_lateral_limits.py | #!/usr/bin/env python3
from collections import defaultdict
import importlib
from parameterized import parameterized_class
import pytest
import sys
from opendbc.car import DT_CTRL
from opendbc.car.car_helpers import interfaces
from opendbc.car.interfaces import get_torque_params
from opendbc.car.values import PLATFORMS... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_car_interfaces.py | opendbc_repo/opendbc/car/tests/test_car_interfaces.py | import os
import math
import hypothesis.strategies as st
import pytest
from hypothesis import Phase, given, settings
from collections.abc import Callable
from typing import Any
from opendbc.car import DT_CTRL, CanData, gen_empty_fingerprint, structs
from opendbc.car.car_helpers import interfaces
from opendbc.car.finge... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_platform_configs.py | opendbc_repo/opendbc/car/tests/test_platform_configs.py | from opendbc.car.values import PLATFORMS
class TestPlatformConfigs:
def test_configs(self, subtests):
for name, platform in PLATFORMS.items():
with subtests.test(platform=str(platform)):
assert platform.config._frozen
if platform != "MOCK":
assert len(platform.config.dbc_dict) ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_fw_fingerprint.py | opendbc_repo/opendbc/car/tests/test_fw_fingerprint.py | import pytest
import random
import time
from collections import defaultdict
from opendbc.car.can_definitions import CanData
from opendbc.car.car_helpers import interfaces
from opendbc.car.structs import CarParams
from opendbc.car.fingerprints import FW_VERSIONS
from opendbc.car.fw_versions import FW_QUERY_CONFIGS, FUZ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_docs.py | opendbc_repo/opendbc/car/tests/test_docs.py | from collections import defaultdict
import pytest
import re
from opendbc.car.car_helpers import interfaces
from opendbc.car.docs import get_all_car_docs
from opendbc.car.docs_definitions import Cable, Column, PartType, Star, SupportType
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.values import P... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_can_fingerprint.py | opendbc_repo/opendbc/car/tests/test_can_fingerprint.py | import pytest
from opendbc.car.can_definitions import CanData
from opendbc.car.car_helpers import FRAME_FINGERPRINT, can_fingerprint
from opendbc.car.fingerprints import _FINGERPRINTS as FINGERPRINTS
class TestCanFingerprint:
@pytest.mark.parametrize("car_model, fingerprints", FINGERPRINTS.items())
def test_can_f... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/__init__.py | opendbc_repo/opendbc/car/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/routes.py | opendbc_repo/opendbc/car/tests/routes.py | from typing import NamedTuple
from opendbc.car.chrysler.values import CAR as CHRYSLER
from opendbc.car.gm.values import CAR as GM
from opendbc.car.ford.values import CAR as FORD
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.hyundai.values import CAR as HYUNDAI
from opendbc.car.nissan.values import... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tests/test_vehicle_model.py | opendbc_repo/opendbc/car/tests/test_vehicle_model.py | import pytest
import math
import numpy as np
from opendbc.car.honda.interface import CarInterface
from opendbc.car.honda.values import CAR
from opendbc.car.vehicle_model import VehicleModel, dyn_ss_sol, create_dyn_state_matrices
class TestVehicleModel:
def setup_method(self):
CP = CarInterface.get_non_essenti... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tesla/fingerprints.py | opendbc_repo/opendbc/car/tesla/fingerprints.py | from opendbc.car.structs import CarParams
from opendbc.car.tesla.values import CAR
Ecu = CarParams.Ecu
FW_VERSIONS = {
CAR.TESLA_MODEL_3: {
(Ecu.eps, 0x730, None): [
b'TeM3_E014p10_0.0.0 (16),E014.17.00',
b'TeM3_E014p10_0.0.0 (16),EL014.17.00',
b'TeM3_ES014p11_0.0.0 (25),ES014.19.0',
b'T... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tesla/teslacan.py | opendbc_repo/opendbc/car/tesla/teslacan.py | from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.tesla.values import CANBUS, CarControllerParams
class TeslaCAN:
def __init__(self, packer):
self.packer = packer
@staticmethod
def checksum(msg_id, dat):
ret = (msg_id & 0xFF) + ((msg_id >> 8) & 0xFF)
ret += sum(dat)
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tesla/interface.py | opendbc_repo/opendbc/car/tesla/interface.py | from opendbc.car import get_safety_config, structs
from opendbc.car.interfaces import CarInterfaceBase
from opendbc.car.tesla.carcontroller import CarController
from opendbc.car.tesla.carstate import CarState
from opendbc.car.tesla.values import TeslaSafetyFlags
class CarInterface(CarInterfaceBase):
CarState = CarS... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tesla/__init__.py | opendbc_repo/opendbc/car/tesla/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tesla/carstate.py | opendbc_repo/opendbc/car/tesla/carstate.py | import copy
from opendbc.can import CANDefine, CANParser
from opendbc.car import Bus, structs
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.interfaces import CarStateBase
from opendbc.car.tesla.values import DBC, CANBUS, GEAR_MAP, STEER_THRESHOLD
ButtonType = structs.CarState.ButtonEven... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tesla/carcontroller.py | opendbc_repo/opendbc/car/tesla/carcontroller.py | import numpy as np
from opendbc.can import CANPacker
from opendbc.car import Bus, apply_std_steer_angle_limits
from opendbc.car.interfaces import CarControllerBase
from opendbc.car.tesla.teslacan import TeslaCAN
from opendbc.car.tesla.values import CarControllerParams
class CarController(CarControllerBase):
def __i... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/tesla/values.py | opendbc_repo/opendbc/car/tesla/values.py | from dataclasses import dataclass, field
from enum import Enum, IntFlag
from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, AngleSteeringLimits
from opendbc.car.structs import CarParams, CarState
from opendbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column
from open... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/fingerprints.py | opendbc_repo/opendbc/car/gm/fingerprints.py | # ruff: noqa: E501
from opendbc.car.gm.values import CAR
# Trailblazer also matches as a SILVERADO, TODO: split with fw versions
# FIXME: There are Equinox users with different message lengths, specifically 304 and 320
FINGERPRINTS = {
CAR.CADILLAC_CT6_ACC: [{
190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 21... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | true |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/interface.py | opendbc_repo/opendbc/car/gm/interface.py | #!/usr/bin/env python3
import json
import os
from cereal import car
from math import fabs, exp
from openpilot.common.params import Params
from opendbc.car import get_safety_config, get_friction, structs
from opendbc.car.common.basedir import BASEDIR
from opendbc.car.common.conversions import Conversions as CV
from open... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/__init__.py | opendbc_repo/opendbc/car/gm/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/carstate.py | opendbc_repo/opendbc/car/gm/carstate.py | import copy
from opendbc.can import CANDefine, CANParser
from cereal import car
from openpilot.common.params import Params #kans
import numpy as np
from opendbc.car import Bus, create_button_events, structs
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.interfaces import CarStateBase
from... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/gmcan.py | opendbc_repo/opendbc/car/gm/gmcan.py | from opendbc.car import DT_CTRL
from opendbc.car.can_definitions import CanData
from opendbc.car.gm.values import CAR, CruiseButtons, CanBus
from opendbc.car.common.conversions import Conversions as CV
# GM: AutoResume: brake signal to CAN
def create_brake_command(packer, bus, apply_brake, idx):
mode = 0xA if apply... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/carcontroller.py | opendbc_repo/opendbc/car/gm/carcontroller.py | from openpilot.common.params import Params
from openpilot.common.filter_simple import FirstOrderFilter
import numpy as np
from opendbc.can.packer import CANPacker
from opendbc.car import Bus, DT_CTRL, apply_driver_steer_torque_limits, structs, create_gas_interceptor_command
from opendbc.car.gm import gmcan
from opendb... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/values.py | opendbc_repo/opendbc/car/gm/values.py | from dataclasses import dataclass, field
from enum import Enum, IntFlag
import numpy as np
from opendbc.car import Bus, PlatformConfig, DbcDict, Platforms, CarSpecs
from opendbc.car.structs import CarParams
from opendbc.car.docs_definitions import CarHarness, CarDocs, CarParts
from opendbc.car.fw_query_definitions imp... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/radar_interface.py | opendbc_repo/opendbc/car/gm/radar_interface.py | #!/usr/bin/env python3
import math
from opendbc.can import CANParser
from opendbc.car import Bus, structs
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.gm.values import DBC, CanBus
from opendbc.car.interfaces import RadarInterfaceBase
RADAR_HEADER_MSG = 1120
SLOT_1_MSG = RADAR_HEADER_MS... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/tests/test_gm.py | opendbc_repo/opendbc/car/gm/tests/test_gm.py | from parameterized import parameterized
from opendbc.car.gm.fingerprints import FINGERPRINTS
from opendbc.car.gm.values import CAMERA_ACC_CAR, GM_RX_OFFSET
CAMERA_DIAGNOSTIC_ADDRESS = 0x24b
class TestGMFingerprint:
@parameterized.expand(FINGERPRINTS.items())
def test_can_fingerprints(self, car_model, fingerprin... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/gm/tests/__init__.py | opendbc_repo/opendbc/car/gm/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/fingerprints.py | opendbc_repo/opendbc/car/rivian/fingerprints.py | from opendbc.car.structs import CarParams
from opendbc.car.rivian.values import CAR
Ecu = CarParams.Ecu
FW_VERSIONS = {
CAR.RIVIAN_R1_GEN1: {
(Ecu.eps, 0x733, None): [
b'R1TS_v3.4.1(51),3.4.1\x00',
],
},
}
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/interface.py | opendbc_repo/opendbc/car/rivian/interface.py | from opendbc.car import get_safety_config, structs
from opendbc.car.interfaces import CarInterfaceBase
from opendbc.car.rivian.carcontroller import CarController
from opendbc.car.rivian.carstate import CarState
from opendbc.car.rivian.radar_interface import RadarInterface
from opendbc.car.rivian.values import RivianSaf... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/riviancan.py | opendbc_repo/opendbc/car/rivian/riviancan.py | def checksum(data, poly, xor_output):
crc = 0
for byte in data:
crc ^= byte
for _ in range(8):
if crc & 0x80:
crc = (crc << 1) ^ poly
else:
crc <<= 1
crc &= 0xFF
return crc ^ xor_output
def create_lka_steering(packer, frame, acm_lka_hba_cmd, apply_torque, enabled, activ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/__init__.py | opendbc_repo/opendbc/car/rivian/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/carstate.py | opendbc_repo/opendbc/car/rivian/carstate.py | import copy
from opendbc.can import CANParser
from opendbc.car import Bus, structs
from opendbc.car.interfaces import CarStateBase
from opendbc.car.rivian.values import DBC, GEAR_MAP
from opendbc.car.common.conversions import Conversions as CV
GearShifter = structs.CarState.GearShifter
class CarState(CarStateBase):
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/carcontroller.py | opendbc_repo/opendbc/car/rivian/carcontroller.py | import numpy as np
from opendbc.can import CANPacker
from opendbc.car import Bus, apply_driver_steer_torque_limits
from opendbc.car.interfaces import CarControllerBase
from opendbc.car.rivian.riviancan import create_lka_steering, create_longitudinal, create_wheel_touch, create_adas_status
from opendbc.car.rivian.values... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/values.py | opendbc_repo/opendbc/car/rivian/values.py | from dataclasses import dataclass, field
from enum import StrEnum, IntFlag
from opendbc.car import Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, structs, uds
from opendbc.car.docs_definitions import CarHarness, CarDocs, CarParts, Device
from opendbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueri... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/radar_interface.py | opendbc_repo/opendbc/car/rivian/radar_interface.py | import math
from opendbc.can import CANParser
from opendbc.car import Bus, structs
from opendbc.car.interfaces import RadarInterfaceBase
from opendbc.car.rivian.values import DBC
RADAR_START_ADDR = 0x500
RADAR_MSG_COUNT = 32
def get_radar_can_parser(CP):
messages = [(f"RADAR_TRACK_{addr:x}", 20) for addr in range(... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/tests/test_rivian.py | opendbc_repo/opendbc/car/rivian/tests/test_rivian.py | from opendbc.car.rivian.fingerprints import FW_VERSIONS
from opendbc.car.rivian.values import CAR, FW_QUERY_CONFIG, WMI, ModelLine, ModelYear
class TestRivian:
def test_custom_fuzzy_fingerprinting(self, subtests):
for platform in CAR:
with subtests.test(platform=platform.name):
for wmi in WMI:
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/rivian/tests/__init__.py | opendbc_repo/opendbc/car/rivian/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/common/simple_kalman.py | opendbc_repo/opendbc/car/common/simple_kalman.py | import numpy as np
def get_kalman_gain(dt, A, C, Q, R, iterations=100):
P = np.zeros_like(Q)
for _ in range(iterations):
P = A.dot(P).dot(A.T) + dt * Q
S = C.dot(P).dot(C.T) + R
K = P.dot(C.T).dot(np.linalg.inv(S))
P = (np.eye(len(P)) - K.dot(C)).dot(P)
return K
class KF1D:
# this EKF assume... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/common/pid.py | opendbc_repo/opendbc/car/common/pid.py | import numpy as np
from numbers import Number
class PIDController:
def __init__(self, k_p, k_i, k_f=0., k_d=0., pos_limit=1e308, neg_limit=-1e308, rate=100):
self._k_p = k_p
self._k_i = k_i
self._k_d = k_d
self.k_f = k_f # feedforward gain
if isinstance(self._k_p, Number):
self._k_p = [[0... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/opendbc_repo/opendbc/car/common/basedir.py | opendbc_repo/opendbc/car/common/basedir.py | import os
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
| python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.