Submodules module, sendcan)[source], sendcan)[source][source], controller_available, fw_seen)[source][source] module, sendcan, bus=0, addr=2000, com_cont_req=b'(\x83\x01', timeout=0.1, retry=10, debug=False)[source]

Silence an ECU by disabling sending and receiving messages using UDS 0x28. The ECU will stay silent as long as openpilot keeps sending Tester Present.

This is used to disable the radar in some cars. Openpilot will emulate the radar. WARNING: THIS DISABLES AEB! module List[CarInfo], template_fn: str, only_tier_cols: bool) str[source] bool = False) List[CarInfo][source] bool = False) Dict[Enum, int][source] List[CarInfo]) Dict[str, List[CarInfo]][source] module

class, column, star)

Bases: tuple


Alias for field number 1


Alias for field number 2


Alias for field number 0

class str, package: str, video_link: Union[str, NoneType] = None, footnotes: List[enum.Enum] = <factory>, min_steer_speed: Union[float, NoneType] = None, min_enable_speed: Union[float, NoneType] = None, harness: Union[enum.Enum, NoneType] = None)[source]

Bases: object

footnotes: List[Enum]
get_column(column: Column, star_icon: str, footnote_tag: str) str[source]
harness: Optional[Enum] = None
init(CP: <capnp.lib.capnp._StructModule object at 0x7efd62b23700>, all_footnotes: ~typing.Dict[~enum.Enum, int])[source]
min_enable_speed: Optional[float] = None
min_steer_speed: Optional[float] = None
name: str
package: str

Bases: Enum

An enumeration.

FSR_STEERING = 'Steer to 0'
LONGITUDINAL = 'openpilot ACC'
MAKE = 'Make'
MODEL = 'Model'
PACKAGE = 'Supported Package'
STEERING_TORQUE = 'Steering Torque'

Bases: Enum

An enumeration.

bosch_a = 'Honda Bosch A'
bosch_b = 'Honda Bosch B'
custom = 'Developer'
fca = 'FCA'
hyundai_a = 'Hyundai A'
hyundai_b = 'Hyundai B'
hyundai_c = 'Hyundai C'
hyundai_d = 'Hyundai D'
hyundai_e = 'Hyundai E'
hyundai_f = 'Hyundai F'
hyundai_g = 'Hyundai G'
hyundai_h = 'Hyundai H'
hyundai_i = 'Hyundai I'
hyundai_j = 'Hyundai J'
hyundai_k = 'Hyundai K'
hyundai_l = 'Hyundai L'
hyundai_m = 'Hyundai M'
hyundai_n = 'Hyundai N'
hyundai_o = 'Hyundai O'
hyundai_p = 'Hyundai P'
j533 = 'J533'
mazda = 'Mazda'
nidec = 'Honda Nidec'
nissan_a = 'Nissan A'
nissan_b = 'Nissan B'
none = 'None'
obd_ii = 'OBD-II'
ram = 'Ram'
subaru = 'Subaru'
toyota = 'Toyota'
vw = 'VW'

Bases: Enum

An enumeration.

EMPTY = 'empty'
FULL = 'full'
HALF = 'half'

Bases: Enum

An enumeration.

GOLD = 0
SILVER = 1 List[Enum], column: Column) List[Enum][source][source] str) Tuple[str, str, str][source] module SubSocket, sendcan: PubSocket, bus: int, timeout: float = 1, debug: bool = True) Set[Tuple[int, Optional[int], int]][source] SubSocket, sendcan: PubSocket, queries: Set[Tuple[int, Optional[int], int]], responses: Set[Tuple[int, Optional[int], int]], timeout: float = 1, debug: bool = False) Set[Tuple[int, Optional[int], int]][source] _DynamicStructReader, subaddr: Optional[int] = None) bool[source], bus, subaddr=None)[source] module[source]

Returns a list of all known car strings.[source]

Returns a list of all known car strings, FPv1 only., candidate_cars)[source]

Removes cars that could not have sent msg.


msg: A cereal/log CanData message from the car. candidate_cars: A list of cars to consider.


A list containing the subset of candidate_cars that could have sent msg., car_fingerprint)[source] module

class str, request: List[bytes], response: List[bytes], whitelist_ecus: List[int] = <factory>, rx_offset: int = 8, bus: int = 1)[source]

