fix hyundai editing can parser values

This commit is contained in:
Adeeb Shihadeh
2020-08-28 21:34:34 -07:00
parent 45b4b6007a
commit 284938cd43
2 changed files with 4 additions and 4 deletions
+1 -2
View File
@@ -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
+3 -2
View File
@@ -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']