End to End Planner Presentation

This commit is contained in:
firestar5683
2026-11-28 10:53:55 -06:00
parent 810486b8fe
commit ddf0efc8d7
29 changed files with 75 additions and 59 deletions
@@ -30,7 +30,7 @@ DESCRIPTIONS = {
"<b>WARNING: openpilot longitudinal control is in alpha for this car and may disable Automatic Emergency Braking (AEB).</b><br><br>" +
"On this car, openpilot defaults to the car's built-in ACC instead of openpilot's longitudinal control. " +
"This saves a request for openpilot longitudinal control; an exact vehicle check and verified takeover are required at startup. " +
"Enabling Experimental mode is recommended when enabling openpilot longitudinal control alpha. " +
"Enabling End to End is recommended when enabling openpilot longitudinal control alpha. " +
"Changing this setting will restart openpilot if the car is powered on."
),
'cellular_disabled': tr_noop(
@@ -11,7 +11,7 @@ TITLE = tr_noop("Firehose Mode")
DESCRIPTION = tr_noop(
"openpilot learns to drive by watching humans, like you, drive.\n\n"
+ "Firehose Mode allows you to maximize your training data uploads to improve "
+ "openpilot's driving models. More data means bigger models, which means better Experimental Mode."
+ "openpilot's driving models. More data means bigger models, which means better End to End."
)
INSTRUCTIONS = tr_noop(
"For maximum effectiveness, bring your device inside and connect to a good USB-C adapter and Wi-Fi weekly.\n\n"
@@ -55,7 +55,7 @@ class TogglesLayout(Widget):
True,
),
"ExperimentalMode": (
lambda: tr("Experimental Mode"),
lambda: tr("End to End"),
"",
"experimental_white.png",
False,
@@ -194,15 +194,15 @@ class TogglesLayout(Widget):
self._toggles["ExperimentalMode"].action_item.set_enabled(False)
self._long_personality_setting.action_item.set_enabled(False)
unavailable = tr("Experimental mode is currently unavailable on this car since the car's stock ACC is used for longitudinal control.")
unavailable = tr("End to End is currently unavailable on this car since the car's stock ACC is used for longitudinal control.")
long_desc = unavailable + " " + tr("openpilot longitudinal control may come in a future update.")
if ui_state.CP.alphaLongitudinalAvailable or ioniq6_alpha_long_available(ui_state.CP):
if self._is_release and not ford_release_long_available(ui_state.CP):
long_desc = unavailable + " " + tr("An alpha version of openpilot longitudinal control can be tested, along with " +
"Experimental mode, on non-release branches.")
"End to End, on non-release branches.")
else:
long_desc = tr("Enable the openpilot longitudinal control (alpha) toggle to allow Experimental mode.")
long_desc = tr("Enable the openpilot longitudinal control (alpha) toggle to allow End to End.")
self._toggles["ExperimentalMode"].set_description("<b>" + long_desc + "</b><br><br>" + e2e_description)
else:
@@ -21,7 +21,7 @@ TITLE = tr_noop("Firehose Mode")
DESCRIPTION = tr_noop(
"openpilot learns to drive by watching humans, like you, drive.\n\n"
+ "Firehose Mode allows you to maximize your training data uploads to improve "
+ "openpilot's driving models. More data means bigger models, which means better Experimental Mode."
+ "openpilot's driving models. More data means bigger models, which means better End to End."
)
INSTRUCTIONS_INTRO = tr_noop(
"For maximum effectiveness, bring your device inside and connect to a good USB-C adapter and Wi-Fi weekly.\n\n"
@@ -33,7 +33,7 @@ class TogglesLayoutMici(NavScroller):
"Relaxed leaves more space.\n" +
"Use the steering wheel distance button on supported cars.")
self._safe_mode_btn = BigParamControl("safe mode", "SafeMode", toggle_callback=restart_needed_callback)
self._experimental_btn = BigParamControl("experimental mode", "ExperimentalMode",
self._experimental_btn = BigParamControl("End to End", "ExperimentalMode",
description_icon=gui_app.texture("icons_mici/experimental_mode.png", 64, 64),
description="Let the driving model control gas and brakes.\n" +
"Includes stopping for red lights and stop signs.\n" +
@@ -130,7 +130,7 @@ class TogglesLayoutMici(NavScroller):
self._experimental_btn.set_checked(False)
self._personality_toggle.set_value("relaxed")
# CP gating for experimental mode
# CP gating for End to End
if ui_state.CP is not None:
if ui_state.has_longitudinal_control:
self._experimental_btn.set_visible(True)
@@ -48,7 +48,7 @@ class ExperimentalModeButton(Widget):
rl.draw_line_ex(rl.Vector2(line_x, rect.y), rl.Vector2(line_x, rect.y + rect.height), 3, separator_color)
# Draw text label (left aligned)
text = tr("EXPERIMENTAL MODE ON") if self.experimental_mode else tr("CHILL MODE ON")
text = tr("END TO END ON") if self.experimental_mode else tr("CHILL MODE ON")
text_x = rect.x + self.horizontal_padding
text_y = rect.y + rect.height / 2 - 45 * FONT_SCALE // 2 # Center vertically
+1 -1
View File
@@ -57,7 +57,7 @@ def mapped_actions(feature_snapshot, feature_apply, appearance_snapshot, appeara
if row.key in APPEARANCE_KEYS and (requested_keys is None or row.key in requested_keys):
actions[row.key] = _row_action(row, appearance_apply, "Visual")
actions[BOOKMARK] = FavoriteAction(BOOKMARK, "Bookmark", reason="Use this control on the device")
actions[EXPERIMENTAL] = FavoriteAction(EXPERIMENTAL, "Experimental Mode", kind="toggle", state_label="On device",
actions[EXPERIMENTAL] = FavoriteAction(EXPERIMENTAL, "End to End", kind="toggle", state_label="On device",
reason="Use this control on the device")
actions[CYCLE_PERSONALITY] = FavoriteAction(CYCLE_PERSONALITY, "Cycle Driving Personality", kind="enum", state_label="On device",
reason="Use this control on the device")
@@ -379,7 +379,7 @@ def purpose(row):
if key.startswith('conditional:'):
section, field = key.split(':')[1:]
if field in ('speed_mps', 'speed_with_lead_mps'):
direction, mode = ('below', 'Experimental') if section == 'cem' else ('at or above', 'Chill')
direction, mode = ('below', 'End to End') if section == 'cem' else ('at or above', 'Chill')
lead = 'while following a lead' if field == 'speed_with_lead_mps' else 'without a tracked lead'
return f'Requests {mode} {direction} this speed {lead}, when the remaining driving conditions qualify.'
if field == 'lead':
@@ -5,7 +5,7 @@ export const PREVIEW_SCENES = [
{ id: "engaged", label: "Engaged" },
{ id: "aol", label: "Lateral only" },
{ id: "long_only", label: "Longitudinal only" },
{ id: "experimental", label: "Manual experimental" },
{ id: "experimental", label: "End to End" },
{ id: "braking", label: "Braking" },
{ id: "stopped", label: "Stopped timer" },
{ id: "cem_stop_light", label: "CEM · Traffic light" },
@@ -30,8 +30,8 @@ export function previewScene(scene) {
const longitudinal = !off && scene !== "aol"
const experimental = scene === "experimental" || scene.startsWith("cem_")
return { lateral, longitudinal, experimental,
border: off ? "#122839" : scene === "slc_pedal" ? "#919b95" : experimental ? "#da6f25" : !longitudinal ? "#0abab5" : !lateral ? "#ff69b4" : "#167f40",
mode: off ? "Disengaged" : scene === "slc_pedal" ? "ACC - Override" : !longitudinal ? "Always On Lateral" : experimental ? "ACC - Experimental" : "ACC - Chill" }
border: off ? "#122839" : scene === "slc_pedal" ? "#919b95" : scene.startsWith("cem_") ? "#da6f25" : !longitudinal ? "#0abab5" : !lateral ? "#ff69b4" : "#167f40",
mode: off ? "Disengaged" : scene === "slc_pedal" ? "ACC - Override" : !longitudinal ? "Always On Lateral" : experimental ? "ACC - End to End" : "ACC - Chill" }
}
export function sceneHidesWidget(scene, profile, id, layout = {}, widgets = {}, sprites = {}) {
@@ -180,7 +180,7 @@ export const LayoutWidgetPreview = {
withAlpha,
modeLines(scene, profile) {
const { mode, experimental } = previewScene(scene), aol = scene === "aol"
if (profile === "compact" && (aol || experimental)) return aol ? ["Always On", "Lateral"] : ["ACC -", "Experimental"]
if (profile === "compact" && (aol || experimental)) return aol ? ["Always On", "Lateral"] : ["ACC -", "End to End"]
return [mode]
},
pending(scene) { return scene === "general" || scene === "slc_pending" },
@@ -206,7 +206,7 @@ export const PREVIEW_SCENARIOS = {
},
'With openpilot': {
'learning-curve': scene('K while curves are learning', 'K', 4, 'front', { curve: 'learning' }),
experimental: scene('K in Experimental mode', 'K', 4, 'front', { border: '#DA6F25' }),
experimental: scene('K in End to End', 'K', 4, 'front', { border: '#DA6F25' }),
chill: scene('K in Chill mode', 'K', 4, 'front', { border: '#FFD600' }),
disengaged: scene('K while disengaged', 'K', 4, 'front', { border: '#122839' }),
'tight-curve': scene('Ka in a tight curve', 'KA', 5, 'front', { curve: 'tight' }),
@@ -35,16 +35,16 @@ def driving_mode_label(state) -> str | None:
return None # not reported between planner updates
# Disengaged, nothing is reported and nothing switches by itself: the flag is the driver's choice.
experimental = getattr(state, 'experimental_enabled', None)
return None if not isinstance(experimental, bool) else 'Experimental Mode' if experimental else 'Chill Mode'
return None if not isinstance(experimental, bool) else 'End to End' if experimental else 'Chill Mode'
if effective.reason == 'manual_experimental':
return 'Experimental Mode'
return 'End to End'
if effective.reason == 'manual_chill':
return 'Chill Mode'
return 'Conditional Experimental' if choice is ModeChoice.CEM else 'Conditional Chill'
experimental = getattr(state, 'experimental_enabled', None)
if not isinstance(experimental, bool):
return None
return 'Experimental Mode' if experimental else 'Chill Mode'
return 'End to End' if experimental else 'Chill Mode'
def certificate_notice(days_left: int | None) -> str:
@@ -635,7 +635,7 @@ class TestProjectionOnroad(unittest.TestCase):
chill, experimental = State(), State(experimental_enabled=True)
self.assertIs(view._with_mode_notice(chill, 0), chill, "the drive's starting mode is not announced")
shown = view._with_mode_notice(experimental, 1_000)
self.assertEqual((shown.alert.size, shown.alert.text1), ('small', 'Experimental Mode'))
self.assertEqual((shown.alert.size, shown.alert.text1), ('small', 'End to End'))
real = State(Alert(size='full', text1='Take Control'), experimental_enabled=True)
self.assertIs(view._with_mode_notice(real, 2_000), real, 'a real alert wins')
self.assertIs(view._with_mode_notice(experimental, 1_000 + projection.MODE_NOTICE_NS), experimental)
@@ -655,14 +655,14 @@ class TestProjectionOnroad(unittest.TestCase):
def parked(experimental):
return State(experimental_enabled=experimental, conditional_configured=ModeChoice.CCM, engaged=False)
view._with_mode_notice(parked(False), 0)
self.assertEqual(view._with_mode_notice(parked(True), 1).alert.text1, 'Experimental Mode')
self.assertEqual(view._with_mode_notice(parked(True), 1).alert.text1, 'End to End')
self.assertEqual(view._with_mode_notice(parked(False), 3_000_000_000).alert.text1, 'Chill Mode')
view = projection.ProjectionOnroad(dependencies=native)
view._with_mode_notice(conditional('manual_chill', False), 0)
for now, frame in enumerate((conditional('lead', True), conditional('manual_experimental', True)), start=1):
shown = view._with_mode_notice(frame, now)
self.assertEqual(shown.alert.text1, 'Experimental Mode')
self.assertEqual(shown.alert.text1, 'End to End')
quiet = view._with_mode_notice(conditional('cruising', False), 10_000_000_000)
self.assertEqual(quiet.alert.text1, '')
stopped = State(experimental_enabled=True, conditional_configured=ModeChoice.CEM, engaged=False)
@@ -33,7 +33,7 @@ LABELS = {
"signal_lane_detection": "Signal lane detection", "signal_lane_width_m": "Signal lane width",
"set_speed_margin_mps": "Set speed margin", "launch_assist": "Launch assist",
}
MODES = ("Automatic", "Chill", "Experimental")
MODES = ("Automatic", "Chill", "End to End")
SIGNAL_LANE_FIELDS = frozenset(("signal_lane_detection", "signal_lane_width_m"))
SIGNAL_LANE_HELP = {
"signal_lane_detection": "Distinguish a turn from a lane change using the space beside your car. With this on, a turn signal requests " +
@@ -164,14 +164,14 @@ class ConditionalFeature:
(mode_document, mode_readable), (baseline, baseline_readable), (mode_safe, mode_safe_readable) = read_mode_sources(self.owner.params)
mode_valid = (mode_readable and mode_document == document and baseline_readable and baseline in (None, b"0", b"1") and
mode_safe_readable and mode_safe in (None, b"0", b"1"))
choice = {"stock": "Experimental" if baseline == b"1" else "Chill",
choice = {"stock": "End to End" if baseline == b"1" else "Chill",
"conditional_experimental": "Automatic", "conditional_chill": "Automatic"}[preferences.mode.value]
cp = self.owner.vehicle_params()
choices = MODES if choice == "Experimental" or experimental_available(cp) and mode_safe in (None, b"0") else tuple(
mode for mode in MODES if mode != "Experimental")
choices = MODES if choice == "End to End" or experimental_available(cp) and mode_safe in (None, b"0") else tuple(
mode for mode in MODES if mode != "End to End")
rows.append(FeatureRow(MODE, "Driving Mode", choice if mode_valid else "Unavailable", document,
choices if mode_valid else (), default_value=MODES[0], available=allowed and mode_valid,
reason="Automatic switches between Chill and Experimental using your saved conditions." if allowed and mode_valid else unavailable,
reason="Automatic switches between Chill and End to End using your saved conditions." if allowed and mode_valid else unavailable,
vehicle_fingerprint=self.owner.vehicle_fingerprint(), capability=_mode_capability(cp),
dependencies=dependencies + (("ExperimentalMode", baseline), ("SafeMode", mode_safe))))
rows.append(FeatureRow("", "Automatic conditions", "Saved options", page="conditional/cem", available=True))
@@ -252,7 +252,7 @@ class ConditionalFeature:
def authorized_mode() -> bool:
cp = self.owner.vehicle_params()
return bool(self.owner.authority("preferences") and
(request.value != "Experimental" or request.capability is not None and
(request.value != "End to End" or request.capability is not None and
_mode_capability(cp) == request.capability and self.owner.vehicle_fingerprint() == request.capability[0] and
experimental_available(cp) and safe in (None, b"0")))
@@ -260,11 +260,11 @@ class ConditionalFeature:
return False
try:
preferences = SavedPreferences() if document is None else decode_preferences(document)
value = "Stock" if request.value in ("Chill", "Experimental") else "Conditional Experimental"
value = "Stock" if request.value in ("Chill", "End to End") else "Conditional Experimental"
raw = edit(preferences, MODE, value, metric=units == b"1")
except PreferenceError:
return False
next_baseline = b"1" if request.value == "Experimental" else b"0" if request.value == "Chill" else baseline or b"0"
next_baseline = b"1" if request.value == "End to End" else b"0" if request.value == "Chill" else baseline or b"0"
result = commit_mode(self.owner.params, raw, next_baseline, expected=document, expected_baseline=baseline,
expected_units=units, expected_safe=safe, authorized=authorized_mode)
return result.committed and result.verified
+1 -1
View File
@@ -185,7 +185,7 @@ class HomeView:
line_x = rect.x + rect.width - 130
rl.draw_line_ex(rl.Vector2(line_x, rect.y), rl.Vector2(line_x, rect.y + rect.height), 3, rl.Color(0, 0, 0, 77))
text = {HomeMode.CONDITIONAL_EXPERIMENTAL: "CONDITIONAL EXPERIMENTAL", HomeMode.CONDITIONAL_CHILL: "CONDITIONAL CHILL",
HomeMode.EXPERIMENTAL: "EXPERIMENTAL MODE ON", HomeMode.CHILL: "CHILL MODE ON"}[state.mode]
HomeMode.EXPERIMENTAL: "END TO END ON", HomeMode.CHILL: "CHILL MODE ON"}[state.mode]
size = 45
width = self._measure(text, FontRole.NORMAL, size).width
if width > line_x - rect.x - 50:
+2 -4
View File
@@ -72,7 +72,7 @@ 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))
return "ACC - Experimental" if experimental else "ACC - Chill"
return "ACC - End to End" if experimental else "ACC - Chill"
if state.lateral_active:
return "Always On Lateral"
if state.aol_latched and state.aol_armed_at_stop:
@@ -92,7 +92,7 @@ def axis_status_color(state: OnroadState) -> rl.Color:
return rl.Color(145, 155, 149, 255)
if lateral and state.switchback_mode:
return rl.Color(139, 108, 197, 255)
if stop_active(state):
if stop_active(state) or (state.longitudinal_active and state.e2e_slowdown is not None):
return rl.Color(218, 111, 37, 255)
if state.longitudinal_active and state.traffic_mode:
return rl.Color(201, 34, 49, 255)
@@ -102,8 +102,6 @@ def axis_status_color(state: OnroadState) -> rl.Color:
if mode is not None and mode.effective_experimental:
return rl.Color(218, 111, 37, 255)
if lateral and state.longitudinal_active:
if state.experimental_enabled and state.conditional_configured in (None, ModeChoice.STOCK):
return rl.Color(218, 111, 37, 255)
return rl.Color(22, 127, 64, 255)
if lateral:
return rl.Color(22, 127, 64, 255) if state.stock_cruise_active else rl.Color(10, 186, 181, 255)
@@ -63,6 +63,9 @@ def stop_active(state: OnroadState) -> bool:
def status(state: OnroadState) -> tuple[str, str, rl.Color] | None:
if (state.e2e_slowdown is not None and state.longitudinal_active and not state.longitudinal_overridden
and state.alert.size != AlertSize.FULL):
return 'E2E', state.e2e_slowdown, rl.Color(255, 155, 63, 255)
preview = state.visual_preview
if preview is not None and preview.cem_reason in ('CURVE', 'LEAD', 'STOP LIGHT', 'SPEED'):
if state.alert.size == AlertSize.FULL:
+1
View File
@@ -184,6 +184,7 @@ class OnroadState:
show_slc_offset: bool = True
experimental_available: bool = False
experimental_enabled: bool = False
e2e_slowdown: str | None = None
torque_utilization: float = 0.0
personality: int = 1
lead_detected: bool = False
+2 -2
View File
@@ -450,7 +450,7 @@ class StarShellSession(TeslaSpeedActions):
available=personality_available, reason="" if personality_available else "Longitudinal control required",
token=repr((drive, current_personality, personality_available)),
invoke=lambda: cycle_personality(1)),
EXPERIMENTAL: FavoriteAction(EXPERIMENTAL, "Experimental Mode", kind="toggle",
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
@@ -1612,7 +1612,7 @@ class StarShellSession(TeslaSpeedActions):
elif action.kind == HomeActionKind.OPEN_PAIRING:
self._unavailable("device pairing")
else:
self._unavailable("experimental mode owner")
self._unavailable("End to End owner")
elif request.source == "settings":
if action.kind == SettingsActionKind.CLOSE:
if self.selected == Destination.DRIVING_CONTROLS and getattr(self, "feature_edit_key", None) is not None:
+15 -1
View File
@@ -795,6 +795,20 @@ class RuntimeSnapshotAdapter:
drive_mode_source, display_car, cp=cp, drive_frame=after,
event_ns=int(sm.logMonoTime['starpilotCarState']) if drive_mode_source is not None else 0, now_ns=now_ns,
native_alert=alert, traffic_active=bool(traffic is not None and traffic.state == 'active'))
e2e_slowdown = None
if (observed_experimental and self._conditional_choice in (None, ModeChoice.STOCK) and
display_long_active and not longitudinal_overridden and display_plan is not None):
target = getattr(display_plan, 'aTarget', None)
if bool(getattr(display_plan, 'shouldStop', False)):
e2e_slowdown = "Stopping"
elif target is not None and math.isfinite(target) and target < -0.15:
source = getattr(display_plan, 'longitudinalPlanSource', None)
if source in ('lead0', 'lead1'):
e2e_slowdown = "Lead vehicle"
elif source == 'cruise' and curve is not None and curve.applied and curve.controlling:
e2e_slowdown = "Curve"
else:
e2e_slowdown = "Slowing"
onroad = OnroadState(weather_location=weather_location, developer_metrics=developer_metrics, stop_sign_observed_ns=stop_observed_ns,
engaged=display_lat_active or display_long_active or longitudinal_overridden, camera_available=started,
speed_mps=raw_speed, cruise_kph=cruise, speed_limit=observation,
@@ -802,7 +816,7 @@ class RuntimeSnapshotAdapter:
appearance=self._appearance_value, customization=self._customization_value,
alert=alert, metric=bool(ui.is_metric), slc_offset_schedule=self._slc_offset_schedule,
experimental_available=bool(ui.has_longitudinal_control),
experimental_enabled=observed_experimental,
experimental_enabled=observed_experimental, e2e_slowdown=e2e_slowdown,
personality=list(Personality).index(persona),
lead_detected=bool(display_plan is not None and display_plan.hasLead),
gas_pressed_override=bool(display_events is not None and any(
@@ -33,7 +33,7 @@ SET_SPEED_NEEDS = 'Set Speed To needs Comma can set speed on Tesla dashboard tur
# Every settings key these rows use (each control, and its speed when it is on Set Speed To).
KEYS = frozenset(PREFIX + name + suffix for name in TESLA_INPUTS for suffix in ('', ':speed'))
OPTIONS = {'Unassigned': '', 'Set Speed To': SPEED_SET, 'Resume Speed Limit + Offset': SPEED_RESUME, 'Cycle Driving Personality': CYCLE_PERSONALITY,
'Bookmark': BOOKMARK, 'Experimental Mode': EXPERIMENTAL, 'Force Coasting': FORCE_COAST, 'Pulse and Glide': PULSE_GLIDE,
'Bookmark': BOOKMARK, 'End to End': EXPERIMENTAL, 'Force Coasting': FORCE_COAST, 'Pulse and Glide': PULSE_GLIDE,
'Disengage Openpilot': DISENGAGE, 'Take Comma Selfie': SELFIE, 'Toggle Screen Off': SCREEN_OFF, 'Traffic Mode': TRAFFIC, 'Switchback Mode': SWITCHBACK}
for key in (*[k for keys in FEATURE_KEYS.values() for k in keys], *APPEARANCE_KEYS):
if key not in OPTIONS.values():
@@ -61,7 +61,7 @@ def test_cross_traffic_stop_publication_keeps_mode_border_and_camera_then_releas
state = replace(base, conditional_effective=display, experimental_enabled=result.experimental)
visual_status = status(state)
assert stop_active(state) and visual_status is not None and visual_status[:2] == ('CEM', 'STOP')
assert driving_mode_description(state) == 'ACC - Experimental'
assert driving_mode_description(state) == 'ACC - End to End'
color = axis_status_color(state)
assert (color.r, color.g, color.b) == (218, 111, 37)
view._switch_stream_if_needed({'selfdriveState': SimpleNamespace(experimentalMode=result.experimental),
@@ -64,10 +64,10 @@ class ConditionalFeatureTests(unittest.TestCase):
drive.conditional_settings = ConditionalSettingsOwner(self.params)
drive.conditional_replay = False
now = 1_000_000_000
for value, choice, baseline in (("Experimental", ModeChoice.STOCK, True), ("Chill", ModeChoice.STOCK, False),
for value, choice, baseline in (("End to End", ModeChoice.STOCK, True), ("Chill", ModeChoice.STOCK, False),
("Automatic", ModeChoice.CEM, False)):
row = self.row("conditional:mode")
self.assertEqual(row.choices, ("Automatic", "Chill", "Experimental"))
self.assertEqual(row.choices, ("Automatic", "Chill", "End to End"))
self.assertTrue(self.owner.apply(replace(required_change(row), value=value)))
self.assertEqual(self.row("conditional:mode").value, value)
saved = decode_preferences(Path(self.params.get_param_path("ConditionalModeConfig")).read_bytes())
@@ -79,7 +79,7 @@ class ConditionalFeatureTests(unittest.TestCase):
drive.update_conditional_mode(None)
self.assertEqual(drive.experimental_mode, baseline)
now += 100_000_000
self.assertTrue(self.owner.apply(replace(required_change(self.row("conditional:mode")), value="Experimental")))
self.assertTrue(self.owner.apply(replace(required_change(self.row("conditional:mode")), value="End to End")))
self.params.put_bool("SafeMode", True, block=True)
drive.refresh_saved_driving_mode(now)
drive.update_conditional_mode(None)
@@ -96,11 +96,11 @@ class ConditionalFeatureTests(unittest.TestCase):
row = self.row("conditional:mode")
self.assertIsNotNone(row.capability)
for malformed in ((), (self.cp.carFingerprint,), (self.cp.carFingerprint, "invalid")):
self.assertFalse(self.owner.apply(replace(required_change(row), value="Experimental", capability=malformed)))
self.assertTrue(self.owner.apply(replace(required_change(row), value="Experimental")))
self.assertEqual(self.row("conditional:mode").value, "Experimental")
self.assertFalse(self.owner.apply(replace(required_change(row), value="End to End", capability=malformed)))
self.assertTrue(self.owner.apply(replace(required_change(row), value="End to End")))
self.assertEqual(self.row("conditional:mode").value, "End to End")
self.assertTrue(self.owner.apply(replace(required_change(self.row("conditional:mode")), value="Chill")))
request = replace(required_change(self.row("conditional:mode")), value="Experimental")
request = replace(required_change(self.row("conditional:mode")), value="End to End")
firmware.fwVersion = versions[0] + b"changed"
self.assertFalse(self.owner.apply(request))
self.assertFalse(self.params.get_bool("ExperimentalMode"))
@@ -116,7 +116,7 @@ class ConditionalFeatureTests(unittest.TestCase):
self.params.put_bool("ExperimentalMode", False, block=True)
self.params.put_bool("SafeMode", False, block=True)
cp.carVin = "VIN1"
request = replace(required_change(self.row("conditional:mode")), value="Experimental")
request = replace(required_change(self.row("conditional:mode")), value="End to End")
if change == "baseline":
self.params.put_bool("ExperimentalMode", True, block=True)
elif change == "safe":
@@ -129,8 +129,8 @@ class ConditionalFeatureTests(unittest.TestCase):
self.params.put_bool("SafeMode", False, block=True)
cp.openpilotLongitudinalControl = False
row = self.row("conditional:mode")
self.assertNotIn("Experimental", row.choices)
self.assertFalse(self.owner.apply(replace(required_change(row), value="Experimental")))
self.assertNotIn("End to End", row.choices)
self.assertFalse(self.owner.apply(replace(required_change(row), value="End to End")))
Path(self.params.get_param_path("ExperimentalMode")).write_bytes(b"01")
self.assertFalse(self.row("conditional:mode").available)
self.assertEqual(Path(self.params.get_param_path("ExperimentalMode")).read_bytes(), b"01")
@@ -61,7 +61,7 @@ class TestExperimentalPersistence(unittest.TestCase):
drive = self.drive()
self.assertFalse(self.runtime_mode(drive))
self.assertEqual(self.saved_raw(), b"1")
self.assertEqual(self.saved_mode(), "Experimental")
self.assertEqual(self.saved_mode(), "End to End")
self.assertTrue(self.params.get_bool("AlphaLongitudinalEnabled"))
self.assertEqual(self.cp.to_dict(), before)
self.cp.openpilotLongitudinalControl = True
@@ -113,7 +113,7 @@ class TestExperimentalPersistence(unittest.TestCase):
self.assertFalse(large_panel.request_toggle("ExperimentalMode", False))
self.assertFalse(compact_panel.request_experimental())
self.assertEqual(self.saved_raw(), b"1")
self.assertEqual(self.saved_mode(), "Experimental")
self.assertEqual(self.saved_mode(), "End to End")
self.assertFalse(large_panel._toggles["ExperimentalMode"].action_item.enabled)
self.cp.openpilotLongitudinalControl = ui.has_longitudinal_control = True
self.cp.pcmCruise = False
@@ -526,7 +526,7 @@ class NativeSettingsPageTests(unittest.TestCase):
owner._params = saved
owner._localization = LocalizationSettingsOwner(saved, lambda: True, lambda: ui.parked)
toggle = item('Lane Departure Warnings', ToggleAction())
experimental = item('Experimental Mode', ToggleAction())
experimental = item('End to End', ToggleAction())
rhd = item('Right Hand Driving', ToggleAction())
experimental.set_description = Mock()
with patch.object(gui_app, 'font', return_value=rl.Font()):
@@ -420,7 +420,7 @@ class TestOnroadAxes(unittest.TestCase):
base = self.state(True, True)
for changes, expected in [
({}, 'ACC - Chill'),
({'experimental_enabled': True}, 'ACC - Experimental'),
({'experimental_enabled': True}, 'ACC - End to End'),
({'longitudinal_active': False}, 'Always On Lateral'),
({'lateral_active': False}, 'ACC - Chill'),
({'switchback_mode': True, 'traffic_mode': True}, 'Switchback Mode'),
@@ -435,7 +435,7 @@ class TestOnroadAxes(unittest.TestCase):
self.assertEqual(driving_mode_description(replace(base, **changes)), expected)
stop = ConditionalDisplay(ModeChoice.CEM, True, 'cem_stop', 8, 'test', 1)
chill = replace(stop, effective_experimental=False, reason='manual_chill')
self.assertEqual(driving_mode_description(replace(base, conditional_effective=stop)), 'ACC - Experimental')
self.assertEqual(driving_mode_description(replace(base, conditional_effective=stop)), 'ACC - End to End')
self.assertEqual(driving_mode_description(replace(base, experimental_enabled=True, conditional_effective=chill)), 'ACC - Chill')
self.assertEqual(driving_mode_description(replace(base, traffic_mode=True, conditional_effective=stop)), 'Traffic Mode')
@@ -535,7 +535,7 @@ class TestOnroadFavorites(unittest.TestCase):
snapshot = ShellSnapshot(ShellMode.ONROAD, Mock(), Mock(), state)
session.snapshot = Mock(return_value=snapshot)
invoke = Mock(return_value=True)
action = FavoriteAction(EXPERIMENTAL, 'Experimental Mode', available=True, token='current', invoke=invoke)
action = FavoriteAction(EXPERIMENTAL, 'End to End', available=True, token='current', invoke=invoke)
session._native_favorite_actions = Mock(return_value={EXPERIMENTAL: action})
session._unavailable = Mock()
projected = session._input_snapshot(ShellMode.ONROAD)
+1 -1
View File
@@ -13,7 +13,7 @@ from openpilot.starpilot.ui.toggles_state import Personality, ToggleKey, Toggles
ROWS = (("Enable openpilot", "chffr_wheel.png", "enabled"),
("Experimental Mode", "experimental_white.png", "experimental"),
("End to End", "experimental_white.png", "experimental"),
("Safe Mode", "warning.png", "safe_mode"),
("Disengage on Accelerator Pedal", "disengage_on_accelerator.png", "disengage_accelerator"),
("Driving Personality", "speed_limit.png", "personality"),
@@ -134,7 +134,7 @@ MESSAGES = (
tr_noop("Aggressive"),
tr_noop("Relaxed"),
tr_noop("Chill"),
tr_noop("Experimental"),
tr_noop("End to End"),
tr_noop("Personality"),
tr_noop("Personalities"),
tr_noop("Saved settings"),