Bases: object

brand: str
bus: int = 1
request: List[bytes]
response: List[bytes]
rx_offset: int = 8
whitelist_ecus: List[int], filter_brand=None)[source], n=128)[source][source][source]

Returns dictionary of brands and matches with ECUs in their FW versions, sendcan, query_brand=None, extra=None, timeout=0.1, debug=False, progress=False)[source], sendcan, ecu_rx_addrs, timeout=0.1, debug=False, progress=False)[source]

Queries for FW versions ordering brands by likelihood, breaks when exact match is found, sendcan)[source], allow_fuzzy=True)[source][source]

Do an exact FW match. Returns all cars that match the given FW versions for a list of “essential” ECUs. If an ECU is not considered essential the FW version can be missing to get a fingerprint, but if it’s present it needs to match the database., log=True, exclude=None)[source]

Do a fuzzy FW match. This function will return a match, and the number of firmware version that were matched uniquely to that specific car. If multiple ECUs uniquely match to different cars the match is rejected.[source] module

class, CarController, CarState)[source]

Bases: ABC

abstract apply(c: <capnp.lib.capnp._StructModule object at 0x7efd62b23220>) List[bytes]][source]
static configure_torque_tune(candidate, tune, steering_angle_deadzone_deg=0.0, use_steering_angle=True)[source]
create_common_events(cs_out, extra_gears=None, pcm_enable=True, allow_enable=True)[source]
abstract static get_params(candidate, fingerprint={0: {}, 1: {}, 2: {}, 3: {}}, car_fw=None, disable_radar=False)[source]
static get_pid_accel_limits(CP, current_speed, cruise_speed)[source]
static get_std_params(candidate, fingerprint)[source]
static get_steer_feedforward_default(desired_angle, v_ego)[source]
static init(CP, logcan, sendcan)[source]
update(c: <capnp.lib.capnp._StructModule object at 0x7efd62b23220>, can_strings: ~typing.List[bytes]) <capnp.lib.capnp._StructModule object at 0x7efd62b11970>[source]

Bases: ABC

static get_adas_can_parser(CP)[source]
static get_body_can_parser(CP)[source]
static get_cam_can_parser(CP)[source]
static get_loopback_can_parser(CP)[source]
get_wheel_speeds(fl, fr, rl, rr, unit=0.2777777777777778)[source]
static parse_gear_shifter(gear: Optional[str]) <capnp.lib.capnp._EnumModule object at 0x7efd62b11d00>[source]
update_blinker_from_lamp(blinker_time: int, left_blinker_lamp: bool, right_blinker_lamp: bool)[source]

Update blinkers from lights. Enable output when light was seen within the last blinker_time iterations

update_blinker_from_stalk(blinker_time: int, left_blinker_stalk: bool, right_blinker_stalk: bool)[source]

Update blinkers from stalk position. When stalk is seen the blinker will be on for at least blinker_time, or until the stalk is turned off, whichever is longer. If the opposite stalk direction is seen the blinker is forced to the other side. On a rising edge of the stalk the timeout is reset.


Bases: ABC

update(can_strings)[source] str, combine_brands: bool = False, ignore_none: bool = False) Dict[str, Any][source][source] module

class, logcan, bus, addrs, request, response, response_offset=8, functional_addr=False, debug=False, response_pending_timeout=10)[source]

Bases: object

get_data(timeout, total_timeout=60.0)[source]

Drain can socket and sort messages into buffers based on address module, sendcan, bus, timeout=0.1, retry=5, debug=False)[source] str)[source]

Module contents


Bases: object

MASS = 1462.0
WHEELBASE = 2.7, apply_torque_last, driver_torque, LIMITS)[source], apply_torque_last, motor_torque, LIMITS)[source][source] _DynamicListBuilder, pcm_cruise: bool = False) List[int][source] int, prev_but: int, buttons_dict: Dict[int, _EnumModule], unpressed: int = 0) _DynamicStructBuilder[source], gas_amount, idx)[source], radar_dbc, chassis_dbc=None, body_dbc=None) Dict[str, str][source][source], safety_param=None)[source], dat, bus)[source], wheelbase)[source], wheelbase, center_to_front, tire_stiffness_factor=1.0)[source]