This commit is contained in:
Your Name
2024-06-09 16:09:02 -05:00
27 changed files with 650 additions and 984 deletions

View File

@@ -76,6 +76,8 @@ class Controls:
self.params_memory = Params("/dev/shm/params")
self.params_storage = Params("/persist/params")
self.params_memory.put_bool("CPTLkasButtonAction", False)
self.radarless_model = self.params.get("Model", encoding='utf-8') in RADARLESS_MODELS
with car.CarParams.from_bytes(self.params.get("CarParams", block=True)) as msg:
@@ -1131,13 +1133,13 @@ class Controls:
self.drive_added = True
# Clearpilot - todo: override conditional on cruise button tap
# if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents) and self.experimental_mode_via_lkas:
# if self.frogpilot_variables.conditional_experimental_mode:
# conditional_status = self.params_memory.get_int("CEStatus")
# override_value = 0 if conditional_status in {1, 2, 3, 4, 5, 6} else 3 if conditional_status >= 7 else 4
# self.params_memory.put_int("CEStatus", override_value)
# else:
# self.params.put_bool_nonblocking("ExperimentalMode", not self.experimental_mode)
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents) and self.experimental_mode_via_lkas:
if self.frogpilot_variables.conditional_experimental_mode:
conditional_status = self.params_memory.get_int("CEStatus")
override_value = 0 if conditional_status in {1, 2, 3, 4, 5, 6} else 3 if conditional_status >= 7 else 4
self.params_memory.put_int("CEStatus", override_value)
else:
self.params.put_bool_nonblocking("ExperimentalMode", not self.experimental_mode)
self.previously_enabled |= (self.enabled or self.FPCC.alwaysOnLateral) and CS.vEgo > CRUISING_SPEED
self.previously_enabled &= self.driving_gear