repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/ldw.py | selfdrive/controls/lib/ldw.py | from cereal import log
from openpilot.common.realtime import DT_CTRL
from openpilot.common.conversions import Conversions as CV
CAMERA_OFFSET = 0.04
LDW_MIN_SPEED = 31 * CV.MPH_TO_MS
LANE_DEPARTURE_THRESHOLD = 0.1
class LaneDepartureWarning:
def __init__(self):
self.left = False
self.right = False
self... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/lane_planner_2.py | selfdrive/controls/lib/lane_planner_2.py | import math
import numpy as np
from cereal import log
from openpilot.common.filter_simple import FirstOrderFilter
from openpilot.common.realtime import DT_MDL
# from openpilot.common.swaglog import cloudlog
# from openpilot.common.logger import sLogger
from openpilot.common.params import Params
TRAJECTORY_SIZE = 33
# ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/latcontrol_pid.py | selfdrive/controls/lib/latcontrol_pid.py | import math
from cereal import log
from openpilot.selfdrive.controls.lib.latcontrol import LatControl
from openpilot.common.pid import PIDController
class LatControlPID(LatControl):
def __init__(self, CP, CI):
super().__init__(CP, CI)
self.pid = PIDController((CP.lateralTuning.pid.kpBP, CP.lateralTuning.pi... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/latcontrol_angle.py | selfdrive/controls/lib/latcontrol_angle.py | import math
import numpy as np
from cereal import log
from openpilot.selfdrive.controls.lib.latcontrol import LatControl
STEER_ANGLE_SATURATION_THRESHOLD = 2.5 # Degrees
class LatControlAngle(LatControl):
def __init__(self, CP, CI):
super().__init__(CP, CI)
self.sat_check_min_speed = 5.
def update(sel... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/latcontrol_torque.py | selfdrive/controls/lib/latcontrol_torque.py | from collections import deque
import math
import numpy as np
from cereal import log
from openpilot.common.filter_simple import FirstOrderFilter
from openpilot.selfdrive.modeld.constants import ModelConstants
from openpilot.selfdrive.controls.lib.drive_helpers import CONTROL_N
from opendbc.car.interfaces import LatCo... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/__init__.py | selfdrive/controls/lib/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/lateral_planner.py | selfdrive/controls/lib/lateral_planner.py | import time
import numpy as np
from openpilot.common.realtime import DT_MDL
from openpilot.common.swaglog import cloudlog
from openpilot.selfdrive.controls.lib.lateral_mpc_lib.lat_mpc import LateralMpc
from openpilot.selfdrive.controls.lib.lateral_mpc_lib.lat_mpc import N as LAT_MPC_N
from openpilot.selfdrive.controls.... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/desire_helper.py | selfdrive/controls/lib/desire_helper.py | from cereal import log
from openpilot.common.conversions import Conversions as CV
from openpilot.common.realtime import DT_MDL
import numpy as np
from openpilot.selfdrive.modeld.constants import ModelConstants
from openpilot.common.params import Params
from collections import deque
LaneChangeState = log.LaneChangeStat... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/latcontrol.py | selfdrive/controls/lib/latcontrol.py | import numpy as np
from abc import abstractmethod, ABC
from openpilot.common.realtime import DT_CTRL
MIN_LATERAL_CONTROL_SPEED = 0.3 # m/s
class LatControl(ABC):
def __init__(self, CP, CI):
self.sat_count_rate = 1.0 * DT_CTRL
self.sat_limit = CP.steerLimitTimer
self.sat_count = 0.
self.sat_check_... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/drive_helpers.py | selfdrive/controls/lib/drive_helpers.py | import numpy as np
from cereal import log
from opendbc.car.vehicle_model import ACCELERATION_DUE_TO_GRAVITY
from openpilot.common.realtime import DT_CTRL, DT_MDL
from openpilot.selfdrive.modeld.constants import ModelConstants
import numpy as np
MIN_SPEED = 1.0
CONTROL_N = 17
CAR_ROTATION_RADIUS = 0.0
# This is a turn ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/longcontrol.py | selfdrive/controls/lib/longcontrol.py | import numpy as np
from cereal import car
from openpilot.common.realtime import DT_CTRL
from openpilot.selfdrive.controls.lib.drive_helpers import CONTROL_N
from openpilot.common.pid import PIDController
from openpilot.selfdrive.modeld.constants import ModelConstants
from openpilot.common.params import Params
CONTROL_... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/tests/test_latcontrol.py | selfdrive/controls/lib/tests/test_latcontrol.py | from parameterized import parameterized
from cereal import car, log
from opendbc.car.car_helpers import interfaces
from opendbc.car.honda.values import CAR as HONDA
from opendbc.car.toyota.values import CAR as TOYOTA
from opendbc.car.nissan.values import CAR as NISSAN
from opendbc.car.vehicle_model import VehicleModel... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/tests/__init__.py | selfdrive/controls/lib/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/lateral_mpc_lib/lat_mpc.py | selfdrive/controls/lib/lateral_mpc_lib/lat_mpc.py | #!/usr/bin/env python3
import os
import time
import numpy as np
from casadi import SX, vertcat, sin, cos
# WARNING: imports outside of constants will not trigger a rebuild
from openpilot.selfdrive.modeld.constants import ModelConstants
if __name__ == '__main__': # generating code
from openpilot.third_party.acados.... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/lateral_mpc_lib/__init__.py | selfdrive/controls/lib/lateral_mpc_lib/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py | selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py | #!/usr/bin/env python3
import os
import time
import numpy as np
from cereal import log
from opendbc.car.interfaces import ACCEL_MIN
from openpilot.common.realtime import DT_MDL
from openpilot.common.swaglog import cloudlog
# WARNING: imports outside of constants will not trigger a rebuild
from openpilot.selfdrive.model... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/controls/lib/longitudinal_mpc_lib/__init__.py | selfdrive/controls/lib/longitudinal_mpc_lib/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/car_specific.py | selfdrive/car/car_specific.py | from collections import deque
from cereal import car, log
import cereal.messaging as messaging
from opendbc.car import DT_CTRL, structs
from opendbc.car.interfaces import MAX_CTRL_SPEED
from opendbc.car.volkswagen.values import CarControllerParams as VWCarControllerParams
from opendbc.car.hyundai.interface import ENABL... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/cruise.py | selfdrive/car/cruise.py | import math
import numpy as np
from cereal import car
from openpilot.common.conversions import Conversions as CV
from opendbc.car import structs
GearShifter = structs.CarState.GearShifter
# WARNING: this value was determined based on the model's training distribution,
# model predictions above this speed c... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | true |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/card.py | selfdrive/car/card.py | #!/usr/bin/env python3
import os
import time
import threading
import cereal.messaging as messaging
from cereal import car, log
from openpilot.common.params import Params
from openpilot.common.realtime import config_realtime_process, Priority, Ratekeeper
from openpilot.common.swaglog import cloudlog, ForwardingHandle... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/__init__.py | selfdrive/car/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/docs.py | selfdrive/car/docs.py | #!/usr/bin/env python3
import argparse
import os
from openpilot.common.basedir import BASEDIR
from opendbc.car.docs import get_all_car_docs, generate_cars_md
CARS_MD_OUT = os.path.join(BASEDIR, "docs", "CARS.md")
CARS_MD_TEMPLATE = os.path.join(BASEDIR, "selfdrive", "car", "CARS_template.md")
if __name__ == "__main_... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/tests/test_car_interfaces.py | selfdrive/car/tests/test_car_interfaces.py | import os
import math
import hypothesis.strategies as st
from hypothesis import Phase, given, settings
from parameterized import parameterized
from cereal import car
from opendbc.car import DT_CTRL
from opendbc.car.car_helpers import interfaces
from opendbc.car.structs import CarParams
from opendbc.car.tests.test_car_... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/tests/test_docs.py | selfdrive/car/tests/test_docs.py | import os
from openpilot.common.basedir import BASEDIR
from opendbc.car.docs import generate_cars_md, get_all_car_docs
from openpilot.selfdrive.debug.dump_car_docs import dump_car_docs
from openpilot.selfdrive.debug.print_docs_diff import print_car_docs_diff
from openpilot.selfdrive.car.docs import CARS_MD_TEMPLATE
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/tests/test_models.py | selfdrive/car/tests/test_models.py | import time
import os
import pytest
import random
import unittest # noqa: TID251
from collections import defaultdict, Counter
import hypothesis.strategies as st
from hypothesis import Phase, given, settings
from parameterized import parameterized_class
from opendbc.car import DT_CTRL, gen_empty_fingerprint, structs
fr... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/tests/__init__.py | selfdrive/car/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/car/tests/test_cruise_speed.py | selfdrive/car/tests/test_cruise_speed.py | import pytest
import itertools
import numpy as np
from parameterized import parameterized_class
from cereal import log
from openpilot.selfdrive.car.cruise import VCruiseHelper, V_CRUISE_MIN, V_CRUISE_MAX, V_CRUISE_INITIAL, IMPERIAL_INCREMENT
from cereal import car
from openpilot.common.conversions import Conversions a... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/monitoring/dmonitoringd.py | selfdrive/monitoring/dmonitoringd.py | #!/usr/bin/env python3
import cereal.messaging as messaging
from openpilot.common.params import Params
from openpilot.common.realtime import config_realtime_process
from openpilot.selfdrive.monitoring.helpers import DriverMonitoring
def dmonitoringd_thread():
config_realtime_process([0, 1, 2, 3], 5)
params = Par... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/monitoring/helpers.py | selfdrive/monitoring/helpers.py | from math import atan2
import numpy as np
from cereal import car, log
import cereal.messaging as messaging
from openpilot.selfdrive.selfdrived.events import Events
from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert
from openpilot.common.realtime import DT_DMON
from openpilot.common.filter_simple... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/monitoring/test_monitoring.py | selfdrive/monitoring/test_monitoring.py | import numpy as np
from cereal import log
from openpilot.common.realtime import DT_DMON
from openpilot.selfdrive.monitoring.helpers import DriverMonitoring, DRIVER_MONITOR_SETTINGS
from openpilot.system.hardware import HARDWARE
EventName = log.OnroadEvent.EventName
dm_settings = DRIVER_MONITOR_SETTINGS(device_type=HA... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/carrot/carrot_serv.py | selfdrive/carrot/carrot_serv.py | import fcntl
import json
import math
import os
import socket
import struct
import subprocess
import threading
import time
import numpy as np
from datetime import datetime
from ftplib import FTP
from cereal import log
import cereal.messaging as messaging
from openpilot.common.realtime import Ratekeeper
from openpilot.c... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | true |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/carrot/carrot_speed.py | selfdrive/carrot/carrot_speed.py | # -*- coding: utf-8 -*-
"""
CarrotSpeedTable v2.1 (Params backend, JSON+gzip, 1e-4ยฐ grid, 8 buckets)
- ์ ์ฅ ํค: "CarrotSpeedTable"
- ํฌ๋งท(JSON): {"format":"v5","dir_buckets":8,"cells":{"gy,gx":[[v,ts],...]} }
- gzip ์ ์ฅ/๋ก๋ ์ง์ (๊ธฐ๋ณธ on). ๊ธฐ์กด ๋น์์ถ v2๋ ๋ก๋ ๊ฐ๋ฅ.
- ๊ฒฉ์: ์/๊ฒฝ๋ ๊ฐ 1e-4ยฐ ์ค๋
(ํ๊ตญ ์๋์์ ์ฝ 9~11m)
- ์ ์ฅ: ๋จ์ผ speed(๋ถํธ ํฌํจ)๋ง ํด๋น ์
1๊ณณ์ ๊ธฐ๋ก... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/carrot/carrot_functions.py | selfdrive/carrot/carrot_functions.py | from enum import Enum
from cereal import log
from openpilot.common.params import Params
import numpy as np
from openpilot.common.realtime import DT_MDL
from openpilot.common.conversions import Conversions as CV
from openpilot.common.filter_simple import MyMovingAverage
from openpilot.selfdrive.selfdrived.events import... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/carrot/carrot_man.py | selfdrive/carrot/carrot_man.py | import fcntl
import json
import math
import os
import socket
import struct
import subprocess
import threading
import time
import numpy as np
import zmq
from datetime import datetime
from ftplib import FTP
from cereal import log
import cereal.messaging as messaging
from openpilot.common.realtime import Ratekeeper
from ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | true |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/calibrationd.py | selfdrive/locationd/calibrationd.py | #!/usr/bin/env python3
'''
This process finds calibration values. More info on what these calibration values
are can be found here https://github.com/commaai/openpilot/tree/master/common/transformations
While the roll calibration is a real value that can be estimated, here we assume it's zero,
and the image input into ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/locationd.py | selfdrive/locationd/locationd.py | #!/usr/bin/env python3
import os
import time
import capnp
import numpy as np
from enum import Enum
from collections import defaultdict
from cereal import log, messaging
from cereal.services import SERVICE_LIST
from openpilot.common.transformations.orientation import rot_from_euler
from openpilot.common.realtime import... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/torqued.py | selfdrive/locationd/torqued.py | #!/usr/bin/env python3
import os
import numpy as np
from collections import deque, defaultdict
import cereal.messaging as messaging
from cereal import car, log
from openpilot.common.constants import ACCELERATION_DUE_TO_GRAVITY
from openpilot.common.params import Params
from openpilot.common.realtime import config_real... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/lagd.py | selfdrive/locationd/lagd.py | #!/usr/bin/env python3
import os
import numpy as np
import capnp
from collections import deque
from functools import partial
import cereal.messaging as messaging
from cereal import car, log
from cereal.services import SERVICE_LIST
from openpilot.common.params import Params
from openpilot.common.realtime import config_... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/helpers.py | selfdrive/locationd/helpers.py | import numpy as np
from typing import Any
from functools import cache
from cereal import log
from openpilot.common.transformations.orientation import rot_from_euler, euler_from_rot
@cache
def fft_next_good_size(n: int) -> int:
"""
smallest composite of 2, 3, 5, 7, 11 that is >= n
inspired by pocketfft
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/paramsd.py | selfdrive/locationd/paramsd.py | #!/usr/bin/env python3
import os
import numpy as np
import capnp
import json
import math
import cereal.messaging as messaging
from cereal import car, log
from openpilot.common.params import Params
from openpilot.common.realtime import config_realtime_process, DT_MDL
from openpilot.selfdrive.locationd.models.car_kf im... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/__init__.py | selfdrive/locationd/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/test/test_calibrationd.py | selfdrive/locationd/test/test_calibrationd.py | import random
import numpy as np
import cereal.messaging as messaging
from cereal import log
from openpilot.common.params import Params
from openpilot.selfdrive.locationd.calibrationd import Calibrator, INPUTS_NEEDED, INPUTS_WANTED, BLOCK_SIZE, MIN_SPEED_FILTER, \
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/test/test_locationd_scenarios.py | selfdrive/locationd/test/test_locationd_scenarios.py | import numpy as np
from collections import defaultdict
from enum import Enum
from openpilot.tools.lib.logreader import LogReader
from openpilot.selfdrive.test.process_replay.migration import migrate_all
from openpilot.selfdrive.test.process_replay.process_replay import replay_process_with_name
# TODO find a new segme... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/test/__init__.py | selfdrive/locationd/test/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/models/constants.py | selfdrive/locationd/models/constants.py | import os
GENERATED_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'generated'))
class ObservationKind:
UNKNOWN = 0
NO_OBSERVATION = 1
GPS_NED = 2
ODOMETRIC_SPEED = 3
PHONE_GYRO = 4
GPS_VEL = 5
PSEUDORANGE_GPS = 6
PSEUDORANGE_RATE_GPS = 7
SPEED = 8
NO_ROT = 9
PHONE_ACCEL = 10
OR... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/models/car_kf.py | selfdrive/locationd/models/car_kf.py | #!/usr/bin/env python3
import math
import sys
from typing import Any
import numpy as np
from openpilot.common.constants import ACCELERATION_DUE_TO_GRAVITY
from openpilot.selfdrive.locationd.models.constants import ObservationKind
from openpilot.common.swaglog import cloudlog
from rednose.helpers.kalmanfilter import ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/models/pose_kf.py | selfdrive/locationd/models/pose_kf.py | #!/usr/bin/env python3
import sys
import numpy as np
from openpilot.selfdrive.locationd.models.constants import ObservationKind
from rednose.helpers.kalmanfilter import KalmanFilter
if __name__=="__main__":
import sympy as sp
from rednose.helpers.ekf_sym import gen_code
from rednose.helpers.sympy_helpers impo... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/locationd/models/__init__.py | selfdrive/locationd/models/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/update_translations.py | selfdrive/ui/update_translations.py | #!/usr/bin/env python3
import argparse
import json
import os
from openpilot.common.basedir import BASEDIR
UI_DIR = os.path.join(BASEDIR, "selfdrive", "ui")
TRANSLATIONS_DIR = os.path.join(UI_DIR, "translations")
LANGUAGES_FILE = os.path.join(TRANSLATIONS_DIR, "languages.json")
TRANSLATIONS_INCLUDE_FILE = os.path.join... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/__init__.py | selfdrive/ui/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/soundd.py | selfdrive/ui/soundd.py | import math
import numpy as np
import time
import wave
from cereal import car, messaging
from openpilot.common.basedir import BASEDIR
from openpilot.common.filter_simple import FirstOrderFilter
from openpilot.common.params import Params
from openpilot.common.realtime import Ratekeeper
from openpilot.common.retry impo... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/qt/python_helpers.py | selfdrive/ui/qt/python_helpers.py | import os
from cffi import FFI
import sip
from openpilot.common.ffi_wrapper import suffix
from openpilot.common.basedir import BASEDIR
def get_ffi():
lib = os.path.join(BASEDIR, "selfdrive", "ui", "qt", "libpython_helpers" + suffix())
ffi = FFI()
ffi.cdef("void set_main_window(void *w);")
return ffi, ffi.d... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/tests/test_soundd.py | selfdrive/ui/tests/test_soundd.py | from cereal import car
from cereal import messaging
from cereal.messaging import SubMaster, PubMaster
from openpilot.selfdrive.ui.soundd import SELFDRIVE_STATE_TIMEOUT, check_selfdrive_timeout_alert
import time
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
class TestSoundd:
def test_check_selfdrive_timeou... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/tests/cycle_offroad_alerts.py | selfdrive/ui/tests/cycle_offroad_alerts.py | #!/usr/bin/env python3
import os
import sys
import time
import json
from openpilot.common.basedir import BASEDIR
from openpilot.common.params import Params
from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert
if __name__ == "__main__":
params = Params()
with open(os.path.join(BASEDIR, "selfd... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/tests/test_translations.py | selfdrive/ui/tests/test_translations.py | import pytest
import json
import os
import re
import xml.etree.ElementTree as ET
import string
import requests
from parameterized import parameterized_class
from openpilot.selfdrive.ui.update_translations import TRANSLATIONS_DIR, LANGUAGES_FILE
with open(LANGUAGES_FILE) as f:
translation_files = json.load(f)
UNFIN... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/tests/__init__.py | selfdrive/ui/tests/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/tests/body.py | selfdrive/ui/tests/body.py | #!/usr/bin/env python3
import time
import cereal.messaging as messaging
if __name__ == "__main__":
while True:
pm = messaging.PubMaster(['carParams', 'carState'])
batt = 1.
while True:
msg = messaging.new_message('carParams')
msg.carParams.brand = "body"
msg.carParams.notCar = True
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/tests/test_ui/run.py | selfdrive/ui/tests/test_ui/run.py | #!/usr/bin/env python3
import capnp
import pathlib
import shutil
import sys
import os
import pywinctl
import pyautogui
import pickle
import time
from collections import namedtuple
from cereal import car, log
from msgq.visionipc import VisionIpcServer, VisionStreamType
from cereal.messaging import PubMaster, log_from_b... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/translations/auto_translate.py | selfdrive/ui/translations/auto_translate.py | #!/usr/bin/env python3
import argparse
import json
import os
import pathlib
import xml.etree.ElementTree as ET
from typing import cast
import requests
TRANSLATIONS_DIR = pathlib.Path(__file__).resolve().parent
TRANSLATIONS_LANGUAGES = TRANSLATIONS_DIR / "languages.json"
OPENAI_MODEL = "gpt-4"
OPENAI_API_KEY = os.en... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/ui/translations/create_badges.py | selfdrive/ui/translations/create_badges.py | #!/usr/bin/env python3
import json
import os
import requests
import xml.etree.ElementTree as ET
from openpilot.common.basedir import BASEDIR
from openpilot.selfdrive.ui.tests.test_translations import UNFINISHED_TRANSLATION_TAG
from openpilot.selfdrive.ui.update_translations import LANGUAGES_FILE, TRANSLATIONS_DIR
TRA... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/qlog_size.py | selfdrive/debug/qlog_size.py | #!/usr/bin/env python3
import argparse
import zstandard as zstd
from collections import defaultdict
import matplotlib.pyplot as plt
from cereal.services import SERVICE_LIST
from openpilot.common.file_helpers import LOG_COMPRESSION_LEVEL
from openpilot.tools.lib.logreader import LogReader
from tqdm import tqdm
MIN_SI... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/cpu_usage_stat.py | selfdrive/debug/cpu_usage_stat.py | #!/usr/bin/env python3
# type: ignore
'''
System tools like top/htop can only show current cpu usage values, so I write this script to do statistics jobs.
Features:
Use psutil library to sample cpu usage(avergage for all cores) of openpilot processes, at a rate of 5 samples/sec.
Do cpu usage statistics period... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/check_freq.py | selfdrive/debug/check_freq.py | #!/usr/bin/env python3
import argparse
import numpy as np
import time
from collections import defaultdict, deque
from collections.abc import MutableSequence
import cereal.messaging as messaging
if __name__ == "__main__":
context = messaging.Context()
poller = messaging.Poller()
parser = argparse.ArgumentParse... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/filter_log_message.py | selfdrive/debug/filter_log_message.py | #!/usr/bin/env python3
import argparse
import json
import cereal.messaging as messaging
from openpilot.tools.lib.logreader import LogReader
LEVELS = {
"DEBUG": 10,
"INFO": 20,
"WARNING": 30,
"ERROR": 40,
"CRITICAL": 50,
}
ANDROID_LOG_SOURCE = {
0: "MAIN",
1: "RADIO",
2: "EVENTS",
3: "SYSTEM",
4: ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/uiview.py | selfdrive/debug/uiview.py | #!/usr/bin/env python3
import time
from cereal import car, log, messaging
from openpilot.common.params import Params
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware import HARDWARE
if __name__ == "__main__":
CP = car.CarParams(notCar=True, wheelbase=1, steerRatio... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/debug_console_carrot.py | selfdrive/debug/debug_console_carrot.py | #!/usr/bin/env python3
import os
import sys
import time
import select
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
from panda import Panda # noqa: E402
setcolor = ["\033[1;32;40m", "\033[1;31;40m"]
unsetcolor = "\033[00m"
if __name__ == "__main__":
start_time = time.monotonic... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/live_cpu_and_temp.py | selfdrive/debug/live_cpu_and_temp.py | #!/usr/bin/env python3
import argparse
import numpy as np
import capnp
from collections import defaultdict
from cereal.messaging import SubMaster
def cputime_total(ct):
return ct.user + ct.nice + ct.system + ct.idle + ct.iowait + ct.irq + ct.softirq
def cputime_busy(ct):
return ct.user + ct.nice + ct.system + c... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/fingerprint_from_route.py | selfdrive/debug/fingerprint_from_route.py | #!/usr/bin/env python3
import sys
from openpilot.tools.lib.logreader import LogReader, ReadMode
def get_fingerprint(lr):
# TODO: make this a nice tool for car ports. should also work with qlogs for FW
fw = None
vin = None
msgs = {}
for msg in lr:
if msg.which() == 'carParams':
fw = msg.carParams... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/measure_torque_time_to_max.py | selfdrive/debug/measure_torque_time_to_max.py | #!/usr/bin/env python3
# type: ignore
import os
import argparse
import struct
from collections import deque
from statistics import mean
from cereal import log
import cereal.messaging as messaging
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Sniff a communication socket')
parser.add_a... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/fuzz_fw_fingerprint.py | selfdrive/debug/fuzz_fw_fingerprint.py | #!/usr/bin/env python3
# type: ignore
import random
from collections import defaultdict
from tqdm import tqdm
from opendbc.car.fw_versions import match_fw_to_car_fuzzy
from opendbc.car.toyota.values import FW_VERSIONS as TOYOTA_FW_VERSIONS
from opendbc.car.honda.values import FW_VERSIONS as HONDA_FW_VERSIONS
from ope... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/vw_mqb_config.py | selfdrive/debug/vw_mqb_config.py | #!/usr/bin/env python3
import argparse
import struct
from enum import IntEnum
from opendbc.car.carlog import carlog
from opendbc.car.uds import UdsClient, MessageTimeoutError, NegativeResponseError, SESSION_TYPE,\
DATA_IDENTIFIER_TYPE, ACCESS_TYPE
from opendbc.car.structs import CarParams
from panda import Panda
fro... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/test_fw_query_on_routes.py | selfdrive/debug/test_fw_query_on_routes.py | #!/usr/bin/env python3
# type: ignore
from collections import defaultdict
import argparse
import os
import traceback
from tqdm import tqdm
from opendbc.car.car_helpers import interface_names
from opendbc.car.fingerprints import MIGRATION
from opendbc.car.fw_versions import VERSIONS, match_fw_to_car
from openpilot.tool... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/debug_fw_fingerprinting_offline.py | selfdrive/debug/debug_fw_fingerprinting_offline.py | #!/usr/bin/env python3
import argparse
from opendbc.car import uds
from openpilot.tools.lib.live_logreader import live_logreader
from openpilot.tools.lib.logreader import LogReader, ReadMode
def main(route: str | None, addrs: list[int], rxoffset: int | None):
"""
TODO:
- highlight TX vs RX clearly
- disambig... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/run_process_on_route.py | selfdrive/debug/run_process_on_route.py | #!/usr/bin/env python3
import argparse
from openpilot.selfdrive.test.process_replay.process_replay import CONFIGS, replay_process
from openpilot.tools.lib.logreader import LogReader, save_log
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Run process on route and create new logs",
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/read_dtc_status.py | selfdrive/debug/read_dtc_status.py | #!/usr/bin/env python3
import sys
import argparse
from subprocess import check_output, CalledProcessError
from opendbc.car.carlog import carlog
from opendbc.car.uds import UdsClient, SESSION_TYPE, DTC_REPORT_TYPE, DTC_STATUS_MASK_TYPE, get_dtc_num_as_str, get_dtc_status_names
from opendbc.car.structs import CarParams
f... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/toyota_eps_factor.py | selfdrive/debug/toyota_eps_factor.py | #!/usr/bin/env python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
from opendbc.car.toyota.values import STEER_THRESHOLD
from openpilot.tools.lib.logreader import LogReader
MIN_SAMPLES = 30 * 100
def to_signed(n, bits):
if n >= (1 << max((bits - 1), 0)):
n = ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/can_table.py | selfdrive/debug/can_table.py | #!/usr/bin/env python3
import argparse
import pandas as pd
import cereal.messaging as messaging
def can_table(dat):
rows = []
for b in dat:
r = list(bin(b).lstrip('0b').zfill(8))
r += [hex(b)]
rows.append(r)
df = pd.DataFrame(data=rows)
df.columns = [str(n) for n in range(7, -1, -1)] + [' ']
t... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/dump.py | selfdrive/debug/dump.py | #!/usr/bin/env python3
import sys
import argparse
import json
import codecs
from cereal import log
from cereal.services import SERVICE_LIST
from openpilot.tools.lib.live_logreader import raw_live_logreader
codecs.register_error("strict", codecs.backslashreplace_errors)
def hexdump(msg):
m = str.upper(msg.hex())
... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/dump_car_docs.py | selfdrive/debug/dump_car_docs.py | #!/usr/bin/env python3
import argparse
import pickle
from opendbc.car.docs import get_all_car_docs
def dump_car_docs(path):
with open(path, 'wb') as f:
pickle.dump(get_all_car_docs(), f)
print(f'Dumping car info to {path}')
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argume... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/count_events.py | selfdrive/debug/count_events.py | #!/usr/bin/env python3
import sys
import math
import datetime
from collections import Counter
from pprint import pprint
from typing import cast
from cereal.services import SERVICE_LIST
from openpilot.tools.lib.logreader import LogReader, ReadMode
from openpilot.selfdrive.test.process_replay.migration import migrate_al... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/check_lag.py | selfdrive/debug/check_lag.py | #!/usr/bin/env python3
import cereal.messaging as messaging
from cereal.services import SERVICE_LIST
TO_CHECK = ['carState']
if __name__ == "__main__":
sm = messaging.SubMaster(TO_CHECK)
prev_t: dict[str, float] = {}
while True:
sm.update()
for s in TO_CHECK:
if sm.updated[s]:
t = sm.... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/measure_modeld_packet_drop.py | selfdrive/debug/measure_modeld_packet_drop.py | #!/usr/bin/env python3
import cereal.messaging as messaging
if __name__ == "__main__":
modeld_sock = messaging.sub_sock("modelV2")
last_frame_id = None
start_t: int | None = None
frame_cnt = 0
dropped = 0
while True:
m = messaging.recv_one(modeld_sock)
if m is None:
continue
frame_id =... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/print_docs_diff.py | selfdrive/debug/print_docs_diff.py | #!/usr/bin/env python3
import argparse
from collections import defaultdict
import difflib
import pickle
from opendbc.car.docs import get_all_car_docs
from opendbc.car.docs_definitions import Column
FOOTNOTE_TAG = "<sup>{}</sup>"
STAR_ICON = '<a href="##"><img valign="top" ' + \
'src="https://media.githubu... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/format_fingerprints.py | selfdrive/debug/format_fingerprints.py | #!/usr/bin/env python3
import jinja2
import os
from cereal import car
from openpilot.common.basedir import BASEDIR
from opendbc.car.interfaces import get_interface_attr
Ecu = car.CarParams.Ecu
CARS = get_interface_attr('CAR')
FW_VERSIONS = get_interface_attr('FW_VERSIONS')
FINGERPRINTS = get_interface_attr('FINGERPR... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/print_flags.py | selfdrive/debug/print_flags.py | #!/usr/bin/env python3
from opendbc.car.values import BRANDS
for brand in BRANDS:
all_flags = set()
for platform in brand:
if platform.config.flags != 0:
all_flags |= set(platform.config.flags)
if len(all_flags):
print(brand.__module__.split('.')[-2].upper() + ':')
for flag in sorted(all_flags... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/can_print_changes.py | selfdrive/debug/can_print_changes.py | #!/usr/bin/env python3
import argparse
import binascii
import time
from collections import defaultdict
import cereal.messaging as messaging
from openpilot.selfdrive.debug.can_table import can_table
from openpilot.tools.lib.logreader import LogIterable, LogReader
RED = '\033[91m'
CLEAR = '\033[0m'
def update(msgs, bu... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/clear_dtc.py | selfdrive/debug/clear_dtc.py | #!/usr/bin/env python3
import sys
import argparse
from subprocess import check_output, CalledProcessError
from opendbc.car.carlog import carlog
from opendbc.car.uds import UdsClient, MessageTimeoutError, SESSION_TYPE, DTC_GROUP_TYPE
from opendbc.car.structs import CarParams
from panda import Panda
parser = argparse.Ar... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/get_fingerprint.py | selfdrive/debug/get_fingerprint.py | #!/usr/bin/env python3
# simple script to get a vehicle fingerprint.
# Instructions:
# - connect to a Panda
# - run selfdrive/pandad/pandad
# - launching this script
# Note: it's very important that the car is in stock mode, in order to collect a complete fingerprint
# - since some messages are published at low fre... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/__init__.py | selfdrive/debug/__init__.py | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false | |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/debug_console.py | selfdrive/debug/debug_console.py | #!/usr/bin/env python3
import os
import sys
import time
import select
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
from panda import Panda # noqa: E402
setcolor = ["\033[1;32;40m", "\033[1;31;40m"]
unsetcolor = "\033[00m"
if __name__ == "__main__":
while True:
try:
p... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/show_matching_cars.py | selfdrive/debug/show_matching_cars.py | #!/usr/bin/env python3
from opendbc.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars
import cereal.messaging as messaging
# rav4 2019 and corolla tss2
fingerprint = {896: 8, 898: 8, 900: 6, 976: 1, 1541: 8, 902: 6, 905: 8, 810: 2, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1552: 8, 1553: 8, 1... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/set_car_params.py | selfdrive/debug/set_car_params.py | #!/usr/bin/env python3
import sys
from cereal import car
from openpilot.common.params import Params
from openpilot.tools.lib.route import Route
from openpilot.tools.lib.logreader import LogReader
if __name__ == "__main__":
CP = None
if len(sys.argv) > 1:
r = Route(sys.argv[1])
cps = [m for m in LogReader(... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/max_lat_accel.py | selfdrive/debug/max_lat_accel.py | #!/usr/bin/env python3
import argparse
import numpy as np
import matplotlib.pyplot as plt
from typing import NamedTuple
from openpilot.tools.lib.logreader import LogReader
from openpilot.selfdrive.locationd.models.pose_kf import EARTH_G
RLOG_MIN_LAT_ACTIVE = 50
RLOG_MIN_STEERING_UNPRESSED = 50
RLOG_MIN_REQUESTING_MAX ... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/touch_replay.py | selfdrive/debug/touch_replay.py | #!/usr/bin/env python3
import argparse
import numpy as np
import matplotlib.pyplot as plt
from openpilot.tools.lib.logreader import LogReader
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--width', default=2160, type=int)
parser.add_argument('--height', default=1080, type=i... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/check_can_parser_performance.py | selfdrive/debug/check_can_parser_performance.py | #!/usr/bin/env python3
import numpy as np
import time
from tqdm import tqdm
from cereal import car
from opendbc.car.tests.routes import CarTestRoute
from openpilot.selfdrive.car.tests.test_models import TestCarModelBase
from openpilot.selfdrive.pandad import can_capnp_to_list
from openpilot.tools.plotjuggler.juggle im... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/cycle_alerts.py | selfdrive/debug/cycle_alerts.py | #!/usr/bin/env python3
import time
import random
from cereal import car, log
import cereal.messaging as messaging
from opendbc.car.honda.interface import CarInterface
from openpilot.common.realtime import DT_CTRL
from openpilot.selfdrive.selfdrived.events import ET, Events
from openpilot.selfdrive.selfdrived.alertmana... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/hyundai_enable_radar_points.py | selfdrive/debug/hyundai_enable_radar_points.py | #!/usr/bin/env python3
"""Some Hyundai radars can be reconfigured to output (debug) radar points on bus 1.
Reconfiguration is done over UDS by reading/writing to 0x0142 using the Read/Write Data By Identifier
endpoints (0x22 & 0x2E). This script checks your radar firmware version against a list of known
firmware versio... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/can_printer.py | selfdrive/debug/can_printer.py | #!/usr/bin/env python3
import argparse
import binascii
import time
from collections import defaultdict
import cereal.messaging as messaging
def can_printer(bus, max_msg, addr, ascii_decode):
logcan = messaging.sub_sock('can', addr=addr)
start = time.monotonic()
lp = time.monotonic()
msgs = defaultdict(list)... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/check_timings.py | selfdrive/debug/check_timings.py | #!/usr/bin/env python3
import sys
import time
import numpy as np
import datetime
from collections.abc import MutableSequence
from collections import defaultdict
import cereal.messaging as messaging
if __name__ == "__main__":
ts: defaultdict[str, MutableSequence[float]] = defaultdict(list)
socks = {s: messaging.s... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
ajouatom/openpilot | https://github.com/ajouatom/openpilot/blob/b0eab6e8de2d57522b657426fbb794f2d736c75c/selfdrive/debug/car/ecu_addrs.py | selfdrive/debug/car/ecu_addrs.py | #!/usr/bin/env python3
import argparse
import time
import cereal.messaging as messaging
from opendbc.car.carlog import carlog
from opendbc.car.ecu_addrs import get_all_ecu_addrs
from openpilot.common.params import Params
from openpilot.selfdrive.car.card import can_comm_callbacks, obd_callback
if __name__ == "__main_... | python | MIT | b0eab6e8de2d57522b657426fbb794f2d736c75c | 2026-01-05T07:04:53.428285Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.