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
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/sensord/tests/__init__.py
system/sensord/tests/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/sensord/sensors/__init__.py
system/sensord/sensors/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/camerad/snapshot.py
system/camerad/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/camerad/__init__.py
system/camerad/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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 import get_snapshots TEST_TIME = 45 REPEAT = 5 @pytest.mark.tici class TestCamerad: @classmethod def setup_class(cls): pass def _numpy_rgb2gray(self, im): ret...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/webrtc/__init__.py
system/webrtc/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/webrtc/device/video.py
system/webrtc/device/video.py
import asyncio import time 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": "...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/webrtc/tests/test_stream_session.py
system/webrtc/tests/test_stream_session.py
import asyncio import json import time # 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 aio...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/mici_reset.py
system/ui/mici_reset.py
#!/usr/bin/env python3 import os import sys import threading import time from enum import IntEnum import pyray as rl from openpilot.system.hardware import PC from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.slider impor...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/spinner.py
system/ui/spinner.py
#!/usr/bin/env python3 import pyray as rl import select import sys from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.text import wrap_text from openpilot.system.ui.widgets import Widget # Constants if gui_app.big_ui():...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/mici_updater.py
system/ui/mici_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.text_measure import measure_text_cached from openpilot.system....
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/reset.py
system/ui/reset.py
#!/usr/bin/env python3 from openpilot.system.ui.lib.application import gui_app import openpilot.system.ui.tici_reset as tici_reset import openpilot.system.ui.mici_reset as mici_reset def main(): if gui_app.big_ui(): tici_reset.main() else: mici_reset.main() if __name__ == "__main__": main()
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/setup.py
system/ui/setup.py
#!/usr/bin/env python3 from openpilot.system.ui.lib.application import gui_app import openpilot.system.ui.tici_setup as tici_setup import openpilot.system.ui.mici_setup as mici_setup def main(): if gui_app.big_ui(): tici_setup.main() else: mici_setup.main() if __name__ == "__main__": main()
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/tici_setup.py
system/ui/tici_setup.py
#!/usr/bin/env python3 import os import re import threading import time import urllib.request import urllib.error from urllib.parse import urlparse from enum import IntEnum import shutil import pyray as rl from cereal import log from openpilot.common.utils import run_cmd from openpilot.system.hardware import HARDWARE...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/tici_updater.py
system/ui/tici_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, FONT_SCALE from openpilot.system.ui.lib.wifi_manager import WifiManager from openpilot.sys...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/tici_reset.py
system/ui/tici_reset.py
#!/usr/bin/env python3 import os import sys import threading import time from enum import IntEnum import pyray as rl from openpilot.system.hardware import PC from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets....
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/text.py
system/ui/text.py
#!/usr/bin/env python3 import re import sys import pyray as rl from openpilot.system.hardware import HARDWARE, PC from openpilot.system.ui.lib.application import BIG_UI, gui_app from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui.lib.text_measure import measure_text_cached from open...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/mici_setup.py
system/ui/mici_setup.py
#!/usr/bin/env python3 from abc import abstractmethod import os import re import threading import time import urllib.request import urllib.error from urllib.parse import urlparse from enum import IntEnum import shutil from collections.abc import Callable import pyray as rl from cereal import log from openpilot.common...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/updater.py
system/ui/updater.py
#!/usr/bin/env python3 from openpilot.system.ui.lib.application import gui_app import openpilot.system.ui.tici_updater as tici_updater import openpilot.system.ui.mici_updater as mici_updater def main(): if gui_app.big_ui(): tici_updater.main() else: mici_updater.main() if __name__ == "__main__": main(...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/inputbox.py
system/ui/widgets/inputbox.py
import pyray as rl import time from openpilot.system.ui.lib.application import gui_app, MousePos, FONT_SCALE from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.widgets import Widget PASSWORD_MASK_CHAR = "•" PASSWORD_MASK_DELAY = 1.5 # Seconds to show character before masking...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/scroller_tici.py
system/ui/widgets/scroller_tici.py
import pyray as rl from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui.widgets import Widget ITEM_SPACING = 40 LINE_COLOR = rl.GRAY LINE_PADDING = 40 class LineSeparator(Widget): def __init__(self, height: int = 1): super().__init__() self._rect = rl.Rectangle(0, 0, 0, ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/network.py
system/ui/widgets/network.py
from enum import IntEnum from functools import partial from typing import cast import pyray as rl from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui.lib.wifi_manager import Wif...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/label.py
system/ui/widgets/label.py
from enum import IntEnum from collections.abc import Callable from itertools import zip_longest from typing import Union import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight, DEFAULT_TEXT_SIZE, DEFAULT_TEXT_COLOR, FONT_SCALE from openpilot.system.ui.widgets import Widget from openpilo...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/confirm_dialog.py
system/ui/widgets/confirm_dialog.py
import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import DialogResult from openpilot.system.ui.widgets.button import ButtonStyle, Button from openpilot.system.ui.widgets.label import Label from openpil...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/list_view.py
system/ui/widgets/list_view.py
import os import pyray as rl from collections.abc import Callable from abc import ABC from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.widgets impor...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/html_render.py
system/ui/widgets/html_render.py
import re import pyray as rl from dataclasses import dataclass from enum import Enum from typing import Any from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.syst...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/slider.py
system/ui/widgets/slider.py
from collections.abc import Callable import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.label import UnifiedLabel from openpilot.common.filter_simple import FirstOrderFilter class SmallSlider(Widget):...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/option_dialog.py
system/ui/widgets/option_dialog.py
import pyray as rl from openpilot.system.ui.lib.application import FontWeight from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import Widget, DialogResult from openpilot.system.ui.widgets.button import Button, ButtonStyle from openpilot.system.ui.widgets.label import gui_label from open...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/keyboard.py
system/ui/widgets/keyboard.py
from functools import partial import time from typing import Literal import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.button import ButtonStyle, Button...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/toggle.py
system/ui/widgets/toggle.py
import pyray as rl from collections.abc import Callable from openpilot.system.ui.lib.application import MousePos from openpilot.system.ui.widgets import Widget ON_COLOR = rl.Color(51, 171, 76, 255) OFF_COLOR = rl.Color(0x39, 0x39, 0x39, 255) KNOB_COLOR = rl.WHITE DISABLED_ON_COLOR = rl.Color(0x22, 0x77, 0x22, 255) # ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/mici_keyboard.py
system/ui/widgets/mici_keyboard.py
from enum import IntEnum import pyray as rl import numpy as np from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos, MouseEvent from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.widgets import Widget from openpilot.common.filter_simple import BounceFi...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/scroller.py
system/ui/widgets/scroller.py
import pyray as rl import numpy as np from collections.abc import Callable from openpilot.common.filter_simple import FirstOrderFilter, BounceFilter from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.lib.scroll_panel2 import GuiScrollPanel2, ScrollState from openpilot.system.ui.widgets im...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/__init__.py
system/ui/widgets/__init__.py
from __future__ import annotations import abc import pyray as rl from enum import IntEnum from collections.abc import Callable from openpilot.common.filter_simple import BounceFilter, FirstOrderFilter from openpilot.system.ui.lib.application import gui_app, MousePos, MAX_TOUCH_SLOTS, MouseEvent try: from openpilot....
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/widgets/button.py
system/ui/widgets/button.py
from collections.abc import Callable from enum import IntEnum import pyray as rl from openpilot.system.ui.lib.application import gui_app, FontWeight, MousePos from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.label import Label, UnifiedLabel from openpilot.common.filter_simple import Fir...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/multilang.py
system/ui/lib/multilang.py
from importlib.resources import files import os import json import gettext from openpilot.common.basedir import BASEDIR from openpilot.common.swaglog import cloudlog try: from openpilot.common.params import Params except ImportError: Params = None SYSTEM_UI_DIR = os.path.join(BASEDIR, "system", "ui") UI_DIR = fil...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/wifi_manager.py
system/ui/lib/wifi_manager.py
import atexit import threading import time import uuid import subprocess from collections.abc import Callable from dataclasses import dataclass from enum import IntEnum from typing import Any from jeepney import DBusAddress, new_method_call from jeepney.bus_messages import MatchRule, message_bus from jeepney.io.blocki...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/application.py
system/ui/lib/application.py
import atexit import cffi import os import time import signal import sys import pyray as rl import threading import platform import subprocess from contextlib import contextmanager from collections.abc import Callable from collections import deque from dataclasses import dataclass from enum import StrEnum from pathlib ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/shader_polygon.py
system/ui/lib/shader_polygon.py
import pyray as rl import numpy as np from dataclasses import dataclass from typing import Any, Optional, cast from openpilot.system.ui.lib.application import gui_app, GL_VERSION MAX_GRADIENT_COLORS = 20 # includes stops as well @dataclass class Gradient: start: tuple[float, float] end: tuple[float, float] co...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/networkmanager.py
system/ui/lib/networkmanager.py
from enum import IntEnum # NetworkManager device states class NMDeviceState(IntEnum): UNKNOWN = 0 DISCONNECTED = 30 PREPARE = 40 STATE_CONFIG = 50 NEED_AUTH = 60 IP_CONFIG = 70 ACTIVATED = 100 DEACTIVATING = 110 # NetworkManager constants NM = "org.freedesktop.NetworkManager" NM_PATH = '/org/freedes...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/egl.py
system/ui/lib/egl.py
import os import cffi from dataclasses import dataclass from typing import Any from openpilot.common.swaglog import cloudlog # EGL constants EGL_LINUX_DMA_BUF_EXT = 0x3270 EGL_WIDTH = 0x3057 EGL_HEIGHT = 0x3056 EGL_LINUX_DRM_FOURCC_EXT = 0x3271 EGL_DMA_BUF_PLANE0_FD_EXT = 0x3272 EGL_DMA_BUF_PLANE0_OFFSET_EXT = 0x3273 ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/scroll_panel.py
system/ui/lib/scroll_panel.py
import math import pyray as rl from enum import IntEnum from openpilot.system.ui.lib.application import gui_app, MouseEvent from openpilot.common.filter_simple import FirstOrderFilter # Scroll constants for smooth scrolling behavior MOUSE_WHEEL_SCROLL_SPEED = 50 BOUNCE_RETURN_RATE = 5 # ~0.92 at 60fps MIN...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/scroll_panel2.py
system/ui/lib/scroll_panel2.py
import os import math import pyray as rl from collections.abc import Callable from enum import Enum from typing import cast from openpilot.system.ui.lib.application import gui_app, MouseEvent from openpilot.system.hardware import TICI from collections import deque MIN_VELOCITY = 10 # px/s, changes from auto scroll to...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/wrap_text.py
system/ui/lib/wrap_text.py
import pyray as rl from openpilot.system.ui.lib.text_measure import measure_text_cached from openpilot.system.ui.lib.application import font_fallback def _break_long_word(font: rl.Font, word: str, font_size: int, max_width: int, spacing: float = 0) -> list[str]: if not word: return [] parts = [] remaining ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/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
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/__init__.py
system/ui/lib/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/emoji.py
system/ui/lib/emoji.py
import io import re from PIL import Image, ImageDraw, ImageFont import pyray as rl from openpilot.system.ui.lib.application import FONT_DIR _emoji_font: ImageFont.FreeTypeFont | None = None _cache: dict[str, rl.Texture] = {} EMOJI_REGEX = re.compile( """[\U0001F600-\U0001F64F \U0001F300-\U0001F5FF \U0001F680-\U0001...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/system/ui/lib/text_measure.py
system/ui/lib/text_measure.py
import pyray as rl from openpilot.system.ui.lib.application import FONT_SCALE, font_fallback from openpilot.system.ui.lib.emoji import find_emoji _cache: dict[int, rl.Vector2] = {} def measure_text_cached(font: rl.Font, text: str, font_size: int, spacing: float = 0) -> rl.Vector2: """Caches text measurements to av...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/auto_source.py
tools/auto_source.py
#!/usr/bin/env python3 import sys from openpilot.tools.lib.logreader import LogReader, ReadMode def main(): if len(sys.argv) != 2: print("Usage: python auto_source.py <log_path>") sys.exit(1) log_path = sys.argv[1] lr = LogReader(log_path, default_mode=ReadMode.AUTO, sort_by_time=True) print("\n".joi...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/__init__.py
tools/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/scripts/extract_audio.py
tools/scripts/extract_audio.py
#!/usr/bin/env python3 import os import sys import wave import argparse import numpy as np from openpilot.tools.lib.logreader import LogReader, ReadMode def extract_audio(route_or_segment_name, output_file=None, play=False): lr = LogReader(route_or_segment_name, default_mode=ReadMode.AUTO_INTERACTIVE) audio_mess...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/scripts/ssh.py
tools/scripts/ssh.py
#!/usr/bin/env python3 import os import sys import argparse import re from openpilot.common.basedir import BASEDIR from openpilot.tools.lib.auth_config import get_token from openpilot.tools.lib.api import CommaApi if __name__ == "__main__": parser = argparse.ArgumentParser(description="A helper for connecting to de...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/scripts/save_ubloxraw_stream.py
tools/scripts/save_ubloxraw_stream.py
#!/usr/bin/env python3 import argparse import os import sys from openpilot.common.basedir import BASEDIR from openpilot.tools.lib.logreader import LogReader os.environ['BASEDIR'] = BASEDIR def get_arg_parser(): parser = argparse.ArgumentParser( description="Unlogging and save to file", formatter_class=...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/scripts/setup_ssh_keys.py
tools/scripts/setup_ssh_keys.py
#!/usr/bin/env python3 import requests from openpilot.common.params import Params import sys if __name__ == "__main__": if len(sys.argv) < 2: print(f"{sys.argv[0]} <github username>") exit(1) username = sys.argv[1] keys = requests.get(f"https://github.com/{username}.keys", timeout=10) if keys.statu...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/scripts/fetch_image_from_route.py
tools/scripts/fetch_image_from_route.py
#!/usr/bin/env python3 import sys if len(sys.argv) < 4: print(f"{sys.argv[0]} <route> <segment> <frame number> [front|wide|driver]") print('example: ./fetch_image_from_route.py "02c45f73a2e5c6e9|2020-06-01--18-03-08" 3 500 driver') exit(0) cameras = { "front": "cameras", "wide": "ecameras", "driver": "dca...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/cabana/dbc/generate_dbc_json.py
tools/cabana/dbc/generate_dbc_json.py
#!/usr/bin/env python3 import argparse import json from opendbc.car import Bus from opendbc.car.fingerprints import MIGRATION from opendbc.car.values import PLATFORMS def generate_dbc_dict() -> dict[str, str]: dbc_map = {} for platform in PLATFORMS.values(): if platform != "MOCK": if Bus.pt in platform...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/__init__.py
tools/sim/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/run_bridge.py
tools/sim/run_bridge.py
#!/usr/bin/env python3 import argparse from typing import Any from multiprocessing import Queue from openpilot.tools.sim.bridge.metadrive.metadrive_bridge import MetaDriveBridge def create_bridge(dual_camera, high_quality): queue: Any = Queue() simulator_bridge = MetaDriveBridge(dual_camera, high_quality) sim...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/bridge/common.py
tools/sim/bridge/common.py
import signal import threading import functools import numpy as np from collections import namedtuple from enum import Enum from multiprocessing import Process, Queue, Value from abc import ABC, abstractmethod from opendbc.car.honda.values import CruiseButtons from openpilot.common.params import Params from openpilot...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/bridge/__init__.py
tools/sim/bridge/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/bridge/metadrive/metadrive_process.py
tools/sim/bridge/metadrive/metadrive_process.py
import math import time import numpy as np from collections import namedtuple from panda3d.core import Vec3 from multiprocessing.connection import Connection from metadrive.engine.core.engine_core import EngineCore from metadrive.engine.core.image_buffer import ImageBuffer from metadrive.envs.metadrive_env import Met...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/bridge/metadrive/metadrive_common.py
tools/sim/bridge/metadrive/metadrive_common.py
import numpy as np from metadrive.component.sensors.rgb_camera import RGBCamera from panda3d.core import Texture, GraphicsOutput class CopyRamRGBCamera(RGBCamera): """Camera which copies its content into RAM during the render process, for faster image grabbing.""" def __init__(self, *args, **kwargs): super()...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/bridge/metadrive/metadrive_world.py
tools/sim/bridge/metadrive/metadrive_world.py
import ctypes import functools import multiprocessing import numpy as np import time from multiprocessing import Pipe, Array from openpilot.tools.sim.bridge.common import QueueMessage, QueueMessageType from openpilot.tools.sim.bridge.metadrive.metadrive_process import (metadrive_process, metadrive_simulation_state, ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/bridge/metadrive/metadrive_bridge.py
tools/sim/bridge/metadrive/metadrive_bridge.py
import math from multiprocessing import Queue from metadrive.component.sensors.base_camera import _cuda_enable from metadrive.component.map.pg_map import MapGenerateMethod from openpilot.tools.sim.bridge.common import SimulatorBridge from openpilot.tools.sim.bridge.metadrive.metadrive_common import RGBCameraRoad, RGB...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/tests/test_sim_bridge.py
tools/sim/tests/test_sim_bridge.py
import os import subprocess import time import pytest from multiprocessing import Queue from cereal import messaging from openpilot.common.basedir import BASEDIR from openpilot.tools.sim.bridge.common import QueueMessageType SIM_DIR = os.path.join(BASEDIR, "tools/sim") class TestSimBridgeBase: @classmethod def ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/tests/conftest.py
tools/sim/tests/conftest.py
import pytest def pytest_addoption(parser): parser.addoption("--test_duration", action="store", default=60, type=int, help="Seconds to run metadrive drive") @pytest.fixture def test_duration(request): return request.config.getoption("--test_duration")
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/tests/__init__.py
tools/sim/tests/__init__.py
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/tests/test_metadrive_bridge.py
tools/sim/tests/test_metadrive_bridge.py
import pytest import warnings # Since metadrive depends on pkg_resources, and pkg_resources is deprecated as an API warnings.filterwarnings("ignore", category=DeprecationWarning) from openpilot.tools.sim.bridge.metadrive.metadrive_bridge import MetaDriveBridge from openpilot.tools.sim.tests.test_sim_bridge import Tes...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/lib/simulated_sensors.py
tools/sim/lib/simulated_sensors.py
import time from cereal import log import cereal.messaging as messaging from openpilot.common.realtime import DT_DMON from openpilot.tools.sim.lib.camerad import Camerad from typing import TYPE_CHECKING if TYPE_CHECKING: from openpilot.tools.sim.lib.common import World, SimulatorState class SimulatedSensors: "...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/lib/common.py
tools/sim/lib/common.py
import math import multiprocessing import numpy as np from abc import ABC, abstractmethod from collections import namedtuple W, H = 1928, 1208 vec3 = namedtuple("vec3", ["x", "y", "z"]) class GPSState: def __init__(self): self.latitude = 0 self.longitude = 0 self.altitude = 0 def from_xy(self, xy)...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false
commaai/openpilot
https://github.com/commaai/openpilot/blob/adbf68f77120b4568de68c37b8bed4ed433e01fe/tools/sim/lib/manual_ctrl.py
tools/sim/lib/manual_ctrl.py
#!/usr/bin/env python3 # set up wheel import array import os import struct from fcntl import ioctl from typing import NoReturn from openpilot.tools.sim.bridge.common import control_cmd_gen # Iterate over the joystick devices. print('Available devices:') for fn in os.listdir('/dev/input'): if fn.startswith('js'): ...
python
MIT
adbf68f77120b4568de68c37b8bed4ed433e01fe
2026-01-04T14:38:40.093933Z
false