From 284938cd43c690207c1b71898218af3c630498d6 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 28 Aug 2020 21:34:34 -0700 Subject: [PATCH] fix hyundai editing can parser values --- selfdrive/car/hyundai/carcontroller.py | 3 +-- selfdrive/car/hyundai/carstate.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 787cc91b0..5e309e4d2 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -75,9 +75,8 @@ class CarController(): if pcm_cancel_cmd: can_sends.append(create_clu11(self.packer, frame, CS.clu11, Buttons.CANCEL)) elif CS.out.cruiseState.standstill: - # SCC won't resume anyway when the lead distace is less than 3.7m # send resume at a max freq of 5Hz - if CS.lead_distance > 3.7 and (frame - self.last_resume_frame)*DT_CTRL > 0.2: + if (frame - self.last_resume_frame)*DT_CTRL > 0.2: can_sends.append(create_clu11(self.packer, frame, CS.clu11, Buttons.RES_ACCEL)) self.last_resume_frame = frame diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 61d9de05b..fd53ffc8a 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -1,3 +1,4 @@ +import copy from cereal import car from selfdrive.car.hyundai.values import DBC, STEER_THRESHOLD, FEATURES, EV_HYBRID from selfdrive.car.interfaces import CarStateBase @@ -124,8 +125,8 @@ class CarState(CarStateBase): ret.rightBlindspot = cp.vl["LCA11"]["CF_Lca_IndRight"] != 0 # save the entire LKAS11 and CLU11 - self.lkas11 = cp_cam.vl["LKAS11"] - self.clu11 = cp.vl["CLU11"] + self.lkas11 = copy.copy(cp_cam.vl["LKAS11"]) + self.clu11 = copy.copy(cp.vl["CLU11"]) self.park_brake = cp.vl["CGW1"]['CF_Gway_ParkBrakeSw'] self.steer_state = cp.vl["MDPS12"]['CF_Mdps_ToiActive'] # 0 NOT ACTIVE, 1 ACTIVE self.lead_distance = cp.vl["SCC11"]['ACC_ObjDist']