FrogPilot features - Only change personality if the GM menu is open

This commit is contained in:
FrogAi
2024-06-07 05:46:54 -07:00
parent 784ab52985
commit fa9cb60e61
2 changed files with 12 additions and 2 deletions
+3
View File
@@ -169,6 +169,9 @@ class CarState(CarStateBase):
ret.leftBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["LeftBSM"] == 1
ret.rightBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["RightBSM"] == 1
# FrogPilot CarState functions
fp_ret.hasMenu = not (self.CP.flags & GMFlags.NO_CAMERA.value or self.CP.carFingerprint in CC_ONLY_CAR)
return ret, fp_ret
@staticmethod
Executable → Regular
+9 -2
View File
@@ -182,6 +182,8 @@ class Controls:
self.update_toggles = False
self.display_timer = 0
def set_initial_state(self):
if REPLAY:
controls_state = self.params.get("ReplayControlsState")
@@ -654,8 +656,13 @@ class Controls:
# decrement personality on distance button press
if self.CP.openpilotLongitudinalControl:
if any(not be.pressed and be.type == ButtonType.gapAdjustCruise for be in CS.buttonEvents):
self.personality = (self.personality - 1) % 3
self.params.put_nonblocking('LongitudinalPersonality', str(self.personality))
menu_open = self.display_timer > 0 or not self.sm['frogpilotCarState'].hasMenu
if menu_open:
self.personality = (self.personality - 1) % 3
self.params.put_nonblocking('LongitudinalPersonality', str(self.personality))
self.display_timer = 350
self.display_timer -= 1
FPCC = self.update_frogpilot_variables(CS)