mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 04:52:09 +08:00
Hyundai CAN-FD: set available from TCS ACC available (#26921)
* available on TCS signal always * cmt enh * better comment * better old-commit-hash: a24afa18d3b43f9ea02a15d99ba8eb07b8cc9709
This commit is contained in:
@@ -201,14 +201,14 @@ class CarState(CarStateBase):
|
||||
ret.rightBlindspot = cp.vl["BLINDSPOTS_REAR_CORNERS"]["FR_INDICATOR"] != 0
|
||||
|
||||
# cruise state
|
||||
# CAN FD cars enable on main button press, set available if no TCS faults preventing engagement
|
||||
ret.cruiseState.available = cp.vl["TCS"]["ACCEnable"] == 0
|
||||
if self.CP.openpilotLongitudinalControl:
|
||||
# These are not used for engage/disengage since openpilot keeps track of state using the buttons
|
||||
ret.cruiseState.available = cp.vl["TCS"]["ACCEnable"] == 0
|
||||
ret.cruiseState.enabled = cp.vl["TCS"]["ACC_REQ"] == 1
|
||||
ret.cruiseState.standstill = False
|
||||
else:
|
||||
cp_cruise_info = cp_cam if self.CP.flags & HyundaiFlags.CANFD_CAMERA_SCC else cp
|
||||
ret.cruiseState.available = cp_cruise_info.vl["SCC_CONTROL"]["MainMode_ACC"] == 1
|
||||
ret.cruiseState.enabled = cp_cruise_info.vl["SCC_CONTROL"]["ACCMode"] in (1, 2)
|
||||
ret.cruiseState.standstill = cp_cruise_info.vl["SCC_CONTROL"]["CRUISE_STANDSTILL"] == 1
|
||||
ret.cruiseState.speed = cp_cruise_info.vl["SCC_CONTROL"]["VSetDis"] * speed_factor
|
||||
@@ -484,7 +484,6 @@ class CarState(CarStateBase):
|
||||
("ACCMode", "SCC_CONTROL"),
|
||||
("VSetDis", "SCC_CONTROL"),
|
||||
("CRUISE_STANDSTILL", "SCC_CONTROL"),
|
||||
("MainMode_ACC", "SCC_CONTROL"),
|
||||
]
|
||||
checks += [
|
||||
("SCC_CONTROL", 50),
|
||||
|
||||
Reference in New Issue
Block a user