This commit is contained in:
Your Name
2024-05-04 15:16:36 -05:00
parent 106e8d9064
commit b017bec24b
4 changed files with 30 additions and 31 deletions

View File

@@ -38,11 +38,15 @@ class CanBus(CanBusBase):
def create_steering_messages(packer, CP, CAN, enabled, lat_active, apply_steer):
# Im sure there is a better way to do this
params_memory = Params("/dev/shm/params")
no_lat_lane_change = params_memory.get_int("no_lat_lane_change", 1)
ret = []
values = {
"LKA_MODE": 2,
"LKA_ICON": 2 if enabled else 1 if lat_active else 0, # right mode icon
"LKA_ICON": 0 if no_lat_lane_change else 2 if enabled else 1 if lat_active else 0, # right mode icon
"TORQUE_REQUEST": apply_steer,
"LKA_ASSIST": 0,
"STEER_REQ": 1 if lat_active else 0,
@@ -127,18 +131,9 @@ def create_acc_cancel(packer, CP, CAN, cruise_info_copy):
# CLEARPILOT changed HDA icons
# This doesn't appear to do anything on my tucson
def create_lfahda_cluster(packer, CAN, enabled, lat_active):
# Im sure there is a better way to do this
params = Params()
params_memory = Params("/dev/shm/params")
no_lat_lane_change = params_memory.get_int("no_lat_lane_change", 1)
values = {
# 0 off, 1 gray, 2 green, 3 blinking (wheel icon)
# CP: Is this actually the wheel? Might this be the HDA2 thing?
"HDA_ICON": 0, # Intention is to have this represent stock HDA mode
"LFA_ICON": 0,
# "LFA_ICON": 0 if no_lat_lane_change else 2 if enabled else 1 if lat_active else 0,
"HDA_ICON": 0,
"LFA_ICON": 0
}
return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values)