This commit is contained in:
Your Name
2024-05-21 00:29:31 -05:00
parent dd96b5aea7
commit b3467cf739
3 changed files with 44 additions and 9 deletions

View File

@@ -1133,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