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/system/hardware/tici/amplifier.py
system/hardware/tici/amplifier.py
#!/usr/bin/env python3 import time from smbus2 import SMBus from collections import namedtuple # https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf AmpConfig = namedtuple('AmpConfig', ['name', 'value', 'register', 'offset', 'mask']) EQParams = namedtuple('EQParams', ['K', 'k1', 'k2', 'c1', 'c2']) def configs_...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/esim.py
system/hardware/tici/esim.py
import json import os import shutil import subprocess from typing import Literal from openpilot.system.hardware.base import LPABase, LPAError, LPAProfileNotFoundError, Profile class TiciLPA(LPABase): def __init__(self, interface: Literal['qmi', 'at'] = 'qmi'): self.env = os.environ.copy() self.env['LPAC_APD...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/power_monitor.py
system/hardware/tici/power_monitor.py
#!/usr/bin/env python3 import sys import time import datetime import numpy as np from collections import deque from openpilot.common.realtime import Ratekeeper from openpilot.common.filter_simple import FirstOrderFilter def read_power(): with open("/sys/bus/i2c/devices/0-0040/hwmon/hwmon1/power1_input") as f: ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/pins.py
system/hardware/tici/pins.py
# TODO: these are also defined in a header # GPIO pin definitions class GPIO: # both GPIO_STM_RST_N and GPIO_LTE_RST_N are misnamed, they are high to reset HUB_RST_N = 30 UBLOX_RST_N = 32 UBLOX_SAFEBOOT_N = 33 GNSS_PWR_EN = 34 # SCHEMATIC LABEL: GPIO_UBLOX_PWR_EN STM_RST_N = 124 STM_BOOT0 = 134 STM_PW...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/hardware.py
system/hardware/tici/hardware.py
import json import math import os import subprocess import time import tempfile from enum import IntEnum from functools import cached_property, lru_cache from pathlib import Path from cereal import log from openpilot.common.util import sudo_read, sudo_write from openpilot.common.gpio import gpio_set, gpio_init, get_ir...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/__init__.py
system/hardware/tici/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/iwlist.py
system/hardware/tici/iwlist.py
import subprocess def scan(interface="wlan0"): result = [] try: r = subprocess.check_output(["iwlist", interface, "scan"], encoding='utf8') mac = None for line in r.split('\n'): if "Address" in line: # Based on the adapter eithere a percentage or dBm is returned # Add previous n...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/agnos.py
system/hardware/tici/agnos.py
#!/usr/bin/env python3 import hashlib import json import lzma import os import struct import subprocess import time from collections.abc import Generator import requests import openpilot.system.updated.casync.casync as casync SPARSE_CHUNK_FMT = struct.Struct('H2xI4x') CAIBX_URL = "https://commadist.azureedge.net/agn...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/precise_power_measure.py
system/hardware/tici/precise_power_measure.py
#!/usr/bin/env python3 import numpy as np from openpilot.system.hardware.tici.power_monitor import sample_power if __name__ == '__main__': print("measuring for 5 seconds") for _ in range(3): pwrs = sample_power() print(f"mean {np.mean(pwrs):.2f} std {np.std(pwrs):.2f}")
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/tests/test_amplifier.py
system/hardware/tici/tests/test_amplifier.py
import pytest import time import random import subprocess from panda import Panda from openpilot.system.hardware import TICI, HARDWARE from openpilot.system.hardware.tici.hardware import Tici from openpilot.system.hardware.tici.amplifier import Amplifier class TestAmplifier: @classmethod def setup_class(cls): ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/tests/test_agnos_updater.py
system/hardware/tici/tests/test_agnos_updater.py
import json import os import requests TEST_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__))) MANIFEST = os.path.join(TEST_DIR, "../agnos.json") class TestAgnosUpdater: def test_manifest(self): with open(MANIFEST) as f: m = json.load(f) for img in m: r = requests.head(img['url'], ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/tests/compare_casync_manifest.py
system/hardware/tici/tests/compare_casync_manifest.py
#!/usr/bin/env python3 import argparse import collections import multiprocessing import os import requests from tqdm import tqdm import openpilot.system.hardware.tici.casync as casync def get_chunk_download_size(chunk): sha = chunk.sha.hex() path = os.path.join(remote_url, sha[:4], sha + ".cacnk") if os.path....
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/tests/__init__.py
system/hardware/tici/tests/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tici/tests/test_power_draw.py
system/hardware/tici/tests/test_power_draw.py
from collections import defaultdict, deque import pytest import time import numpy as np from dataclasses import dataclass from tabulate import tabulate import cereal.messaging as messaging from cereal.services import SERVICE_LIST from opendbc.car.car_helpers import get_demo_car_params from openpilot.common.mock import...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tests/test_fan_controller.py
system/hardware/tests/test_fan_controller.py
import pytest from openpilot.system.hardware.fan_controller import TiciFanController ALL_CONTROLLERS = [TiciFanController] def patched_controller(mocker, controller_class): mocker.patch("os.system", new=mocker.Mock()) return controller_class() class TestFanController: def wind_up(self, controller, ignition=Tr...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tests/test_power_monitoring.py
system/hardware/tests/test_power_monitoring.py
import pytest from openpilot.common.params import Params from openpilot.system.hardware.power_monitoring import PowerMonitoring, CAR_BATTERY_CAPACITY_uWh, \ CAR_CHARGING_RATE_W, VBATT_PAUSE_CHARGING, DELAY_SHUTDOWN_TIME_S # Create fake time ssb = 0. def mock_time_monoto...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/tests/__init__.py
system/hardware/tests/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/pc/hardware.py
system/hardware/pc/hardware.py
import random from cereal import log from openpilot.system.hardware.base import HardwareBase, LPABase NetworkType = log.DeviceState.NetworkType NetworkStrength = log.DeviceState.NetworkStrength class Pc(HardwareBase): def get_os_version(self): return None def get_device_type(self): return "pc" def re...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/hardware/pc/__init__.py
system/hardware/pc/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/process_config.py
system/manager/process_config.py
import os import operator import importlib.util from cereal import car from openpilot.common.params import Params from openpilot.system.hardware import PC, TICI from openpilot.system.manager.process import PythonProcess, NativeProcess, DaemonProcess FLASK_AVAILABLE = importlib.util.find_spec("flask") is not None WEB...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/build.py
system/manager/build.py
#!/usr/bin/env python3 import os import subprocess from pathlib import Path # NOTE: Do NOT import anything here that needs be built (e.g. params) from openpilot.common.basedir import BASEDIR from openpilot.common.spinner import Spinner from openpilot.common.text_window import TextWindow from openpilot.system.hardware ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/helpers.py
system/manager/helpers.py
import errno import fcntl import os import sys import pathlib import shutil import signal import subprocess import tempfile import threading from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params def unblock_stdout() -> None: # get a non-blocking stdout child_pid, child_pty = os.f...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/__init__.py
system/manager/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/manager.py
system/manager/manager.py
#!/usr/bin/env python3 import datetime import os import signal import sys import traceback from cereal import log import cereal.messaging as messaging import openpilot.system.sentry as sentry from openpilot.common.params import Params, ParamKeyType from openpilot.common.text_window import TextWindow from openpilot.sys...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/process.py
system/manager/process.py
import importlib import os import signal import struct import time import subprocess from collections.abc import Callable, ValuesView from abc import ABC, abstractmethod from multiprocessing import Process from setproctitle import setproctitle from cereal import car, log import cereal.messaging as messaging import op...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/test/test_manager.py
system/manager/test/test_manager.py
import os import pytest import signal import time from cereal import car from openpilot.common.params import Params import openpilot.system.manager.manager as manager from openpilot.system.manager.process import ensure_running from openpilot.system.manager.process_config import managed_processes, procs from openpilot....
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/manager/test/__init__.py
system/manager/test/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/deleter.py
system/loggerd/deleter.py
#!/usr/bin/env python3 import os import shutil import threading from openpilot.system.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.system.loggerd.config import get_available_bytes, get_available_percent from openpilot.system.loggerd.uploader import listdir_by_creation from openp...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/uploader.py
system/loggerd/uploader.py
#!/usr/bin/env python3 import json import os import random import requests import threading import time import traceback import datetime from collections.abc import Iterator from cereal import log import cereal.messaging as messaging from openpilot.common.api import Api from openpilot.common.file_helpers import get_up...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/xattr_cache.py
system/loggerd/xattr_cache.py
import errno import xattr _cached_attributes: dict[tuple, bytes | None] = {} def getxattr(path: str, attr_name: str) -> bytes | None: key = (path, attr_name) if key not in _cached_attributes: try: response = xattr.getxattr(path, attr_name) except OSError as e: # ENODATA (Linux) or ENOATTR (ma...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/config.py
system/loggerd/config.py
import os from openpilot.system.hardware.hw import Paths CAMERA_FPS = 20 SEGMENT_LENGTH = 60 STATS_DIR_FILE_LIMIT = 10000 STATS_SOCKET = "ipc:///tmp/stats" STATS_FLUSH_TIME_S = 60 def get_available_percent(default: float) -> float: try: statvfs = os.statvfs(Paths.log_root()) available_percent = 100.0 * st...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/__init__.py
system/loggerd/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/tests/test_encoder.py
system/loggerd/tests/test_encoder.py
import math import os import pytest import random import shutil import subprocess import time from pathlib import Path from parameterized import parameterized from tqdm import trange from openpilot.common.params import Params from openpilot.common.timeout import Timeout from openpilot.system.hardware import TICI from...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/tests/loggerd_tests_common.py
system/loggerd/tests/loggerd_tests_common.py
import os import random from pathlib import Path import openpilot.system.loggerd.deleter as deleter import openpilot.system.loggerd.uploader as uploader from openpilot.common.params import Params from openpilot.system.hardware.hw import Paths from openpilot.system.loggerd.xattr_cache import setxattr def create_rand...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/tests/__init__.py
system/loggerd/tests/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/tests/test_deleter.py
system/loggerd/tests/test_deleter.py
import time import threading from collections import namedtuple from pathlib import Path from collections.abc import Sequence import openpilot.system.loggerd.deleter as deleter from openpilot.common.timeout import Timeout, TimeoutException from openpilot.system.loggerd.tests.loggerd_tests_common import UploaderTestCas...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/tests/test_loggerd.py
system/loggerd/tests/test_loggerd.py
import numpy as np import os import re import random import string import subprocess import time from collections import defaultdict from pathlib import Path import pytest import cereal.messaging as messaging from cereal import log from cereal.services import SERVICE_LIST from openpilot.common.basedir import BASEDIR f...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/loggerd/tests/test_uploader.py
system/loggerd/tests/test_uploader.py
import os import time import threading import logging import json from pathlib import Path from openpilot.system.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.system.loggerd.uploader import main, UPLOAD_ATTR_NAME, UPLOAD_ATTR_VALUE from openpilot.system.loggerd.tests.loggerd_te...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/sensord.py
system/sensord/sensord.py
#!/usr/bin/env python3 import os import time import ctypes import select import threading import cereal.messaging as messaging from cereal.services import SERVICE_LIST from openpilot.common.util import sudo_write from openpilot.common.realtime import config_realtime_process, Ratekeeper from openpilot.common.swaglog im...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/__init__.py
system/sensord/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/tests/test_sensord.py
system/sensord/tests/test_sensord.py
import os import pytest import time import numpy as np from collections import namedtuple, defaultdict import cereal.messaging as messaging from cereal import log from cereal.services import SERVICE_LIST from openpilot.common.gpio import get_irqs_for_action from openpilot.common.timeout import Timeout from openpilot.s...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/tests/__init__.py
system/sensord/tests/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/tests/ttff_test.py
system/sensord/tests/ttff_test.py
#!/usr/bin/env python3 import time import atexit from cereal import messaging from openpilot.system.manager.process_config import managed_processes TIMEOUT = 10*60 def kill(): for proc in ['ubloxd', 'pigeond']: managed_processes[proc].stop(retry=True, block=True) if __name__ == "__main__": # start ubloxd ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/sensors/mmc5603nj_magn.py
system/sensord/sensors/mmc5603nj_magn.py
import time from cereal import log from openpilot.system.sensord.sensors.i2c_sensor import Sensor # https://www.mouser.com/datasheet/2/821/Memsic_09102019_Datasheet_Rev.B-1635324.pdf # Register addresses REG_ODR = 0x1A REG_INTERNAL_0 = 0x1B REG_INTERNAL_1 = 0x1C # Control register settings CMM_FREQ_EN = (1 << 7) AU...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/sensors/i2c_sensor.py
system/sensord/sensors/i2c_sensor.py
import time import smbus2 import ctypes from collections.abc import Iterable from cereal import log class Sensor: class SensorException(Exception): pass class DataNotReady(SensorException): pass def __init__(self, bus: int) -> None: self.bus = smbus2.SMBus(bus) self.source = log.SensorEventDat...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/sensors/lsm6ds3_accel.py
system/sensord/sensors/lsm6ds3_accel.py
import os import time from cereal import log from openpilot.system.sensord.sensors.i2c_sensor import Sensor class LSM6DS3_Accel(Sensor): LSM6DS3_ACCEL_I2C_REG_DRDY_CFG = 0x0B LSM6DS3_ACCEL_I2C_REG_INT1_CTRL = 0x0D LSM6DS3_ACCEL_I2C_REG_CTRL1_XL = 0x10 LSM6DS3_ACCEL_I2C_REG_CTRL3_C = 0x12 LSM6DS3_ACCEL_I...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/sensors/lsm6ds3_gyro.py
system/sensord/sensors/lsm6ds3_gyro.py
import os import math import time from cereal import log from openpilot.system.sensord.sensors.i2c_sensor import Sensor class LSM6DS3_Gyro(Sensor): LSM6DS3_GYRO_I2C_REG_DRDY_CFG = 0x0B LSM6DS3_GYRO_I2C_REG_INT1_CTRL = 0x0D LSM6DS3_GYRO_I2C_REG_CTRL2_G = 0x11 LSM6DS3_GYRO_I2C_REG_CTRL5_C = 0x14 LSM6DS3_...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/sensors/__init__.py
system/sensord/sensors/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/sensord/sensors/lsm6ds3_temp.py
system/sensord/sensors/lsm6ds3_temp.py
import time from cereal import log from openpilot.system.sensord.sensors.i2c_sensor import Sensor # https://content.arduino.cc/assets/st_imu_lsm6ds3_datasheet.pdf class LSM6DS3_Temp(Sensor): @property def device_address(self) -> int: return 0x6A def _read_temperature(self) -> float: scale = 16.0 if sel...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/qcomgpsd/structs.py
system/qcomgpsd/structs.py
from struct import unpack_from, calcsize LOG_GNSS_POSITION_REPORT = 0x1476 LOG_GNSS_GPS_MEASUREMENT_REPORT = 0x1477 LOG_GNSS_CLOCK_REPORT = 0x1478 LOG_GNSS_GLONASS_MEASUREMENT_REPORT = 0x1480 LOG_GNSS_BDS_MEASUREMENT_REPORT = 0x1756 LOG_GNSS_GAL_MEASUREMENT_REPORT = 0x1886 LOG_GNSS_OEMDRE_MEASUREMENT_REPORT = 0x14DE ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/qcomgpsd/modemdiag.py
system/qcomgpsd/modemdiag.py
import select from serial import Serial from crcmod import mkCrcFun from struct import pack, unpack_from, calcsize class ModemDiag: def __init__(self): self.serial = self.open_serial() self.pend = b'' def open_serial(self): serial = Serial("/dev/ttyUSB0", baudrate=115200, rtscts=True, dsrdtr=True, tim...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/qcomgpsd/nmeaport.py
system/qcomgpsd/nmeaport.py
import os import sys from dataclasses import dataclass, fields from subprocess import check_output, CalledProcessError from time import sleep from typing import NoReturn DEBUG = int(os.environ.get("DEBUG", "0")) @dataclass class GnssClockNmeaPort: # flags bit mask: # 0x01 = leap_seconds valid # 0x02 = time_unce...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/qcomgpsd/qcomgpsd.py
system/qcomgpsd/qcomgpsd.py
#!/usr/bin/env python3 import os import sys import signal import itertools import math import time import requests import shutil import subprocess import datetime from multiprocessing import Process, Event from typing import NoReturn from struct import unpack_from, calcsize, pack from cereal import log import cereal.m...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/qcomgpsd/tests/test_qcomgpsd.py
system/qcomgpsd/tests/test_qcomgpsd.py
import os import pytest import json import time import datetime import subprocess import cereal.messaging as messaging from openpilot.system.qcomgpsd.qcomgpsd import at_cmd, wait_for_modem from openpilot.system.manager.process_config import managed_processes GOOD_SIGNAL = bool(int(os.getenv("GOOD_SIGNAL", '0'))) @p...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ubloxd/ubloxd.py
system/ubloxd/ubloxd.py
#!/usr/bin/env python3 import math import capnp import calendar import numpy as np from collections import defaultdict from dataclasses import dataclass from cereal import log from cereal import messaging from openpilot.system.ubloxd.generated.ubx import Ubx from openpilot.system.ubloxd.generated.gps import Gps from o...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ubloxd/pigeond.py
system/ubloxd/pigeond.py
#!/usr/bin/env python3 import sys import time import signal import serial import struct import requests import urllib.parse from datetime import datetime, UTC from cereal import messaging from openpilot.common.time_helpers import system_time_valid from openpilot.common.params import Params from openpilot.common.swaglo...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ubloxd/tests/test_pigeond.py
system/ubloxd/tests/test_pigeond.py
import pytest import time import cereal.messaging as messaging from cereal.services import SERVICE_LIST from openpilot.common.gpio import gpio_read from openpilot.selfdrive.test.helpers import with_processes from openpilot.system.manager.process_config import managed_processes from openpilot.system.hardware.tici.pins ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ubloxd/generated/ubx.py
system/ubloxd/generated/ubx.py
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild import kaitaistruct from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO from enum import Enum if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): raise Exception("Incompatible Kaitai Struct Python AP...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ubloxd/generated/glonass.py
system/ubloxd/generated/glonass.py
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild import kaitaistruct from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is req...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ubloxd/generated/gps.py
system/ubloxd/generated/gps.py
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild import kaitaistruct from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO if getattr(kaitaistruct, 'API_VERSION', (0, 9)) < (0, 9): raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is req...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/camerad/__init__.py
system/camerad/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/camerad/test/check_skips.py
system/camerad/test/check_skips.py
#!/usr/bin/env python3 # type: ignore import cereal.messaging as messaging all_sockets = ['roadCameraState', 'driverCameraState', 'wideRoadCameraState'] prev_id = [None,None,None] this_id = [None,None,None] dt = [None,None,None] num_skipped = [0,0,0] if __name__ == "__main__": sm = messaging.SubMaster(all_sockets) ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/camerad/test/get_thumbnails_for_segment.py
system/camerad/test/get_thumbnails_for_segment.py
#!/usr/bin/env python3 import argparse import os from tqdm import tqdm from openpilot.tools.lib.logreader import LogReader if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("route", help="The route name") args = parser.parse_args() out_path = os.path.join("jpegs", f"{args.rout...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/camerad/test/test_camerad.py
system/camerad/test/test_camerad.py
import os import time import pytest import numpy as np import cereal.messaging as messaging from cereal.services import SERVICE_LIST from openpilot.system.manager.process_config import managed_processes from openpilot.tools.lib.log_time_series import msgs_to_time_series TEST_TIMESPAN = 10 CAMERAS = ('roadCameraState'...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/camerad/test/test_exposure.py
system/camerad/test/test_exposure.py
import time import numpy as np import pytest from openpilot.selfdrive.test.helpers import with_processes from openpilot.system.camerad.snapshot.snapshot import get_snapshots TEST_TIME = 45 REPEAT = 5 @pytest.mark.tici class TestCamerad: @classmethod def setup_class(cls): pass def _numpy_rgb2gray(self, im)...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/camerad/snapshot/snapshot.py
system/camerad/snapshot/snapshot.py
#!/usr/bin/env python3 import subprocess import time import numpy as np from PIL import Image import cereal.messaging as messaging from msgq.visionipc import VisionIpcClient, VisionStreamType from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL from openpilot.system.hardware import ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/camerad/snapshot/__init__.py
system/camerad/snapshot/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/webrtc/schema.py
system/webrtc/schema.py
import capnp from typing import Any def generate_type(type_walker, schema_walker) -> str | list[Any] | dict[str, Any]: data_type = next(type_walker) if data_type.which() == 'struct': return generate_struct(next(schema_walker)) elif data_type.which() == 'list': _ = next(schema_walker) return [generat...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/webrtc/__init__.py
system/webrtc/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/webrtc/webrtcd.py
system/webrtc/webrtcd.py
#!/usr/bin/env python3 import argparse import asyncio import json import uuid import logging from dataclasses import dataclass, field from typing import Any, TYPE_CHECKING # aiortc and its dependencies have lots of internal warnings :( import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) war...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/webrtc/device/audio.py
system/webrtc/device/audio.py
import asyncio import io import aiortc import av import numpy as np import pyaudio class AudioInputStreamTrack(aiortc.mediastreams.AudioStreamTrack): PYAUDIO_TO_AV_FORMAT_MAP = { pyaudio.paUInt8: 'u8', pyaudio.paInt16: 's16', pyaudio.paInt24: 's24', pyaudio.paInt32: 's32', pyaudio.paF...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/webrtc/device/video.py
system/webrtc/device/video.py
import asyncio import av from teleoprtc.tracks import TiciVideoStreamTrack from cereal import messaging from openpilot.common.realtime import DT_MDL, DT_DMON class LiveStreamVideoStreamTrack(TiciVideoStreamTrack): camera_to_sock_mapping = { "driver": "livestreamDriverEncodeData", "wideRoad": "livestreamWi...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/webrtc/tests/test_stream_session.py
system/webrtc/tests/test_stream_session.py
import asyncio import json # for aiortc and its dependencies import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.filterwarnings("ignore", category=RuntimeWarning) # TODO: remove this when google-crc32c publish a python3.12 wheel from aiortc import RTCDataChannel from aiortc.mediastr...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/webrtc/tests/test_webrtcd.py
system/webrtc/tests/test_webrtcd.py
import pytest import asyncio import json # for aiortc and its dependencies import warnings warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.filterwarnings("ignore", category=RuntimeWarning) # TODO: remove this when google-crc32c publish a python3.12 wheel from openpilot.system.webrtc.webrtcd imp...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/common.py
system/updated/common.py
import os import pathlib def get_consistent_flag(path: str) -> bool: consistent_file = pathlib.Path(os.path.join(path, ".overlay_consistent")) return consistent_file.is_file() def set_consistent_flag(path: str, consistent: bool) -> None: os.sync() consistent_file = pathlib.Path(os.path.join(path, ".overlay_c...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/updated.py
system/updated/updated.py
#!/usr/bin/env python3 import os import re import datetime import subprocess import psutil import shutil import signal import fcntl import time import threading from collections import defaultdict from pathlib import Path from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params from open...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/casync/common.py
system/updated/casync/common.py
import dataclasses import json import pathlib import subprocess from openpilot.system.version import BUILD_METADATA_FILENAME, BuildMetadata from openpilot.system.updated.casync import tar CASYNC_ARGS = ["--with=symlinks", "--with=permissions", "--compression=xz", "--chunk-size=16M"] CASYNC_FILES = [BUILD_METADATA_FI...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/casync/casync.py
system/updated/casync/casync.py
#!/usr/bin/env python3 import io import lzma import os import pathlib import struct import sys import time from abc import ABC, abstractmethod from collections import defaultdict, namedtuple from collections.abc import Callable from typing import IO import requests from Crypto.Hash import SHA512 from openpilot.system....
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/casync/tar.py
system/updated/casync/tar.py
import pathlib import tarfile from typing import IO from collections.abc import Callable def include_default(_) -> bool: return True def create_tar_archive(filename: pathlib.Path, directory: pathlib.Path, include: Callable[[pathlib.Path], bool] = include_default): """Creates a tar archive of a directory""" w...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/casync/tests/test_casync.py
system/updated/casync/tests/test_casync.py
import pytest import os import pathlib import tempfile import subprocess from openpilot.system.updated.casync import casync from openpilot.system.updated.casync import tar # dd if=/dev/zero of=/tmp/img.raw bs=1M count=2 # sudo losetup -f /tmp/img.raw # losetup -a | grep img.raw LOOPBACK = os.environ.get('LOOPBACK', N...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/tests/test_base.py
system/updated/tests/test_base.py
import os import pathlib import shutil import signal import stat import subprocess import tempfile import time import pytest from openpilot.common.params import Params from openpilot.system.manager.process import ManagerProcess from openpilot.selfdrive.test.helpers import processes_context def get_consistent_flag(pa...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/updated/tests/test_git.py
system/updated/tests/test_git.py
import contextlib from openpilot.system.updated.tests.test_base import ParamsBaseUpdateTest, run, update_release class TestUpdateDGitStrategy(ParamsBaseUpdateTest): def update_remote_release(self, release): update_release(self.remote_dir, release, *self.MOCK_RELEASES[release]) run(["git", "add", "."], cwd=s...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/spinner.py
system/ui/spinner.py
#!/usr/bin/env python3 import pyray as rl import os import threading from openpilot.common.basedir import BASEDIR from openpilot.system.ui.lib.application import gui_app # Constants PROGRESS_BAR_WIDTH = 1000 PROGRESS_BAR_HEIGHT = 20 DEGREES_PER_SECOND = 360.0 # one full rotation per second MARGIN = 200 TEXTURE_SIZE ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/reset.py
system/ui/reset.py
#!/usr/bin/env python3 import os import pyray as rl import sys import threading from enum import IntEnum from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.button import gui_button, ButtonStyle from openpilot.system.ui.lib.label import gui_label, gui_text_box NVME = "/dev...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/text.py
system/ui/text.py
#!/usr/bin/env python3 import re import pyray as rl from openpilot.system.hardware import HARDWARE from openpilot.system.ui.lib.button import gui_button, ButtonStyle from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui.lib.application import gui_app MARGIN = 50 SPACING = 50 FONT_SIZ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/updater.py
system/ui/updater.py
#!/usr/bin/env python3 import sys import subprocess import threading import pyray as rl from enum import IntEnum from openpilot.system.hardware import HARDWARE from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.button import gui_button, ButtonStyle from openpilot.system.ui...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/widgets/confirm_dialog.py
system/ui/widgets/confirm_dialog.py
import pyray as rl from openpilot.system.ui.lib.button import gui_button, ButtonStyle from openpilot.system.ui.lib.label import gui_text_box # Constants for dialog dimensions and styling DIALOG_WIDTH = 1520 DIALOG_HEIGHT = 600 BUTTON_HEIGHT = 160 MARGIN = 50 TEXT_AREA_HEIGHT_REDUCTION = 200 BACKGROUND_COLOR = rl.Color...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/widgets/keyboard.py
system/ui/widgets/keyboard.py
import pyray as rl from openpilot.system.ui.lib.button import gui_button from openpilot.system.ui.lib.label import gui_label # Constants for special keys BACKSPACE_KEY = "<-" ENTER_KEY = "Enter" SPACE_KEY = " " SHIFT_KEY = "↑" SHIFT_DOWN_KEY = "↓" NUMERIC_KEY = "123" SYMBOL_KEY = "#+=" ABC_KEY = "ABC" # Define keybo...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/lib/application.py
system/ui/lib/application.py
import atexit import os import time import pyray as rl from enum import IntEnum from openpilot.common.basedir import BASEDIR from openpilot.common.swaglog import cloudlog DEFAULT_FPS = 60 FPS_LOG_INTERVAL = 5 # Seconds between logging FPS drops FPS_DROP_THRESHOLD = 0.9 # FPS drop threshold for triggering a warning F...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/lib/label.py
system/ui/lib/label.py
import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight, DEFAULT_TEXT_SIZE, DEFAULT_TEXT_COLOR from openpilot.system.ui.lib.utils import GuiStyleContext def gui_label( rect: rl.Rectangle, text: str, font_size: int = DEFAULT_TEXT_SIZE, color: rl.Color = DEFAULT_TEXT_COLOR, font...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/lib/scroll_panel.py
system/ui/lib/scroll_panel.py
import pyray as rl from enum import IntEnum MOUSE_WHEEL_SCROLL_SPEED = 30 INERTIA_FRICTION = 0.95 # The rate at which the inertia slows down MIN_VELOCITY = 0.1 # Minimum velocity before stopping the inertia class ScrollState(IntEnum): IDLE = 0 DRAGGING_CONTENT = 1 DRAGGING_SCROLLBAR = 2 class GuiScrollPane...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/lib/utils.py
system/ui/lib/utils.py
import pyray as rl class GuiStyleContext: def __init__(self, styles: list[tuple[int, int, int]]): """styles is a list of tuples (control, prop, new_value)""" self.styles = styles self.prev_styles: list[tuple[int, int, int]] = [] def __enter__(self): for control, prop, new_value in self.styles: ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/lib/__init__.py
system/ui/lib/__init__.py
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/system/ui/lib/button.py
system/ui/lib/button.py
import pyray as rl from enum import IntEnum from openpilot.system.ui.lib.application import gui_app, FontWeight class ButtonStyle(IntEnum): NORMAL = 0 # Most common, neutral buttons PRIMARY = 1 # For main actions DANGER = 2 # For critical actions, like reboot or delete TRANSPARENT = 3 # For buttons with t...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/teleoprtc_repo/teleoprtc/stream.py
teleoprtc_repo/teleoprtc/stream.py
import abc import asyncio import dataclasses import logging from typing import Any, Awaitable, Callable, Dict, List, Optional import aiortc from aiortc.contrib.media import MediaRelay from teleoprtc.tracks import parse_video_track_id @dataclasses.dataclass class StreamingOffer: sdp: str video: List[str] Conne...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/teleoprtc_repo/teleoprtc/tracks.py
teleoprtc_repo/teleoprtc/tracks.py
import asyncio import logging import time import fractions from typing import Any, Optional, Tuple import aiortc from aiortc.mediastreams import VIDEO_CLOCK_RATE, VIDEO_TIME_BASE def video_track_id(camera_type: str, track_id: str) -> str: return f"{camera_type}:{track_id}" def parse_video_track_id(track_id: str)...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/teleoprtc_repo/teleoprtc/__init__.py
teleoprtc_repo/teleoprtc/__init__.py
from teleoprtc.builder import WebRTCOfferBuilder, WebRTCAnswerBuilder # noqa from teleoprtc.stream import WebRTCBaseStream, StreamingOffer, ConnectionProvider, MessageHandler # noqa
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/teleoprtc_repo/teleoprtc/info.py
teleoprtc_repo/teleoprtc/info.py
import dataclasses import aiortc @dataclasses.dataclass class StreamingMediaInfo: n_expected_camera_tracks: int expected_audio_track: bool incoming_audio_track: bool incoming_datachannel: bool def parse_info_from_offer(sdp: str) -> StreamingMediaInfo: """ helper function to parse info about outgoing an...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/teleoprtc_repo/teleoprtc/builder.py
teleoprtc_repo/teleoprtc/builder.py
import abc from typing import Dict, List import aiortc from teleoprtc.stream import WebRTCBaseStream, WebRTCOfferStream, WebRTCAnswerStream, ConnectionProvider from teleoprtc.tracks import TiciVideoStreamTrack, TiciTrackWrapper class WebRTCStreamBuilder(abc.ABC): @abc.abstractmethod def stream(self) -> WebRTCBa...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false
ajouatom/openpilot
https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/teleoprtc_repo/tests/test_stream.py
teleoprtc_repo/tests/test_stream.py
#!/usr/bin/env python3 import pytest import aiortc from aiortc.mediastreams import AudioStreamTrack from teleoprtc.builder import WebRTCOfferBuilder, WebRTCAnswerBuilder from teleoprtc.info import parse_info_from_offer from teleoprtc.tracks import TiciVideoStreamTrack class OfferCapture: def __init__(self): ...
python
MIT
b0eab6e8de2d57522b657426fbb794f2d736c75c
2026-01-05T07:04:53.428285Z
false