wip
This commit is contained in:
@@ -137,6 +137,11 @@ class CarController(CarControllerBase):
|
|||||||
set_speed_in_units, hud_control))
|
set_speed_in_units, hud_control))
|
||||||
self.accel_last = accel
|
self.accel_last = accel
|
||||||
else:
|
else:
|
||||||
|
# Clearpilot
|
||||||
|
# If cruise control was enabled or idle on start, force cancel
|
||||||
|
if CS.fix_main_enabled_cancel_main:
|
||||||
|
CS.fix_main_enabled_cancel_main = False
|
||||||
|
CC.cruiseControl.cancel = True
|
||||||
# button presses
|
# button presses
|
||||||
can_sends.extend(self.create_button_messages(CC, CS, use_clu11=False))
|
can_sends.extend(self.create_button_messages(CC, CS, use_clu11=False))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class CarState(CarStateBase):
|
|||||||
# Clearpilot variables
|
# Clearpilot variables
|
||||||
self.fix_main_enabled_check = True
|
self.fix_main_enabled_check = True
|
||||||
self.fix_main_enabled_executed = False
|
self.fix_main_enabled_executed = False
|
||||||
|
self.fix_main_enabled_cancel_main = False
|
||||||
|
|
||||||
def calculate_speed_limit(self, cp, cp_cam):
|
def calculate_speed_limit(self, cp, cp_cam):
|
||||||
if self.CP.carFingerprint in CANFD_CAR:
|
if self.CP.carFingerprint in CANFD_CAR:
|
||||||
@@ -279,8 +280,7 @@ class CarState(CarStateBase):
|
|||||||
if self.fix_main_enabled_check:
|
if self.fix_main_enabled_check:
|
||||||
self.fix_main_enabled_check = False
|
self.fix_main_enabled_check = False
|
||||||
if ret.cruiseState.speed > 1 and self.main_enabled == False:
|
if ret.cruiseState.speed > 1 and self.main_enabled == False:
|
||||||
self.main_enabled = True
|
self.fix_main_enabled_cancel_main = True
|
||||||
self.fix_main_enabled_executed = True
|
|
||||||
self.buttons_counter = cp.vl[self.cruise_btns_msg_canfd]["COUNTER"]
|
self.buttons_counter = cp.vl[self.cruise_btns_msg_canfd]["COUNTER"]
|
||||||
ret.accFaulted = cp.vl["TCS"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED
|
ret.accFaulted = cp.vl["TCS"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user