From 5ac02da427d444a40b4623ba0d9866e9bc8a5067 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Sat, 28 Nov 2026 11:02:32 -0600 Subject: [PATCH] Show End to End Slowdown Reasons on Both Displays --- openpilot/starpilot/ui/onroad.py | 2 ++ openpilot/starpilot/ui/onroad_cem_gauge.py | 6 +++++- openpilot/starpilot/ui/onroad_compact_widgets.py | 4 +++- openpilot/starpilot/ui/runtime_app.py | 4 ++-- openpilot/starpilot/ui/tests/test_onroad_axes.py | 3 +++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/openpilot/starpilot/ui/onroad.py b/openpilot/starpilot/ui/onroad.py index bd7b3dab14..91db3251f6 100644 --- a/openpilot/starpilot/ui/onroad.py +++ b/openpilot/starpilot/ui/onroad.py @@ -72,6 +72,8 @@ def driving_mode_description(state: OnroadState) -> str: mode = state.conditional_effective experimental = (mode.effective_experimental if mode is not None else state.experimental_enabled and state.conditional_configured in (None, ModeChoice.STOCK)) + if experimental and state.e2e_slowdown is not None: + return f"E2E · {state.e2e_slowdown}" return "ACC - End to End" if experimental else "ACC - Chill" if state.lateral_active: return "Always On Lateral" diff --git a/openpilot/starpilot/ui/onroad_cem_gauge.py b/openpilot/starpilot/ui/onroad_cem_gauge.py index 55bb777443..a3814ad704 100644 --- a/openpilot/starpilot/ui/onroad_cem_gauge.py +++ b/openpilot/starpilot/ui/onroad_cem_gauge.py @@ -113,6 +113,8 @@ def gauge_data(state: OnroadState, *, lead_stopped: bool = False) -> AetherGauge state.appearance.camera_view in (CameraViewChoice.DRIVER, CameraViewChoice.NONE) or state.reverse_driver_camera): return None current = reason(state) if status(state) is not None else None + if state.e2e_slowdown == 'Stopping': + return AetherGaugeData('STOPPING', color=COLOR_FORCE_STOP, indicator_type=IndicatorType.STOP_LIGHT) if current == 'cem_stop' or stop_observed(state): # The current receipt has no committed distance. Preserve the light/road # graphic without claiming a numeric distance from an unrelated model path. @@ -135,7 +137,7 @@ def gauge_data(state: OnroadState, *, lead_stopped: bool = False) -> AetherGauge color=glow_color(intensity(curvature)) if curvature is not None else COLOR_CEM_SPEED, indicator_type=IndicatorType.ROAD_CURVE, indicator_value=curvature or 0.0, reduction_text=f'-{reduction}' if reduction > 0 else '', is_numeric=shown is not None) - if current in ('cem_lead', 'ccm_lead'): + if state.e2e_slowdown == 'Lead vehicle' or current in ('cem_lead', 'ccm_lead'): lead = state.conditional_lead # Only current radar metrics may classify the lead as stopped/slower. stopped = lead is not None and lead.speed_mps < (1.2 if lead_stopped else 0.8) @@ -143,6 +145,8 @@ def gauge_data(state: OnroadState, *, lead_stopped: bool = False) -> AetherGauge color=COLOR_LEAD_STOPPED if stopped else COLOR_LEAD_SLOWER, indicator_type=IndicatorType.LEAD, indicator_extra='stopped' if stopped else 'slower' if lead is not None else '') + if state.e2e_slowdown is not None: + return AetherGaugeData(state.e2e_slowdown.upper(), color=COLOR_REDUCTION) return None diff --git a/openpilot/starpilot/ui/onroad_compact_widgets.py b/openpilot/starpilot/ui/onroad_compact_widgets.py index 64567e8f50..211f8a3a6d 100644 --- a/openpilot/starpilot/ui/onroad_compact_widgets.py +++ b/openpilot/starpilot/ui/onroad_compact_widgets.py @@ -244,7 +244,7 @@ class MiciSidebarWidgets: def _conditional(self, center: rl.Rectangle, state: OnroadState) -> None: conditional = conditional_status(state) preview = state.visual_preview - if stop_active(state) or stop_observed(state): + if state.e2e_slowdown == 'Stopping' or stop_active(state) or stop_observed(state): self._stop_icon(center) elif (preview is not None and preview.curve_curvature is not None and state.alert.size != AlertSize.FULL) or curve_controlling(state): self._curve_icon(center) @@ -254,6 +254,8 @@ class MiciSidebarWidgets: icon = {'cem_stop': 'stop', 'cem_lead': 'lead', 'ccm_lead': 'lead', 'cem_curve': 'curve', 'cem_signal': 'turn', 'cem_speed': 'speed', 'cem_open_road': 'speed', 'cem_speed_limit': 'speed', 'ccm_speed': 'speed'}.get(reason) + if family == 'E2E': + icon = {'Lead vehicle': 'lead', 'Curve': 'curve', 'Slowing': 'speed'}.get(state.e2e_slowdown) if icon == 'stop': self._stop_icon(center) elif icon == 'lead': diff --git a/openpilot/starpilot/ui/runtime_app.py b/openpilot/starpilot/ui/runtime_app.py index cff0d9fd95..65d7c966db 100644 --- a/openpilot/starpilot/ui/runtime_app.py +++ b/openpilot/starpilot/ui/runtime_app.py @@ -453,9 +453,9 @@ class StarShellSession(TeslaSpeedActions): EXPERIMENTAL: FavoriteAction(EXPERIMENTAL, "End to End", kind="toggle", state_label=("Overridden Chill" if (state.conditional_effective is not None and state.conditional_effective.reason == 'manual_chill') else - "Forced Experimental" if (state.conditional_effective is not None and + "Forced End to End" if (state.conditional_effective is not None and state.conditional_effective.reason == 'manual_experimental') else - "Automatic Experimental" if (state.conditional_effective is not None and + "Automatic End to End" if (state.conditional_effective is not None and state.conditional_effective.effective_experimental) else "On" if state.experimental_enabled else "Off"), available=exp_available, reason=("Active longitudinal control and current conditional status required" if conditional else diff --git a/openpilot/starpilot/ui/tests/test_onroad_axes.py b/openpilot/starpilot/ui/tests/test_onroad_axes.py index 69aa68d244..1137eb94ce 100644 --- a/openpilot/starpilot/ui/tests/test_onroad_axes.py +++ b/openpilot/starpilot/ui/tests/test_onroad_axes.py @@ -346,6 +346,9 @@ class TestOnroadAxes(unittest.TestCase): self.ui.sm.put('longitudinalPlan', NS(aTarget=-0.5, hasLead=True, shouldStop=False, longitudinalPlanSource='lead0')) slowing = self.state(True, True) self.assertEqual(slowing.e2e_slowdown, 'Lead vehicle') + self.assertEqual(driving_mode_description(slowing), 'E2E · Lead vehicle') + from openpilot.starpilot.ui.onroad_cem_gauge import IndicatorType, gauge_data + self.assertEqual(gauge_data(slowing).indicator_type, IndicatorType.LEAD) self.assertEqual(rgba(axis_status_color(slowing)), (218, 111, 37, 255)) self.assertEqual(rgba(axis_status_color(replace(combined, longitudinal_active=False))), (10, 186, 181, 255)) self.assertEqual(rgba(axis_status_color(replace(combined, lateral_active=False))), (255, 105, 180, 255))