Conditional Experimental Mode

This commit is contained in:
James
2026-01-08 01:31:26 -07:00
parent 7388432fb9
commit 68b60b3635
17 changed files with 206 additions and 3 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ class VCruiseHelper:
if self.CP.pcmCruise and not self.gm_cc_only:
return
initial = V_CRUISE_INITIAL_EXPERIMENTAL_MODE if experimental_mode else V_CRUISE_INITIAL
initial = V_CRUISE_INITIAL_EXPERIMENTAL_MODE if experimental_mode and not frogpilot_toggles.conditional_experimental_mode else V_CRUISE_INITIAL
if (any(b.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for b in CS.buttonEvents)
and self.v_cruise_initialized or (self.gm_cc_only and resume_prev_button)):
+7 -1
View File
@@ -434,6 +434,11 @@ class SelfdriveD:
# FrogPilot variables
self.frogpilot_events.add_from_msg(self.sm['frogpilotPlan'].frogpilotEvents)
if self.frogpilot_toggles.conditional_experimental_mode:
self.experimental_mode = self.sm['frogpilotPlan'].experimentalMode
else:
self.experimental_mode |= self.sm['frogpilotPlan'].experimentalMode
def data_sample(self):
_car_state = messaging.recv_one(self.car_state_sock)
CS = _car_state.carState if _car_state else self.CS_prev
@@ -572,7 +577,8 @@ class SelfdriveD:
self.is_metric = self.params.get_bool("IsMetric")
self.is_ldw_enabled = self.params.get_bool("IsLdwEnabled")
self.disengage_on_accelerator = self.params.get_bool("DisengageOnAccelerator")
self.experimental_mode = self.params.get_bool("ExperimentalMode") and self.CP.openpilotLongitudinalControl
if not self.frogpilot_toggles.conditional_experimental_mode:
self.experimental_mode = self.params.get_bool("ExperimentalMode") and self.CP.openpilotLongitudinalControl
self.personality = self.params.get("LongitudinalPersonality", return_default=True)
time.sleep(0.1)
+8 -1
View File
@@ -31,7 +31,12 @@ void ExperimentalButton::changeMode() {
bool can_change = hasLongitudinalControl(cp) && params.getBool("ExperimentalModeConfirmed");
if (can_change) {
// FrogPilot variables
params.putBool("ExperimentalMode", !experimental_mode);
if (frogpilot_toggles.value("conditional_experimental_mode").toBool()) {
int override_value = (frogpilot_scene.conditional_status == 1 || frogpilot_scene.conditional_status == 2) ? 0 : experimental_mode ? 1 : 2;
params_memory.putInt("CEStatus", override_value);
} else {
params.putBool("ExperimentalMode", !experimental_mode);
}
}
}
@@ -65,6 +70,8 @@ void ExperimentalButton::updateBackgroundColor() {
background_color = QColor(0, 0, 0, 166);
} else if (frogpilot_scene.always_on_lateral_active) {
background_color = bg_colors[STATUS_ALWAYS_ON_LATERAL_ACTIVE];
} else if (frogpilot_scene.conditional_status == 1) {
background_color = bg_colors[STATUS_CEM_DISABLED];
} else if (experimental_mode) {
background_color = bg_colors[STATUS_EXPERIMENTAL_MODE_ENABLED];
} else {
+2
View File
@@ -47,6 +47,7 @@ typedef enum UIStatus {
// FrogPilot variables
STATUS_ALWAYS_ON_LATERAL_ACTIVE,
STATUS_CEM_DISABLED,
STATUS_EXPERIMENTAL_MODE_ENABLED,
} UIStatus;
@@ -57,6 +58,7 @@ const QColor bg_colors [] = {
// FrogPilot variables
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(0x0a, 0xba, 0xb5, 0xf1),
[STATUS_CEM_DISABLED] = QColor(0xff, 0xff, 0x00, 0xf1),
[STATUS_EXPERIMENTAL_MODE_ENABLED] = QColor(0xda, 0x6f, 0x25, 0xf1),
};