IQ.Pilot Release Commit @ 2f37564
This commit is contained in:
@@ -11,7 +11,7 @@ from iqdbc.car.mock.values import CAR as MOCK
|
||||
from iqdbc.car.values import BRANDS
|
||||
from iqdbc.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN
|
||||
|
||||
from iqdbc.iqpilot.car.interfaces import setup_interfaces as iqpilot_interfaces
|
||||
from iqdbc.lvbs.car.interfaces import apply_iq_car_config as iqpilot_interfaces
|
||||
|
||||
FRAME_FINGERPRINT = 100 # 1s
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@ from iqdbc.car.chrysler import chryslercan
|
||||
from iqdbc.car.chrysler.values import RAM_CARS, CarControllerParams, ChryslerFlags, RAM_DT
|
||||
from iqdbc.car.interfaces import CarControllerBase
|
||||
|
||||
from iqdbc.iqpilot.car.chrysler.carcontroller_ext import CarControllerExt
|
||||
from iqdbc.iqpilot.car.chrysler.aol import AolCarController
|
||||
from iqdbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ
|
||||
from iqdbc.lvbs.car.chrysler.iq_carcontroller import IQCarController
|
||||
from iqdbc.lvbs.car.chrysler.aol import AolCarController
|
||||
from iqdbc.lvbs.car.chrysler.iq_values import ChryslerFlagsIQ
|
||||
|
||||
|
||||
class CarController(CarControllerBase, AolCarController, CarControllerExt):
|
||||
class CarController(CarControllerBase, AolCarController, IQCarController):
|
||||
def __init__(self, dbc_names, CP, CP_IQ):
|
||||
CarControllerBase.__init__(self, dbc_names, CP, CP_IQ)
|
||||
AolCarController.__init__(self)
|
||||
CarControllerExt.__init__(self, CP, CP_IQ)
|
||||
IQCarController.__init__(self, CP, CP_IQ)
|
||||
self.apply_torque_last = 0
|
||||
|
||||
self.hud_count = 0
|
||||
@@ -58,7 +58,7 @@ class CarController(CarControllerBase, AolCarController, CarControllerExt):
|
||||
# TODO: can we make this more sane? why is it different for all the cars?
|
||||
lkas_control_bit = self.lkas_control_bit_prev
|
||||
if self.CP_IQ.flags & ChryslerFlagsIQ.NO_MIN_STEERING_SPEED or self.CP.carFingerprint in RAM_DT:
|
||||
lkas_control_bit = CarControllerExt.get_lkas_control_bit(self, CS, CC, lkas_control_bit)
|
||||
lkas_control_bit = IQCarController.get_lkas_control_bit(self, CS, CC, lkas_control_bit)
|
||||
elif CS.out.vEgo > self.CP.minSteerSpeed:
|
||||
lkas_control_bit = True
|
||||
elif self.CP.flags & ChryslerFlags.HIGHER_MIN_STEERING_SPEED:
|
||||
|
||||
@@ -4,17 +4,17 @@ from iqdbc.car.chrysler.values import DBC, STEER_THRESHOLD, RAM_CARS
|
||||
from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.car.interfaces import CarStateBase
|
||||
|
||||
from iqdbc.iqpilot.car.chrysler.aol import AolCarState
|
||||
from iqdbc.iqpilot.car.chrysler.carstate_ext import CarStateExt
|
||||
from iqdbc.lvbs.car.chrysler.aol import AolCarState
|
||||
from iqdbc.lvbs.car.chrysler.iq_carstate import IQCarState
|
||||
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
|
||||
|
||||
class CarState(CarStateBase, AolCarState, CarStateExt):
|
||||
class CarState(CarStateBase, AolCarState, IQCarState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
AolCarState.__init__(self, CP, CP_IQ)
|
||||
CarStateExt.__init__(self, CP, CP_IQ)
|
||||
IQCarState.__init__(self, CP, CP_IQ)
|
||||
self.CP = CP
|
||||
can_define = CANDefine(DBC[CP.carFingerprint][Bus.pt])
|
||||
|
||||
@@ -102,7 +102,7 @@ class CarState(CarStateBase, AolCarState, CarStateExt):
|
||||
self.button_counter = cp.vl["CRUISE_BUTTONS"]["COUNTER"]
|
||||
|
||||
AolCarState.update_aol(self, ret, can_parsers)
|
||||
CarStateExt.update(self, ret, ret_iq, can_parsers)
|
||||
IQCarState.update(self, ret, ret_iq, can_parsers)
|
||||
|
||||
ret.buttonEvents = [
|
||||
*create_button_events(self.distance_button, prev_distance_button, {1: ButtonType.gapAdjustCruise}),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE."""
|
||||
from iqdbc.car.structs import CarParams
|
||||
from iqdbc.car.chrysler.values import CAR
|
||||
from iqdbc.iqpilot.car.fingerprints_ext import merge_fw_versions
|
||||
from iqdbc.iqpilot.car.chrysler.fingerprints_ext import FW_VERSIONS_EXT
|
||||
from iqdbc.lvbs.car.iq_fingerprints import extend_fw_versions
|
||||
from iqdbc.lvbs.car.chrysler.iq_fingerprints import FW_VERSIONS_EXT
|
||||
|
||||
|
||||
Ecu = CarParams.Ecu
|
||||
@@ -791,4 +791,4 @@ FW_VERSIONS = {
|
||||
|
||||
|
||||
|
||||
FW_VERSIONS = merge_fw_versions(FW_VERSIONS, FW_VERSIONS_EXT)
|
||||
FW_VERSIONS = extend_fw_versions(FW_VERSIONS, FW_VERSIONS_EXT)
|
||||
|
||||
@@ -5,7 +5,7 @@ from iqdbc.car.chrysler.carstate import CarState
|
||||
from iqdbc.car.chrysler.radar_interface import RadarInterface
|
||||
from iqdbc.car.chrysler.values import CAR, RAM_HD, RAM_DT, RAM_CARS, ChryslerFlags, ChryslerSafetyFlags
|
||||
from iqdbc.car.interfaces import CarInterfaceBase
|
||||
from iqdbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ
|
||||
from iqdbc.lvbs.car.chrysler.iq_values import ChryslerFlagsIQ
|
||||
|
||||
|
||||
class CarInterface(CarInterfaceBase):
|
||||
|
||||
@@ -5,8 +5,8 @@ from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.gm.values import DBC, AccState, CruiseButtons, STEER_THRESHOLD, SDGM_CAR, ALT_ACCS
|
||||
|
||||
from iqdbc.iqpilot.car.gm.carstate_ext import CarStateExt
|
||||
from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ
|
||||
from iqdbc.lvbs.car.gm.iq_carstate import IQCarState
|
||||
from iqdbc.lvbs.car.gm.iq_values import GMFlagsIQ
|
||||
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
TransmissionType = structs.CarParams.TransmissionType
|
||||
@@ -18,10 +18,10 @@ BUTTONS_DICT = {CruiseButtons.RES_ACCEL: ButtonType.accelCruise, CruiseButtons.D
|
||||
CruiseButtons.MAIN: ButtonType.mainCruise, CruiseButtons.CANCEL: ButtonType.cancel}
|
||||
|
||||
|
||||
class CarState(CarStateBase, CarStateExt):
|
||||
class CarState(CarStateBase, IQCarState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
CarStateExt.__init__(self, CP, CP_IQ)
|
||||
IQCarState.__init__(self, CP, CP_IQ)
|
||||
can_define = CANDefine(DBC[CP.carFingerprint][Bus.pt])
|
||||
self.shifter_values = can_define.dv["ECMPRDNL2"]["PRNDL2"]
|
||||
self.cluster_speed_hyst_gap = CV.KPH_TO_MS / 2.
|
||||
@@ -163,7 +163,7 @@ class CarState(CarStateBase, CarStateExt):
|
||||
if ret.vEgo < self.CP.minSteerSpeed:
|
||||
ret.lowSpeedAlert = True
|
||||
|
||||
CarStateExt.update(self, ret, can_parsers)
|
||||
IQCarState.update(self, ret, can_parsers)
|
||||
|
||||
return ret, ret_iq
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# ruff: noqa: E501
|
||||
""" AUTO-FORMATTED USING iqdbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE."""
|
||||
from iqdbc.car.gm.values import CAR
|
||||
from iqdbc.iqpilot.car.fingerprints_ext import merge_fingerprints
|
||||
from iqdbc.iqpilot.car.gm.fingerprints_ext import FINGERPRINTS_EXT
|
||||
from iqdbc.lvbs.car.iq_fingerprints import extend_fingerprints
|
||||
from iqdbc.lvbs.car.gm.iq_fingerprints import FINGERPRINTS_EXT
|
||||
|
||||
# Trailblazer also matches as a SILVERADO, TODO: split with fw versions
|
||||
# FIXME: There are Equinox users with different message lengths, specifically 304 and 320
|
||||
@@ -81,4 +81,4 @@ FW_VERSIONS: dict[str, dict[tuple, list[bytes]]] = {
|
||||
}
|
||||
|
||||
|
||||
FINGERPRINTS = merge_fingerprints(FINGERPRINTS, FINGERPRINTS_EXT)
|
||||
FINGERPRINTS = extend_fingerprints(FINGERPRINTS, FINGERPRINTS_EXT)
|
||||
|
||||
@@ -10,8 +10,8 @@ from iqdbc.car.gm.radar_interface import RadarInterface, RADAR_HEADER_MSG, CAMER
|
||||
from iqdbc.car.gm.values import CAR, CarControllerParams, EV_CAR, CAMERA_ACC_CAR, SDGM_CAR, ALT_ACCS, CanBus, GMSafetyFlags
|
||||
from iqdbc.car.interfaces import CarInterfaceBase, TorqueFromLateralAccelCallbackType, LateralAccelFromTorqueCallbackType
|
||||
|
||||
from iqdbc.iqpilot.car.gm.interface_ext import CarInterfaceExt
|
||||
from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ, GMSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.gm.iq_interface import IQCarInterface
|
||||
from iqdbc.lvbs.car.gm.iq_values import GMFlagsIQ, GMSafetyFlagsIQ
|
||||
|
||||
TransmissionType = structs.CarParams.TransmissionType
|
||||
NetworkLocation = structs.CarParams.NetworkLocation
|
||||
@@ -30,7 +30,7 @@ NON_LINEAR_TORQUE_PARAMS = {
|
||||
}
|
||||
|
||||
|
||||
class CarInterface(CarInterfaceBase, CarInterfaceExt):
|
||||
class CarInterface(CarInterfaceBase, IQCarInterface):
|
||||
CarState = CarState
|
||||
CarController = CarController
|
||||
RadarInterface = RadarInterface
|
||||
@@ -40,7 +40,7 @@ class CarInterface(CarInterfaceBase, CarInterfaceExt):
|
||||
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarInterfaceBase.__init__(self, CP, CP_IQ)
|
||||
CarInterfaceExt.__init__(self, CP, CarInterfaceBase)
|
||||
IQCarInterface.__init__(self, CP, CarInterfaceBase)
|
||||
|
||||
@staticmethod
|
||||
def get_pid_accel_limits(CP, CP_IQ, current_speed, cruise_speed):
|
||||
|
||||
@@ -4,7 +4,7 @@ from enum import Enum, IntFlag
|
||||
from iqdbc.car import Bus, PlatformConfig, DbcDict, Platforms, CarSpecs
|
||||
from iqdbc.car.structs import CarParams
|
||||
from iqdbc.car.docs_definitions import CarDocs, CarFootnote, CarHarness, CarParts, Column, SupportType
|
||||
from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ
|
||||
from iqdbc.lvbs.car.gm.iq_values import GMFlagsIQ
|
||||
from iqdbc.car.fw_query_definitions import FwQueryConfig, Request, StdQueries
|
||||
|
||||
Ecu = CarParams.Ecu
|
||||
|
||||
@@ -8,8 +8,8 @@ from iqdbc.car.honda.values import CAR, CruiseButtons, HONDA_BOSCH, HONDA_BOSCH_
|
||||
HONDA_BOSCH_TJA_CONTROL, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams
|
||||
from iqdbc.car.interfaces import CarControllerBase
|
||||
|
||||
from iqdbc.iqpilot.car.honda.aol import AolCarController
|
||||
from iqdbc.iqpilot.car.honda.gas_interceptor import GasInterceptorCarController
|
||||
from iqdbc.lvbs.car.honda.aol import AolCarController
|
||||
from iqdbc.lvbs.car.honda.gas_interceptor import GasInterceptorCarController
|
||||
|
||||
VisualAlert = structs.CarControl.HUDControl.VisualAlert
|
||||
LongCtrlState = structs.CarControl.Actuators.LongControlState
|
||||
|
||||
@@ -10,7 +10,7 @@ from iqdbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, HONDA
|
||||
HondaFlags, CruiseButtons, CruiseSettings, GearShifter, CarControllerParams
|
||||
from iqdbc.car.interfaces import CarStateBase
|
||||
|
||||
from iqdbc.iqpilot.car.honda.carstate_ext import CarStateExt
|
||||
from iqdbc.lvbs.car.honda.iq_carstate import IQCarState
|
||||
|
||||
TransmissionType = structs.CarParams.TransmissionType
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
@@ -20,10 +20,10 @@ BUTTONS_DICT = {CruiseButtons.RES_ACCEL: ButtonType.accelCruise, CruiseButtons.D
|
||||
SETTINGS_BUTTONS_DICT = {CruiseSettings.DISTANCE: ButtonType.gapAdjustCruise, CruiseSettings.LKAS: ButtonType.lkas}
|
||||
|
||||
|
||||
class CarState(CarStateBase, CarStateExt):
|
||||
class CarState(CarStateBase, IQCarState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
CarStateExt.__init__(self, CP, CP_IQ)
|
||||
IQCarState.__init__(self, CP, CP_IQ)
|
||||
can_define = CANDefine(DBC[CP.carFingerprint][Bus.pt])
|
||||
|
||||
if CP.transmissionType != TransmissionType.manual:
|
||||
@@ -246,7 +246,7 @@ class CarState(CarStateBase, CarStateExt):
|
||||
*create_button_events(self.cruise_setting, prev_cruise_setting, SETTINGS_BUTTONS_DICT),
|
||||
]
|
||||
|
||||
CarStateExt.update(self, ret, can_parsers)
|
||||
IQCarState.update(self, ret, can_parsers)
|
||||
|
||||
return ret, ret_iq
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
from iqdbc.car.structs import CarParams
|
||||
from iqdbc.car.honda.values import CAR
|
||||
|
||||
from iqdbc.iqpilot.car.fingerprints_ext import merge_fw_versions
|
||||
from iqdbc.iqpilot.car.honda.fingerprints_ext import FW_VERSIONS_EXT
|
||||
from iqdbc.lvbs.car.iq_fingerprints import extend_fw_versions
|
||||
from iqdbc.lvbs.car.honda.iq_fingerprints import FW_VERSIONS_EXT
|
||||
|
||||
Ecu = CarParams.Ecu
|
||||
|
||||
@@ -1098,4 +1098,4 @@ FW_VERSIONS = {
|
||||
},
|
||||
}
|
||||
|
||||
FW_VERSIONS = merge_fw_versions(FW_VERSIONS, FW_VERSIONS_EXT)
|
||||
FW_VERSIONS = extend_fw_versions(FW_VERSIONS, FW_VERSIONS_EXT)
|
||||
|
||||
@@ -2,7 +2,7 @@ from iqdbc.car import CanBusBase
|
||||
from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.car.honda.values import (HondaFlags, HONDA_BOSCH, HONDA_BOSCH_ALT_RADAR, HONDA_BOSCH_RADARLESS,
|
||||
HONDA_BOSCH_CANFD, CarControllerParams)
|
||||
from iqdbc.iqpilot.car.honda.values_ext import HondaFlagsIQ
|
||||
from iqdbc.lvbs.car.honda.iq_values import HondaFlagsIQ
|
||||
|
||||
# CAN bus layout with relay
|
||||
# 0 = ACC-CAN - radar side
|
||||
|
||||
@@ -11,7 +11,7 @@ from iqdbc.car.honda.carstate import CarState
|
||||
from iqdbc.car.honda.radar_interface import RadarInterface
|
||||
from iqdbc.car.interfaces import CarInterfaceBase
|
||||
|
||||
from iqdbc.iqpilot.car.honda.values_ext import HondaFlagsIQ, HondaSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.honda.iq_values import HondaFlagsIQ, HondaSafetyFlagsIQ
|
||||
|
||||
TransmissionType = structs.CarParams.TransmissionType
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ from iqdbc.car.values import PLATFORMS
|
||||
from iqdbc.can import CANParser
|
||||
from iqdbc.car.carlog import carlog
|
||||
|
||||
from iqdbc.iqpilot.car.interfaces import CarInterfaceBaseIQ
|
||||
from iqdbc.lvbs.car.interfaces import CarInterfaceBaseIQ
|
||||
|
||||
GearShifter = structs.CarState.GearShifter
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
|
||||
@@ -6,17 +6,17 @@ from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.nissan.values import CAR, DBC, CarControllerParams
|
||||
|
||||
from iqdbc.iqpilot.car.nissan.carstate_ext import CarStateExt
|
||||
from iqdbc.lvbs.car.nissan.iq_carstate import IQCarState
|
||||
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
|
||||
TORQUE_SAMPLES = 12
|
||||
|
||||
|
||||
class CarState(CarStateBase, CarStateExt):
|
||||
class CarState(CarStateBase, IQCarState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
CarStateExt.__init__(self, CP, CP_IQ)
|
||||
IQCarState.__init__(self, CP, CP_IQ)
|
||||
can_define = CANDefine(DBC[CP.carFingerprint][Bus.pt])
|
||||
|
||||
self.lkas_hud_msg = {}
|
||||
@@ -130,7 +130,7 @@ class CarState(CarStateBase, CarStateExt):
|
||||
self.lkas_hud_msg = copy.copy(cp_adas.vl["PROPILOT_HUD"])
|
||||
self.lkas_hud_info_msg = copy.copy(cp_adas.vl["PROPILOT_HUD_INFO_MSG"])
|
||||
|
||||
CarStateExt.update(self, ret, ret_iq, can_parsers)
|
||||
IQCarState.update(self, ret, ret_iq, can_parsers)
|
||||
|
||||
ret.buttonEvents = [
|
||||
*create_button_events(self.distance_button, prev_distance_button, {1: ButtonType.gapAdjustCruise}),
|
||||
|
||||
@@ -3,7 +3,7 @@ from iqdbc.car.interfaces import CarInterfaceBase
|
||||
from iqdbc.car.nissan.carcontroller import CarController
|
||||
from iqdbc.car.nissan.carstate import CarState
|
||||
from iqdbc.car.nissan.values import CAR, NissanSafetyFlags
|
||||
from iqdbc.iqpilot.car.nissan.values import NissanSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.nissan.values import NissanSafetyFlagsIQ
|
||||
|
||||
class CarInterface(CarInterfaceBase):
|
||||
CarState = CarState
|
||||
|
||||
@@ -6,7 +6,7 @@ from iqdbc.car.interfaces import CarControllerBase
|
||||
from iqdbc.car.rivian.riviancan import create_lka_steering, create_longitudinal, create_wheel_touch, create_adas_status
|
||||
from iqdbc.car.rivian.values import CarControllerParams
|
||||
|
||||
from iqdbc.iqpilot.car.rivian.aol import AolCarController
|
||||
from iqdbc.lvbs.car.rivian.aol import AolCarController
|
||||
|
||||
|
||||
class CarController(CarControllerBase, AolCarController):
|
||||
|
||||
@@ -4,15 +4,15 @@ from iqdbc.car import Bus, structs
|
||||
from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.rivian.values import DBC, GEAR_MAP
|
||||
from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.iqpilot.car.rivian.carstate_ext import CarStateExt
|
||||
from iqdbc.lvbs.car.rivian.iq_carstate import IQCarState
|
||||
|
||||
GearShifter = structs.CarState.GearShifter
|
||||
|
||||
|
||||
class CarState(CarStateBase, CarStateExt):
|
||||
class CarState(CarStateBase, IQCarState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
CarStateExt.__init__(self, CP, CP_IQ)
|
||||
IQCarState.__init__(self, CP, CP_IQ)
|
||||
self.last_speed = 30
|
||||
|
||||
self.acm_lka_hba_cmd = None
|
||||
@@ -95,7 +95,7 @@ class CarState(CarStateBase, CarStateExt):
|
||||
self.sccm_wheel_touch = copy.copy(cp.vl["SCCM_WheelTouch"])
|
||||
self.vdm_adas_status = copy.copy(cp.vl["VDM_AdasSts"])
|
||||
|
||||
CarStateExt.update(self, ret, can_parsers)
|
||||
IQCarState.update(self, ret, can_parsers)
|
||||
|
||||
return ret, ret_iq
|
||||
|
||||
@@ -105,5 +105,5 @@ class CarState(CarStateBase, CarStateExt):
|
||||
Bus.pt: CANParser(DBC[CP.carFingerprint][Bus.pt], [], 0),
|
||||
Bus.adas: CANParser(DBC[CP.carFingerprint][Bus.pt], [], 1),
|
||||
Bus.cam: CANParser(DBC[CP.carFingerprint][Bus.pt], [], 2),
|
||||
**CarStateExt.get_parser(CP, CP_IQ),
|
||||
**IQCarState.get_parser(CP, CP_IQ),
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ from iqdbc.car.rivian.carcontroller import CarController
|
||||
from iqdbc.car.rivian.carstate import CarState
|
||||
from iqdbc.car.rivian.radar_interface import RadarInterface
|
||||
from iqdbc.car.rivian.values import RivianSafetyFlags
|
||||
from iqdbc.iqpilot.car.rivian.values import RivianFlagsIQ
|
||||
from iqdbc.lvbs.car.rivian.values import RivianFlagsIQ
|
||||
|
||||
|
||||
class CarInterface(CarInterfaceBase):
|
||||
|
||||
@@ -6,7 +6,7 @@ from iqdbc.car.interfaces import CarControllerBase
|
||||
from iqdbc.car.subaru import subarucan
|
||||
from iqdbc.car.subaru.values import DBC, GLOBAL_ES_ADDR, CanBus, CarControllerParams, SubaruFlags
|
||||
|
||||
from iqdbc.iqpilot.car.subaru.stop_and_go import SnGCarController
|
||||
from iqdbc.lvbs.car.subaru.stop_and_go import IQStopAndGoController
|
||||
|
||||
# FIXME: These limits aren't exact. The real limit is more than likely over a larger time period and
|
||||
# involves the total steering angle change rather than rate, but these limits work well for now
|
||||
@@ -14,10 +14,10 @@ MAX_STEER_RATE = 25 # deg/s
|
||||
MAX_STEER_RATE_FRAMES = 7 # tx control frames needed before torque can be cut
|
||||
|
||||
|
||||
class CarController(CarControllerBase, SnGCarController):
|
||||
class CarController(CarControllerBase, IQStopAndGoController):
|
||||
def __init__(self, dbc_names, CP, CP_IQ):
|
||||
CarControllerBase.__init__(self, dbc_names, CP, CP_IQ)
|
||||
SnGCarController.__init__(self, CP, CP_IQ)
|
||||
IQStopAndGoController.__init__(self, CP, CP_IQ)
|
||||
self.apply_torque_last = 0
|
||||
|
||||
self.cruise_button_prev = 0
|
||||
@@ -139,7 +139,7 @@ class CarController(CarControllerBase, SnGCarController):
|
||||
if self.frame % 2 == 0:
|
||||
can_sends.append(subarucan.create_es_static_2(self.packer))
|
||||
|
||||
can_sends.extend(SnGCarController.create_stop_and_go(self, self.packer, CC, CS, self.frame))
|
||||
can_sends.extend(IQStopAndGoController.create_stop_and_go(self, self.packer, CC, CS, self.frame))
|
||||
|
||||
new_actuators = actuators.as_builder()
|
||||
new_actuators.torque = self.apply_torque_last / self.p.STEER_MAX
|
||||
|
||||
@@ -6,15 +6,15 @@ from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.subaru.values import DBC, CanBus, SubaruFlags
|
||||
from iqdbc.car import CanSignalRateCalculator
|
||||
|
||||
from iqdbc.iqpilot.car.subaru.aol import AolCarState
|
||||
from iqdbc.iqpilot.car.subaru.stop_and_go import SnGCarState
|
||||
from iqdbc.lvbs.car.subaru.aol import AolCarState
|
||||
from iqdbc.lvbs.car.subaru.stop_and_go import IQStopAndGoState
|
||||
|
||||
|
||||
class CarState(CarStateBase, AolCarState, SnGCarState):
|
||||
class CarState(CarStateBase, AolCarState, IQStopAndGoState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
AolCarState.__init__(self, CP, CP_IQ)
|
||||
SnGCarState.__init__(self, CP, CP_IQ)
|
||||
IQStopAndGoState.__init__(self, CP, CP_IQ)
|
||||
can_define = CANDefine(DBC[CP.carFingerprint][Bus.pt])
|
||||
self.shifter_values = can_define.dv["Transmission"]["Gear"]
|
||||
|
||||
@@ -144,7 +144,7 @@ class CarState(CarStateBase, AolCarState, SnGCarState):
|
||||
self.es_infotainment_msg = copy.copy(cp_cam.vl["ES_Infotainment"])
|
||||
|
||||
AolCarState.update_aol(self, ret, can_parsers)
|
||||
SnGCarState.update(self, ret, can_parsers)
|
||||
IQStopAndGoState.update(self, ret, can_parsers)
|
||||
|
||||
return ret, ret_iq
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ from iqdbc.car.tesla.teslacan import TeslaCAN
|
||||
from iqdbc.car.tesla.values import CarControllerParams
|
||||
from iqdbc.car.vehicle_model import VehicleModel
|
||||
from openpilot.iqpilot.selfdrive.car.enhanced_stock_longitudinal_control import get_set_speed_kph_from_params
|
||||
from iqdbc.iqpilot.car.tesla.coop_steering import CoopSteeringCarController
|
||||
from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ
|
||||
from iqdbc.lvbs.car.tesla.coop_steering import CoopSteeringCarController
|
||||
from iqdbc.lvbs.car.tesla.values import TeslaFlagsIQ
|
||||
|
||||
|
||||
def get_safety_CP():
|
||||
|
||||
@@ -6,8 +6,8 @@ from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.tesla import TESLA_BLINKERS
|
||||
from iqdbc.car.tesla.values import DBC, CANBUS, GEAR_MAP, STEER_THRESHOLD, TeslaFlags
|
||||
|
||||
from iqdbc.iqpilot.car.tesla.carstate_ext import CarStateExt
|
||||
from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ
|
||||
from iqdbc.lvbs.car.tesla.iq_carstate import IQCarState
|
||||
from iqdbc.lvbs.car.tesla.values import TeslaFlagsIQ
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.system.proprietary_runtime._verified_import import import_verified_module
|
||||
|
||||
@@ -16,10 +16,10 @@ vehicle_state = import_verified_module("iqpilot_alc_private", "iqpilot_private.k
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
|
||||
|
||||
class CarState(CarStateBase, CarStateExt):
|
||||
class CarState(CarStateBase, IQCarState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
CarStateExt.__init__(self, CP, CP_IQ)
|
||||
IQCarState.__init__(self, CP, CP_IQ)
|
||||
self.can_define = CANDefine(DBC[CP.carFingerprint][Bus.party])
|
||||
self.shifter_values = self.can_define.dv["DI_systemStatus"]["DI_gear"]
|
||||
|
||||
@@ -159,7 +159,7 @@ class CarState(CarStateBase, CarStateExt):
|
||||
if TESLA_BLINKERS and Bus.cam in can_parsers:
|
||||
self.das_body_controls_dat = bytes(can_parsers[Bus.cam].dat.get(0x3E9, b""))
|
||||
|
||||
CarStateExt.update(self, ret, ret_iq, can_parsers)
|
||||
IQCarState.update(self, ret, ret_iq, can_parsers)
|
||||
if ret.odometer > 0.0:
|
||||
ret.odometer = self._odometer_store.record(ret.odometer) or 0.0
|
||||
|
||||
@@ -170,7 +170,7 @@ class CarState(CarStateBase, CarStateExt):
|
||||
parsers = {
|
||||
Bus.party: CANParser(DBC[CP.carFingerprint][Bus.party], [], CANBUS.party),
|
||||
Bus.ap_party: CANParser(DBC[CP.carFingerprint][Bus.party], [], CANBUS.autopilot_party),
|
||||
**CarStateExt.get_parser(CP, CP_IQ),
|
||||
**IQCarState.get_parser(CP, CP_IQ),
|
||||
}
|
||||
# Stock DAS_bodyControls from the AP bus (bus 2) for the nav blinker.
|
||||
if TESLA_BLINKERS and CP_IQ.flags & TeslaFlagsIQ.HAS_VEHICLE_BUS and Bus.adas in DBC[CP.carFingerprint]:
|
||||
|
||||
@@ -5,7 +5,7 @@ from iqdbc.car.tesla.carstate import CarState
|
||||
from iqdbc.car.tesla.values import TeslaSafetyFlags, TeslaFlags, CANBUS, CAR, DBC, LEGACY_DAS_STEERING_FW, Ecu
|
||||
from iqdbc.car.tesla.radar_interface import RadarInterface, RADAR_START_ADDR
|
||||
|
||||
from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ, TeslaSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.tesla.values import TeslaFlagsIQ, TeslaSafetyFlagsIQ
|
||||
|
||||
|
||||
class CarInterface(CarInterfaceBase):
|
||||
|
||||
@@ -115,3 +115,24 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
|
||||
"HYUNDAI_CASPER_EV"= [2.5, 2.5, 0.1]
|
||||
"HYUNDAI_IONIQ_5_N" = [3.17, 2.71, 0.097]
|
||||
"HYUNDAI_IONIQ_5_PE" = [1.75, 1.75, 0.15]
|
||||
|
||||
# Synced verbatim from comma opendbc torque_data/override.toml — these platforms
|
||||
# exist upstream and were simply never carried over when iqdbc forked.
|
||||
ACURA_MDX_4G_MMR = [1.25, 1.25, 0.15]
|
||||
ACURA_TLX_2G = [1.2, 1.2, 0.15]
|
||||
ACURA_TLX_2G_MMR = [1.7, 1.7, 0.16]
|
||||
AUDI_Q5_MK1 = [1.8, 1.8, 0.18]
|
||||
CUPRA_BORN_MK1 = [nan, 2.5, nan]
|
||||
FORD_ESCAPE_MK4_5 = [nan, 1.5, nan]
|
||||
FORD_EXPEDITION_MK4 = [nan, 1.5, nan]
|
||||
HONDA_ACCORD_11G = [1.35, 1.35, 0.17]
|
||||
HONDA_CITY_7G = [1.2, 1.2, 0.23]
|
||||
HONDA_CRV_6G = [1.3, 1.3, 0.2]
|
||||
HONDA_NBOX_2G = [1.2, 1.2, 0.2]
|
||||
HONDA_ODYSSEY_5G_MMR = [0.9, 0.9, 0.2]
|
||||
HONDA_PASSPORT_4G = [1.2, 1.2, 0.16]
|
||||
HONDA_PILOT_4G = [1.25, 1.25, 0.21]
|
||||
LEXUS_LS = [1.35, 1.7, 0.17]
|
||||
PORSCHE_MACAN_MK1 = [2.0, 2.0, 0.2]
|
||||
PSA_PEUGEOT_208 = [nan, 2.0, nan]
|
||||
TESLA_MODEL_X = [nan, 2.5, nan]
|
||||
|
||||
@@ -110,3 +110,24 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
|
||||
"CHEVROLET_TRAILBLAZER_NON_ACC_2ND_GEN" = "CHEVROLET_TRAILBLAZER"
|
||||
"CHEVROLET_MALIBU_NON_ACC_9TH_GEN" = "CHEVROLET_VOLT"
|
||||
"CADILLAC_XT5_NON_ACC_1ST_GEN" = "CADILLAC_XT4"
|
||||
|
||||
# Synced verbatim from comma opendbc torque_data/substitute.toml
|
||||
"HONDA_ODYSSEY_TWN" = "HONDA_ODYSSEY"
|
||||
"LEXUS_RC_TSS2" = "LEXUS_NX_TSS2"
|
||||
|
||||
# Platform-sibling substitutes: comma has never shipped torque data for these,
|
||||
# so rather than invent lateral-accel figures they borrow the tune of the closest
|
||||
# platform twin. REVIEW: replace with measured values when available.
|
||||
"SEAT_ALHAMBRA_MK1" = "VOLKSWAGEN_SHARAN_MK2"
|
||||
"VOLKSWAGEN_PASSAT_NMS_PLUS" = "VOLKSWAGEN_PASSAT_NMS"
|
||||
"VOLKSWAGEN_ID3_MK1" = "VOLKSWAGEN_ID4_MK1"
|
||||
"VOLKSWAGEN_ID3_MK2" = "VOLKSWAGEN_ID4_MK2"
|
||||
"SKODA_ENYAQ_MK1" = "VOLKSWAGEN_ID4_MK1"
|
||||
"SKODA_ENYAQ_MK2" = "VOLKSWAGEN_ID4_MK2"
|
||||
"AUDI_Q4_MK1" = "VOLKSWAGEN_ID4_MK1"
|
||||
"AUDI_Q4_MK2" = "VOLKSWAGEN_ID4_MK2"
|
||||
"VOLKSWAGEN_GOLF_MK8" = "VOLKSWAGEN_GOLF_MK7"
|
||||
"SEAT_LEON_MK4" = "VOLKSWAGEN_GOLF_MK7"
|
||||
"VOLKSWAGEN_PASSAT_MK7" = "VOLKSWAGEN_PASSAT_NMS"
|
||||
"VOLKSWAGEN_PASSAT_B7" = "VOLKSWAGEN_PASSAT_NMS"
|
||||
"HONDA_CLARITY" = "HONDA_ACCORD"
|
||||
|
||||
@@ -13,8 +13,8 @@ from iqdbc.car.toyota.values import CAR, NO_STOP_TIMER_CAR, TSS2_CAR, \
|
||||
UNSUPPORTED_DSU_CAR
|
||||
from iqdbc.can import CANPacker
|
||||
|
||||
from iqdbc.iqpilot.car.toyota.gas_interceptor import GasInterceptorCarController
|
||||
from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ
|
||||
from iqdbc.lvbs.car.toyota.gas_interceptor import GasInterceptorCarController
|
||||
from iqdbc.lvbs.car.toyota.values import ToyotaFlagsIQ
|
||||
|
||||
Ecu = structs.CarParams.Ecu
|
||||
LongCtrlState = structs.CarControl.Actuators.LongControlState
|
||||
|
||||
@@ -8,8 +8,8 @@ from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.toyota.values import ToyotaFlags, CAR, DBC, STEER_THRESHOLD, NO_STOP_TIMER_CAR, \
|
||||
TSS2_CAR, RADAR_ACC_CAR, EPS_SCALE, UNSUPPORTED_DSU_CAR, \
|
||||
SECOC_CAR
|
||||
from iqdbc.iqpilot.car.toyota.carstate_ext import CarStateExt
|
||||
from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ
|
||||
from iqdbc.lvbs.car.toyota.iq_carstate import IQCarState
|
||||
from iqdbc.lvbs.car.toyota.values import ToyotaFlagsIQ
|
||||
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
SteerControlType = structs.CarParams.SteerControlType
|
||||
@@ -26,10 +26,10 @@ TEMP_STEER_FAULTS = (0, 9, 11, 21, 25)
|
||||
PERM_STEER_FAULTS = (3, 17)
|
||||
|
||||
|
||||
class CarState(CarStateBase, CarStateExt):
|
||||
class CarState(CarStateBase, IQCarState):
|
||||
def __init__(self, CP, CP_IQ):
|
||||
CarStateBase.__init__(self, CP, CP_IQ)
|
||||
CarStateExt.__init__(self, CP, CP_IQ)
|
||||
IQCarState.__init__(self, CP, CP_IQ)
|
||||
can_define = CANDefine(DBC[CP.carFingerprint][Bus.pt])
|
||||
self.eps_torque_scale = EPS_SCALE[CP.carFingerprint] / 100.
|
||||
self.cluster_speed_hyst_gap = CV.KPH_TO_MS / 2.
|
||||
@@ -210,7 +210,7 @@ class CarState(CarStateBase, CarStateExt):
|
||||
|
||||
ret.buttonEvents = buttonEvents
|
||||
|
||||
CarStateExt.update(self, ret, ret_iq, can_parsers)
|
||||
IQCarState.update(self, ret, ret_iq, can_parsers)
|
||||
|
||||
return ret, ret_iq
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
from iqdbc.car.structs import CarParams
|
||||
from iqdbc.car.toyota.values import CAR
|
||||
|
||||
from iqdbc.iqpilot.car.fingerprints_ext import merge_fw_versions
|
||||
from iqdbc.iqpilot.car.toyota.fingerprints_ext import FW_VERSIONS_EXT
|
||||
from iqdbc.lvbs.car.iq_fingerprints import extend_fw_versions
|
||||
from iqdbc.lvbs.car.toyota.iq_fingerprints import FW_VERSIONS_EXT
|
||||
|
||||
Ecu = CarParams.Ecu
|
||||
|
||||
@@ -1889,4 +1889,4 @@ FW_VERSIONS = {
|
||||
},
|
||||
}
|
||||
|
||||
FW_VERSIONS = merge_fw_versions(FW_VERSIONS, FW_VERSIONS_EXT)
|
||||
FW_VERSIONS = extend_fw_versions(FW_VERSIONS, FW_VERSIONS_EXT)
|
||||
|
||||
@@ -7,7 +7,7 @@ from iqdbc.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerPar
|
||||
ToyotaSafetyFlags, UNSUPPORTED_DSU_CAR
|
||||
from iqdbc.car.disable_ecu import disable_ecu
|
||||
from iqdbc.car.interfaces import CarInterfaceBase
|
||||
from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ, ToyotaSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.toyota.values import ToyotaFlagsIQ, ToyotaSafetyFlagsIQ
|
||||
|
||||
SteerControlType = structs.CarParams.SteerControlType
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from iqdbc.car import gen_empty_fingerprint, structs
|
||||
from iqdbc.car.toyota.interface import CarInterface
|
||||
from iqdbc.car.toyota.values import CAR, ToyotaFlags
|
||||
from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ
|
||||
from iqdbc.lvbs.car.toyota.values import ToyotaFlagsIQ
|
||||
|
||||
|
||||
def test_secoc_toyota_not_dashcam_on_release():
|
||||
|
||||
@@ -504,7 +504,7 @@ class CarState(CarStateBase):
|
||||
ret.gasPressed = pt_cp.vl["Motor_3"]["MO3_Pedalwert"] > 0
|
||||
ret.brake = pt_cp.vl["Bremse_5"]["BR5_Bremsdruck"] / 250.0 # FIXME: this is pressure in Bar, not sure what OP expects
|
||||
ret.brakePressed = bool(pt_cp.vl["Motor_2"]["MO2_BLS"])
|
||||
ret.parkingBrake = False # bool(pt_cp.vl["Kombi_1"]["Bremsinfo"])
|
||||
ret.parkingBrake = bool(pt_cp.vl["Kombi_1"]["Bremsinfo"])
|
||||
|
||||
# Update gear and/or clutch position data.
|
||||
if self.CP.transmissionType == TransmissionType.automatic:
|
||||
@@ -639,8 +639,8 @@ class CarState(CarStateBase):
|
||||
|
||||
ret.lowSpeedAlert = self.update_low_speed_alert(ret.vEgo)
|
||||
|
||||
ret.fuelGauge = 0 # pt_cp.vl["Kombi_1"]["Tankinhalt"] / 55.0
|
||||
ret.fuelTankLevelL = 0 # pt_cp.vl["Kombi_1"]["Tankinhalt"] # raw liters for konn3kt
|
||||
ret.fuelGauge = pt_cp.vl["Kombi_1"]["Tankinhalt"] / 55.0
|
||||
ret.fuelTankLevelL = pt_cp.vl["Kombi_1"]["Tankinhalt"] # raw liters for konn3kt
|
||||
if aux_cp is not None:
|
||||
self._update_odometer(ret, aux_cp.vl["Kombi_3"]["Kilometerstand"])
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from collections import namedtuple
|
||||
|
||||
from iqdbc.car import Bus, structs
|
||||
from iqdbc.car.chrysler.values import RAM_CARS
|
||||
from iqdbc.iqpilot.aol_base import AolCarStateBase
|
||||
from iqdbc.lvbs.aol_base import AolCarStateBase
|
||||
from iqdbc.can.parser import CANParser
|
||||
|
||||
AolDataIQ = namedtuple("AolDataIQ", ["enable_aol", "paused", "lkas_disabled"])
|
||||
@@ -7,12 +7,12 @@ no-min-steering-speed option is set, and holds the RAM DT engagement window.
|
||||
from iqdbc.car import structs
|
||||
from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.chrysler.values import RAM_DT
|
||||
from iqdbc.iqpilot.car.chrysler.values_ext import ChryslerFlagsIQ
|
||||
from iqdbc.lvbs.car.chrysler.iq_values import ChryslerFlagsIQ
|
||||
|
||||
GearShifter = structs.CarState.GearShifter
|
||||
|
||||
|
||||
class CarControllerExt:
|
||||
class IQCarController:
|
||||
def __init__(self, CP: structs.CarParams, CP_IQ: structs.IQCarParams):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -8,10 +8,10 @@ from enum import StrEnum
|
||||
|
||||
from iqdbc.car import Bus, structs
|
||||
from iqdbc.can.parser import CANParser
|
||||
from iqdbc.iqpilot.car.chrysler.values_ext import BUTTONS
|
||||
from iqdbc.lvbs.car.chrysler.iq_values import BUTTONS
|
||||
|
||||
|
||||
class CarStateExt:
|
||||
class IQCarState:
|
||||
def __init__(self, CP, CP_IQ):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -9,10 +9,10 @@ from enum import StrEnum
|
||||
from iqdbc.car import Bus, structs
|
||||
from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.can.parser import CANParser
|
||||
from iqdbc.iqpilot.car.gm.values_ext import GMFlagsIQ
|
||||
from iqdbc.lvbs.car.gm.iq_values import GMFlagsIQ
|
||||
|
||||
|
||||
class CarStateExt:
|
||||
class IQCarState:
|
||||
def __init__(self, CP, CP_IQ):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -8,7 +8,7 @@ from math import exp
|
||||
|
||||
from iqdbc.car import structs
|
||||
from iqdbc.car.gm.interface import CAR
|
||||
from iqdbc.iqpilot.car.interfaces import LatControlInputs, TorqueFromLateralAccelCallbackTypeTorqueSpace
|
||||
from iqdbc.lvbs.car.interfaces import LatControlInputs, TorqueFromLateralAccelCallbackTypeTorqueSpace
|
||||
|
||||
_NON_LINEAR_TORQUE_PARAMS = {
|
||||
CAR.CHEVROLET_BOLT_EUV: [2.6531724862969748, 1.0, 0.1919764879840985, 0.009054123646805178],
|
||||
@@ -17,7 +17,7 @@ _NON_LINEAR_TORQUE_PARAMS = {
|
||||
}
|
||||
|
||||
|
||||
class CarInterfaceExt:
|
||||
class IQCarInterface:
|
||||
def __init__(self, CP: structs.CarParams, CI_Base):
|
||||
self.CP = CP
|
||||
self.CI_Base = CI_Base
|
||||
@@ -6,7 +6,7 @@ import numpy as np
|
||||
|
||||
from iqdbc.car import structs
|
||||
from iqdbc.car.can_definitions import CanData
|
||||
from iqdbc.iqpilot.car import create_gas_interceptor_command
|
||||
from iqdbc.lvbs.car import create_gas_interceptor_command
|
||||
|
||||
|
||||
class GasInterceptorCarController:
|
||||
@@ -5,10 +5,10 @@ from enum import StrEnum
|
||||
|
||||
from iqdbc.car import Bus, structs
|
||||
from iqdbc.can.parser import CANParser
|
||||
from iqdbc.iqpilot.car.honda.values_ext import HondaFlagsIQ
|
||||
from iqdbc.lvbs.car.honda.iq_values import HondaFlagsIQ
|
||||
|
||||
|
||||
class CarStateExt:
|
||||
class IQCarState:
|
||||
def __init__(self, CP, CP_IQ):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -9,9 +9,9 @@ from collections.abc import Callable
|
||||
from iqdbc.car import structs
|
||||
from iqdbc.car.can_definitions import CanRecvCallable, CanSendCallable
|
||||
from iqdbc.car.subaru.values import SubaruFlags
|
||||
from iqdbc.iqpilot.car.subaru.values_ext import SubaruFlagsIQ, SubaruSafetyFlagsIQ
|
||||
from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ
|
||||
from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ
|
||||
from iqdbc.lvbs.car.subaru.iq_values import SubaruFlagsIQ, SubaruSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.tesla.values import TeslaFlagsIQ
|
||||
from iqdbc.lvbs.car.toyota.values import ToyotaFlagsIQ
|
||||
|
||||
|
||||
class LatControlInputs(NamedTuple):
|
||||
@@ -67,7 +67,7 @@ class NanoFFModel:
|
||||
return pred
|
||||
|
||||
|
||||
def setup_interfaces(CI, CP: structs.CarParams, CP_IQ: structs.IQCarParams,
|
||||
def apply_iq_car_config(CI, CP: structs.CarParams, CP_IQ: structs.IQCarParams,
|
||||
params_list: list[dict[str, str]] | None = None,
|
||||
can_recv: CanRecvCallable | None = None, can_send: CanSendCallable | None = None) -> None:
|
||||
if params_list is None:
|
||||
@@ -3,7 +3,7 @@ Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed
|
||||
"""
|
||||
|
||||
|
||||
def merge_fw_versions(fw_versions, new_fw_versions):
|
||||
def extend_fw_versions(fw_versions, new_fw_versions):
|
||||
"""
|
||||
Merge firmware versions by extending lists for matching ECUs,
|
||||
adding all entries regardless of duplicates.
|
||||
@@ -22,7 +22,7 @@ def merge_fw_versions(fw_versions, new_fw_versions):
|
||||
return fw_versions
|
||||
|
||||
|
||||
def merge_fingerprints(fingerprints, new_fingerprints):
|
||||
def extend_fingerprints(fingerprints, new_fingerprints):
|
||||
"""
|
||||
Merge fingerprints by extending lists for matching keys,
|
||||
adding all entries regardless of duplicates.
|
||||
@@ -7,10 +7,10 @@ from enum import StrEnum
|
||||
|
||||
from iqdbc.car import Bus, structs
|
||||
from iqdbc.can.parser import CANParser
|
||||
from iqdbc.iqpilot.car.nissan.values import BUTTONS
|
||||
from iqdbc.lvbs.car.nissan.values import BUTTONS
|
||||
|
||||
|
||||
class CarStateExt:
|
||||
class IQCarState:
|
||||
def __init__(self, CP, CP_IQ):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -7,7 +7,7 @@ from iqdbc.car.values import PLATFORMS
|
||||
|
||||
def get_car_list() -> dict[str, dict[str, list[str] | str]]:
|
||||
collected_footnote = get_all_footnotes()
|
||||
sorted_list: dict[str, dict[str, list[str] | str]] = build_sorted_car_list(PLATFORMS, collected_footnote)
|
||||
sorted_list: dict[str, dict[str, list[str] | str]] = collect_car_docs(PLATFORMS, collected_footnote)
|
||||
return sorted_list
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ def _natural_sort_key(s):
|
||||
return [int(t) if t.isdigit() else t.lower() for t in re.split(r'(\d+)', normalized) if t]
|
||||
|
||||
|
||||
def build_sorted_car_list(platforms, footnotes) -> dict[str, dict[str, list[str] | str]]:
|
||||
def collect_car_docs(platforms, footnotes) -> dict[str, dict[str, list[str] | str]]:
|
||||
cars: dict[str, dict[str, list[str] | str]] = {}
|
||||
for model, platform in platforms.items():
|
||||
car_docs = platform.config.get_all_docs()
|
||||
@@ -12,7 +12,7 @@ from iqdbc.car import Bus, structs
|
||||
from iqdbc.can.parser import CANParser
|
||||
from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.car.rivian.values import DBC
|
||||
from iqdbc.iqpilot.car.rivian.values import RivianFlagsIQ
|
||||
from iqdbc.lvbs.car.rivian.values import RivianFlagsIQ
|
||||
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
|
||||
@@ -22,7 +22,7 @@ _LONG_PRESS_FRAMES = 66
|
||||
_STALK_HOLD_FRAMES = 50
|
||||
|
||||
|
||||
class CarStateExt:
|
||||
class IQCarState:
|
||||
def __init__(self, CP: structs.CarParams, CP_IQ: structs.IQCarParams):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -8,7 +8,7 @@ from enum import StrEnum
|
||||
|
||||
from iqdbc.car import Bus, structs
|
||||
from iqdbc.car.subaru.values import SubaruFlags
|
||||
from iqdbc.iqpilot.aol_base import AolCarStateBase
|
||||
from iqdbc.lvbs.aol_base import AolCarStateBase
|
||||
from iqdbc.can.parser import CANParser
|
||||
|
||||
_LKAS = structs.CarState.ButtonEvent.Type.lkas
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
|
||||
IQ.Pilot Subaru extension flags. Selected in setup_interfaces() from the user's
|
||||
IQ.Pilot Subaru extension flags. Selected in apply_iq_car_config() from the user's
|
||||
stop-and-go params and consumed by the stop-and-go controller and panda safety.
|
||||
"""
|
||||
from enum import IntFlag
|
||||
@@ -14,8 +14,8 @@ from iqdbc.car.can_definitions import CanData
|
||||
from iqdbc.car.interfaces import CarStateBase
|
||||
from iqdbc.car.subaru.values import SubaruFlags
|
||||
|
||||
from iqdbc.iqpilot.car.subaru import subarucan_ext
|
||||
from iqdbc.iqpilot.car.subaru.values_ext import SubaruFlagsIQ
|
||||
from iqdbc.lvbs.car.subaru import iq_subarucan
|
||||
from iqdbc.lvbs.car.subaru.iq_values import SubaruFlagsIQ
|
||||
from iqdbc.can.parser import CANParser
|
||||
|
||||
# EPB resume fires only while the lead is pulling away within this gap band (m).
|
||||
@@ -24,7 +24,7 @@ _RESUME_GAP_MAX = 4.5
|
||||
_EPB_PULSE_FRAMES = 15
|
||||
|
||||
|
||||
class SnGCarController:
|
||||
class IQStopAndGoController:
|
||||
def __init__(self, CP: structs.CarParams, CP_IQ: structs.IQCarParams):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -73,13 +73,13 @@ class SnGCarController:
|
||||
return []
|
||||
|
||||
resume = self._want_resume(CC, CS, frame)
|
||||
can_sends = [subarucan_ext.create_throttle(packer, self.CP, CS.throttle_msg, resume and not self.manual_parking_brake)]
|
||||
can_sends = [iq_subarucan.create_throttle(packer, self.CP, CS.throttle_msg, resume and not self.manual_parking_brake)]
|
||||
if frame % 2 == 0:
|
||||
can_sends.append(subarucan_ext.create_brake_pedal(packer, self.CP, CS.brake_pedal_msg, resume and self.manual_parking_brake))
|
||||
can_sends.append(iq_subarucan.create_brake_pedal(packer, self.CP, CS.brake_pedal_msg, resume and self.manual_parking_brake))
|
||||
return can_sends
|
||||
|
||||
|
||||
class SnGCarState:
|
||||
class IQStopAndGoState:
|
||||
def __init__(self, CP: structs.CarParams, CP_IQ: structs.IQCarParams):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -10,7 +10,7 @@ from iqdbc.car import structs, rate_limit, DT_CTRL
|
||||
from iqdbc.car.vehicle_model import VehicleModel
|
||||
from iqdbc.car.lateral import apply_steer_angle_limits_vm
|
||||
from iqdbc.car.tesla.values import CarControllerParams
|
||||
from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ
|
||||
from iqdbc.lvbs.car.tesla.values import TeslaFlagsIQ
|
||||
|
||||
|
||||
DT_LAT_CTRL = DT_CTRL * CarControllerParams.STEER_STEP
|
||||
@@ -7,12 +7,12 @@ from iqdbc.car import Bus, create_button_events, structs
|
||||
from iqdbc.can.parser import CANParser
|
||||
from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.car.tesla.values import DBC, CANBUS
|
||||
from iqdbc.iqpilot.car.tesla.values import TeslaFlagsIQ
|
||||
from iqdbc.lvbs.car.tesla.values import TeslaFlagsIQ
|
||||
|
||||
ButtonType = structs.CarState.ButtonEvent.Type
|
||||
|
||||
|
||||
class CarStateExt:
|
||||
class IQCarState:
|
||||
def __init__(self, CP: structs.CarParams, CP_IQ: structs.IQCarParams):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -2,7 +2,7 @@ import json
|
||||
import os
|
||||
|
||||
from iqdbc.car.common.basedir import BASEDIR
|
||||
from iqdbc.iqpilot.car.platform_list import get_car_list
|
||||
from iqdbc.lvbs.car.platform_list import get_car_list
|
||||
|
||||
CATALOG_JSON = os.path.join(BASEDIR, "..", "..", "iqpilot", "selfdrive", "car", "vehicle_catalog.json")
|
||||
|
||||
@@ -7,7 +7,7 @@ import numpy as np
|
||||
from iqdbc.car import structs
|
||||
from iqdbc.car.can_definitions import CanData
|
||||
from iqdbc.car.toyota.values import CAR, MIN_ACC_SPEED, PEDAL_TRANSITION
|
||||
from iqdbc.iqpilot.car import create_gas_interceptor_command
|
||||
from iqdbc.lvbs.car import create_gas_interceptor_command
|
||||
|
||||
|
||||
class GasInterceptorCarController:
|
||||
@@ -8,7 +8,7 @@ from iqdbc.car import Bus, structs
|
||||
from iqdbc.car.carlog import carlog
|
||||
from iqdbc.can.parser import CANParser
|
||||
from iqdbc.car.common.conversions import Conversions as CV
|
||||
from iqdbc.iqpilot.car.toyota.values import ToyotaFlagsIQ
|
||||
from iqdbc.lvbs.car.toyota.values import ToyotaFlagsIQ
|
||||
|
||||
TRAFFIC_SIGNAL_MAP = {
|
||||
1: "kph",
|
||||
@@ -21,7 +21,7 @@ ZSS_DIFF_THRESHOLD = 4
|
||||
ZSS_MAX_THRESHOLD = 10
|
||||
|
||||
|
||||
class CarStateExt:
|
||||
class IQCarState:
|
||||
def __init__(self, CP, CP_IQ):
|
||||
self.CP = CP
|
||||
self.CP_IQ = CP_IQ
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "iqdbc/safety/iqpilot/aol_declarations.h"
|
||||
#include "iqdbc/safety/aol/aol_declarations.h"
|
||||
|
||||
// ===============================
|
||||
// Global Variables
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "iqdbc/safety/iqpilot/aol.h"
|
||||
#include "iqdbc/safety/aol/aol.h"
|
||||
#include "iqdbc/safety/declarations.h"
|
||||
|
||||
// ISO 11270
|
||||
|
||||
@@ -9,7 +9,7 @@ from iqdbc.car.structs import CarParams
|
||||
from iqdbc.safety.tests.common import CANPackerSafety, MAX_WRONG_COUNTERS
|
||||
from iqdbc.safety.tests.gas_interceptor_common import GasInterceptorSafetyTest
|
||||
|
||||
from iqdbc.iqpilot.car.honda.values_ext import HondaSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.honda.iq_values import HondaSafetyFlagsIQ
|
||||
|
||||
HONDA_N_COMMON_TX_MSGS = [[0xE4, 0], [0x194, 0], [0x1FA, 0], [0x30C, 0], [0x33D, 0]]
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import numpy as np
|
||||
import pytest
|
||||
try:
|
||||
from iqdbc.car.tesla.carcontroller import get_safety_CP
|
||||
from iqdbc.iqpilot.car.tesla.values import TeslaSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.tesla.values import TeslaSafetyFlagsIQ
|
||||
except ImportError:
|
||||
pytest.skip("requires openpilot dependencies", allow_module_level=True)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import unittest
|
||||
import itertools
|
||||
|
||||
from iqdbc.car.toyota.values import ToyotaSafetyFlags
|
||||
from iqdbc.iqpilot.car.toyota.values import ToyotaSafetyFlagsIQ
|
||||
from iqdbc.lvbs.car.toyota.values import ToyotaSafetyFlagsIQ
|
||||
from iqdbc.car.structs import CarParams
|
||||
from iqdbc.safety.tests.libsafety import libsafety_py
|
||||
import iqdbc.safety.tests.common as common
|
||||
|
||||
Reference in New Issue
Block a user