diff --git a/selfdrive/car/chrysler/carcontroller.py b/selfdrive/car/chrysler/carcontroller.py index 8156e7841e..00893b6bc4 100644 --- a/selfdrive/car/chrysler/carcontroller.py +++ b/selfdrive/car/chrysler/carcontroller.py @@ -14,7 +14,7 @@ class CarController: self.hud_count = 0 self.last_lkas_falling_edge = 0 - self.lkas_active_prev = False + self.lkas_control_bit_prev = False self.last_button_frame = 0 self.packer = CANPacker(dbc_name) @@ -24,7 +24,8 @@ class CarController: can_sends = [] # EPS faults if LKAS re-enables too quickly - lkas_active = CC.latActive and not low_speed_alert and (self.frame - self.last_lkas_falling_edge > 200) + lkas_control_bit = not low_speed_alert and (self.frame - self.last_lkas_falling_edge > 200) + lkas_active = CC.latActive and self.lkas_control_bit_prev # *** control msgs *** @@ -59,12 +60,12 @@ class CarController: self.apply_steer_last = apply_steer idx = self.frame // 2 - can_sends.append(create_lkas_command(self.packer, self.CP, int(apply_steer), lkas_active, idx)) + can_sends.append(create_lkas_command(self.packer, self.CP, int(apply_steer), lkas_control_bit, idx)) self.frame += 1 - if not lkas_active and self.lkas_active_prev: + if not lkas_control_bit and self.lkas_control_bit_prev: self.last_lkas_falling_edge = self.frame - self.lkas_active_prev = lkas_active + self.lkas_control_bit_prev = lkas_control_bit new_actuators = CC.actuators.copy() new_actuators.steer = self.apply_steer_last / self.params.STEER_MAX diff --git a/selfdrive/car/chrysler/chryslercan.py b/selfdrive/car/chrysler/chryslercan.py index 632c0d2bcf..1e26a6d275 100644 --- a/selfdrive/car/chrysler/chryslercan.py +++ b/selfdrive/car/chrysler/chryslercan.py @@ -52,12 +52,12 @@ def create_lkas_hud(packer, CP, lkas_active, hud_alert, hud_count, car_model, au return packer.make_can_msg("DAS_6", 0, values) -def create_lkas_command(packer, CP, apply_steer, lat_active, frame): +def create_lkas_command(packer, CP, apply_steer, lkas_control_bit, frame): # LKAS_COMMAND Lane-keeping signal to turn the wheel enabled_val = 2 if CP.carFingerprint in RAM_CARS else 1 values = { "STEERING_TORQUE": apply_steer, - "LKAS_CONTROL_BIT": enabled_val if lat_active else 0, + "LKAS_CONTROL_BIT": enabled_val if lkas_control_bit else 0, } return packer.make_can_msg("LKAS_COMMAND", 0, values, frame % 0x10) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index e77a38de5f..c99a1653f4 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -5efbbdf69e16db3d989bfaf62d10e958e80b9ca2 \ No newline at end of file +7fbe776f271ed2d45abe989736133a5cfa0ec826 \ No newline at end of file