From fa52fa6c6703269e23610b1c6aba8a56b911fbbb Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 13 Jul 2022 11:53:13 -0700 Subject: [PATCH 1/2] Chrysler: never drop control bit on older models --- selfdrive/car/chrysler/carcontroller.py | 17 ++++++++++++++--- selfdrive/car/chrysler/interface.py | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/chrysler/carcontroller.py b/selfdrive/car/chrysler/carcontroller.py index 00893b6bc45872..6d158e7cd0c949 100644 --- a/selfdrive/car/chrysler/carcontroller.py +++ b/selfdrive/car/chrysler/carcontroller.py @@ -2,7 +2,7 @@ from common.realtime import DT_CTRL from selfdrive.car import apply_toyota_steer_torque_limits from selfdrive.car.chrysler.chryslercan import create_lkas_hud, create_lkas_command, create_cruise_buttons -from selfdrive.car.chrysler.values import RAM_CARS, CarControllerParams +from selfdrive.car.chrysler.values import CAR, RAM_CARS, CarControllerParams class CarController: @@ -20,11 +20,22 @@ def __init__(self, dbc_name, CP, VM): self.packer = CANPacker(dbc_name) self.params = CarControllerParams(CP) - def update(self, CC, CS, low_speed_alert): + def update(self, CC, CS): can_sends = [] + # TODO: can we make this more sane? why is it different for all the cars? + lkas_control_bit = self.lkas_control_bit_prev + if CS.out.vEgo > self.CP.minSteerSpeed: + lkas_control_bit = True + elif self.CP.carFingerprint in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_CHEROKEE_2019): + if CS.out.vEgo < (self.CP.minSteerSpeed - 3.0): + lkas_control_bit = False + elif self.CP.carFingerprint in RAM_CARS: + if CS.out.vEgo < (self.CP.minSteerSpeed - 0.5): + lkas_control_bit = False + # EPS faults if LKAS re-enables too quickly - lkas_control_bit = not low_speed_alert and (self.frame - self.last_lkas_falling_edge > 200) + lkas_control_bit = lkas_control_bit and (self.frame - self.last_lkas_falling_edge > 200) lkas_active = CC.latActive and self.lkas_control_bit_prev # *** control msgs *** diff --git a/selfdrive/car/chrysler/interface.py b/selfdrive/car/chrysler/interface.py index 8826a925236148..acc08954a844dd 100755 --- a/selfdrive/car/chrysler/interface.py +++ b/selfdrive/car/chrysler/interface.py @@ -93,4 +93,4 @@ def _update(self, c): return ret def apply(self, c): - return self.CC.update(c, self.CS, self.low_speed_alert) + return self.CC.update(c, self.CS) From e261f5845b386787bfd8c1d76b0408c003352e84 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 13 Jul 2022 12:51:19 -0700 Subject: [PATCH 2/2] update refs --- selfdrive/test/process_replay/ref_commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index c99a1653f4c2c3..dff232911e53b0 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -7fbe776f271ed2d45abe989736133a5cfa0ec826 \ No newline at end of file +fa52fa6c6703269e23610b1c6aba8a56b911fbbb \ No newline at end of file