From 333ae8fc85a9c22c2dcc6e74981212bb429ddbc2 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 7 Aug 2026 19:26:10 -0700 Subject: [PATCH 1/5] toggle --- openpilot/selfdrive/ui/mici/layouts/settings/toggles.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py b/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py index 57cbf9410ba457..5efcea0e4b5e35 100644 --- a/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py +++ b/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py @@ -44,6 +44,7 @@ def __init__(self): self._personality_toggle = BigMultiParamToggle("driving personality", "LongitudinalPersonality", ["aggressive", "standard", "relaxed"]) self._experimental_btn = BigToggle("experimental mode", initial_state=ui_state.params.get_bool("ExperimentalMode"), toggle_callback=self._on_experimental_mode) + aol_toggle = BigParamControl("always on lateral", "IsAolEnabled") is_metric_toggle = BigParamControl("use metric units", "IsMetric") ldw_toggle = BigParamControl("lane departure warnings", "IsLdwEnabled") always_on_dm_toggle = BigParamControl("always-on driver monitor", "AlwaysOnDM") From caf8e4ed1bcb5d49b5379717d2db5db6417576e6 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 7 Aug 2026 19:28:09 -0700 Subject: [PATCH 2/5] param --- openpilot/common/params_keys.h | 1 + openpilot/selfdrive/ui/mici/layouts/settings/toggles.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openpilot/common/params_keys.h b/openpilot/common/params_keys.h index 5bdfdf86362e40..052b2a90f8765f 100644 --- a/openpilot/common/params_keys.h +++ b/openpilot/common/params_keys.h @@ -56,6 +56,7 @@ inline static std::unordered_map keys = { {"HardwareSerial", {PERSISTENT, STRING}}, {"HasAcceptedTerms", {PERSISTENT, STRING, "0"}}, {"InstallDate", {PERSISTENT, TIME}}, + {"IsAosEnabled", {PERSISTENT, BOOL}}, {"IsDriverViewEnabled", {CLEAR_ON_MANAGER_START, BOOL}}, {"IsEngaged", {PERSISTENT, BOOL}}, {"IsLdwEnabled", {PERSISTENT, BOOL}}, diff --git a/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py b/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py index 5efcea0e4b5e35..382353efad0261 100644 --- a/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py +++ b/openpilot/selfdrive/ui/mici/layouts/settings/toggles.py @@ -44,7 +44,7 @@ def __init__(self): self._personality_toggle = BigMultiParamToggle("driving personality", "LongitudinalPersonality", ["aggressive", "standard", "relaxed"]) self._experimental_btn = BigToggle("experimental mode", initial_state=ui_state.params.get_bool("ExperimentalMode"), toggle_callback=self._on_experimental_mode) - aol_toggle = BigParamControl("always on lateral", "IsAolEnabled") + aos_toggle = BigParamControl("always on steering", "IsAosEnabled") is_metric_toggle = BigParamControl("use metric units", "IsMetric") ldw_toggle = BigParamControl("lane departure warnings", "IsLdwEnabled") always_on_dm_toggle = BigParamControl("always-on driver monitor", "AlwaysOnDM") @@ -55,6 +55,7 @@ def __init__(self): self._scroller.add_widgets([ self._personality_toggle, self._experimental_btn, + aos_toggle, is_metric_toggle, ldw_toggle, always_on_dm_toggle, @@ -66,6 +67,7 @@ def __init__(self): # Toggle lists self._refresh_toggles = ( ("ExperimentalMode", self._experimental_btn), + ("IsAosEnabled", aos_toggle), ("IsMetric", is_metric_toggle), ("IsLdwEnabled", ldw_toggle), ("AlwaysOnDM", always_on_dm_toggle), From 6a0826d171f9e7110ee9ecfcd6669f7dad3bb29c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 7 Aug 2026 19:31:21 -0700 Subject: [PATCH 3/5] hmm --- openpilot/selfdrive/selfdrived/selfdrived.py | 8 +++++--- openpilot/selfdrive/selfdrived/state.py | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openpilot/selfdrive/selfdrived/selfdrived.py b/openpilot/selfdrive/selfdrived/selfdrived.py index f76c161acda597..b5e53ac422e11e 100755 --- a/openpilot/selfdrive/selfdrived/selfdrived.py +++ b/openpilot/selfdrive/selfdrived/selfdrived.py @@ -115,7 +115,8 @@ def __init__(self, CP=None): self.initialized = False self.enabled = False - self.active = False + self.lat_active = False + self.long_active = False self.mismatch_counter = 0 self.cruise_mismatch_counter = 0 self.last_steering_pressed_frame = 0 @@ -524,7 +525,8 @@ def publish_selfdriveState(self, CS): ss_msg.valid = True ss = ss_msg.selfdriveState ss.enabled = self.enabled - ss.active = self.active + ss.latActive = self.lat_active + ss.longActive = self.long_active ss.state = self.state_machine.state ss.engageable = not self.events.contains(ET.NO_ENTRY) ss.experimentalMode = self.experimental_mode @@ -552,7 +554,7 @@ def step(self): CS = self.data_sample() self.update_events(CS) if not self.CP.passive and self.initialized: - self.enabled, self.active = self.state_machine.update(self.events) + self.enabled, self.long_active = self.state_machine.update(self.events) self.update_alerts(CS) self.publish_selfdriveState(CS) diff --git a/openpilot/selfdrive/selfdrived/state.py b/openpilot/selfdrive/selfdrived/state.py index eca001950371a3..e4dd97e745850f 100644 --- a/openpilot/selfdrive/selfdrived/state.py +++ b/openpilot/selfdrive/selfdrived/state.py @@ -8,6 +8,7 @@ ACTIVE_STATES = (State.enabled, State.softDisabling, State.overriding) ENABLED_STATES = (State.preEnabled, *ACTIVE_STATES) + class StateMachine: def __init__(self): self.current_alert_types = [ET.PERMANENT] @@ -91,8 +92,8 @@ def update(self, events: Events): # Check if openpilot is engaged and actuators are enabled enabled = self.state in ENABLED_STATES - active = self.state in ACTIVE_STATES - if active: + long_active = self.state in ACTIVE_STATES + if long_active: self.current_alert_types.append(ET.WARNING) - return enabled, active + return enabled, long_active From ef5a567bbc9d4eab477b4b4b11e6d3a2eda53efe Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 7 Aug 2026 19:35:31 -0700 Subject: [PATCH 4/5] notes --- openpilot/selfdrive/selfdrived/events.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openpilot/selfdrive/selfdrived/events.py b/openpilot/selfdrive/selfdrived/events.py index c9bae1f1d33e87..58d9c5b0b018b7 100755 --- a/openpilot/selfdrive/selfdrived/events.py +++ b/openpilot/selfdrive/selfdrived/events.py @@ -33,7 +33,12 @@ class Priority(IntEnum): # Event types class ET: + # on main, LAT_ENABLE? on set, ENABLE? on brake, USER_DISABLE_LONG? + # or simpler, USER_DISABLE just relates to long, but how should other DISABLEs affect it? + # should NO_ENTRY conditions be different for each mode? should it even play a tone if you turn on main in park after you start the car? + # or should it "enable" and wait until drive? ENABLE = 'enable' + LAT_ENABLE = 'latEnable' PRE_ENABLE = 'preEnable' OVERRIDE_LATERAL = 'overrideLateral' OVERRIDE_LONGITUDINAL = 'overrideLongitudinal' @@ -688,6 +693,11 @@ def invalid_lkas_setting_alert(CP: car.CarParams, CS: car.CarState, sm: messagin ET.ENABLE: EngagementAlert(AudibleAlert.engage), }, + EventName.latEnable: { + # TODO: two different tones? + ET.LAT_ENABLE: EngagementAlert(AudibleAlert.engage), + }, + EventName.pcmDisable: { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), }, From ecc11b57d1df7bec8dbfe08bc881f918d8df9883 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 7 Aug 2026 19:36:37 -0700 Subject: [PATCH 5/5] note --- openpilot/selfdrive/selfdrived/selfdrived.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpilot/selfdrive/selfdrived/selfdrived.py b/openpilot/selfdrive/selfdrived/selfdrived.py index b5e53ac422e11e..6ff19fae9eff18 100755 --- a/openpilot/selfdrive/selfdrived/selfdrived.py +++ b/openpilot/selfdrive/selfdrived/selfdrived.py @@ -115,6 +115,7 @@ def __init__(self, CP=None): self.initialized = False self.enabled = False + # i don't think we can keep selfdrived lat/long agnostic since it handles event state machine self.lat_active = False self.long_active = False self.mismatch_counter = 0