From ad06ffb4ce61ca8f164db67ca25f866b6448f53e Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:20:37 -0500 Subject: [PATCH] goat --- common/params_keys.h | 1 + selfdrive/ui/layouts/settings/starpilot/sounds.py | 2 ++ selfdrive/ui/soundd.py | 7 ++++++- starpilot/common/starpilot_variables.py | 1 + .../assets/components/tools/device_settings_layout.json | 8 ++++++++ starpilot/ui/qt/offroad/sounds_settings.cc | 1 + starpilot/ui/qt/offroad/sounds_settings.h | 2 +- 7 files changed, 20 insertions(+), 2 deletions(-) diff --git a/common/params_keys.h b/common/params_keys.h index 6e6f1920..3df0fc78 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -271,6 +271,7 @@ inline static std::unordered_map keys = { {"StarPilotTogglesUpdated", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}}, {"FrogsGoMoosTweak", {PERSISTENT, BOOL, "1", "0", 2}}, {"GoatScream", {PERSISTENT, BOOL, "0", "0", 1}}, + {"GoatScreamCriticalAlerts", {PERSISTENT, BOOL, "0", "0", 1}}, {"GreenLightAlert", {PERSISTENT, BOOL, "0", "0", 0}}, {"HideAlerts", {PERSISTENT, BOOL, "0", "0", 2}}, {"HideLeadMarker", {PERSISTENT, BOOL, "0", "0", 2}}, diff --git a/selfdrive/ui/layouts/settings/starpilot/sounds.py b/selfdrive/ui/layouts/settings/starpilot/sounds.py index e6dc2f66..9bb0af07 100644 --- a/selfdrive/ui/layouts/settings/starpilot/sounds.py +++ b/selfdrive/ui/layouts/settings/starpilot/sounds.py @@ -27,6 +27,7 @@ class StarPilotSoundsLayout(StarPilotPanel): ] CUSTOM_ALERTS_KEYS = [ "GoatScream", + "GoatScreamCriticalAlerts", "GreenLightAlert", "LeadDepartingAlert", "LoudBlindspotAlert", @@ -207,6 +208,7 @@ while True: class StarPilotCustomAlertsLayout(StarPilotPanel): ALERT_INFO = { "GoatScream": {"title": tr_noop("Goat Scream"), "icon": "toggle_icons/icon_sound.png"}, + "GoatScreamCriticalAlerts": {"title": tr_noop("Goat Critical"), "icon": "toggle_icons/icon_sound.png"}, "GreenLightAlert": {"title": tr_noop("Green Light"), "icon": "toggle_icons/icon_green_light.png"}, "LeadDepartingAlert": {"title": tr_noop("Lead Departure"), "icon": "toggle_icons/icon_steering.png"}, "LoudBlindspotAlert": {"title": tr_noop("Loud Blindspot"), "icon": "toggle_icons/icon_display.png"}, diff --git a/selfdrive/ui/soundd.py b/selfdrive/ui/soundd.py index 79823712..151a69fb 100644 --- a/selfdrive/ui/soundd.py +++ b/selfdrive/ui/soundd.py @@ -5,7 +5,7 @@ import wave from pathlib import Path -from cereal import car, custom, messaging +from cereal import car, custom, log, messaging from openpilot.common.basedir import BASEDIR from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.params import Params @@ -191,6 +191,11 @@ class Soundd: new_alert = sm['selfdriveState'].alertSound.raw new_alert_type = sm['selfdriveState'].alertType + critical_full_alert = sm['selfdriveState'].alertStatus == log.SelfdriveState.AlertStatus.critical + critical_full_alert &= sm['selfdriveState'].alertSize == log.SelfdriveState.AlertSize.full + if self.starpilot_toggles.goat_scream_critical_alerts and critical_full_alert: + new_alert = StarPilotAudibleAlert.goat + new_starpilot_alert = sm['starpilotSelfdriveState'].alertSound.raw if new_alert == AudibleAlert.none and new_starpilot_alert != StarPilotAudibleAlert.none: new_alert = new_starpilot_alert diff --git a/starpilot/common/starpilot_variables.py b/starpilot/common/starpilot_variables.py index f95e382a..f94c0ddf 100644 --- a/starpilot/common/starpilot_variables.py +++ b/starpilot/common/starpilot_variables.py @@ -603,6 +603,7 @@ class StarPilotVariables: custom_alerts = self.get_value("CustomAlerts") toggle.goat_scream_alert = self.get_value("GoatScream", condition=custom_alerts) + toggle.goat_scream_critical_alerts = self.get_value("GoatScreamCriticalAlerts", condition=custom_alerts) toggle.green_light_alert = self.get_value("GreenLightAlert", condition=custom_alerts) toggle.lead_departing_alert = self.get_value("LeadDepartingAlert", condition=custom_alerts) toggle.loud_blindspot_alert = self.get_value("LoudBlindspotAlert", condition=custom_alerts and has_bsm) diff --git a/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json b/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json index c9e1a155..ffad8e12 100644 --- a/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json +++ b/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json @@ -1728,6 +1728,14 @@ "ui_type": "toggle", "parent_key": "CustomAlerts" }, + { + "key": "GoatScreamCriticalAlerts", + "label": "Goat Scream Critical Alerts", + "description": "Play the infamous \"Goat Scream\" for full-screen critical alerts that require immediate takeover.\n\nExamples include: \"TAKE CONTROL IMMEDIATELY\" and \"Stock AEB: Risk of Collision\".", + "data_type": "bool", + "ui_type": "toggle", + "parent_key": "CustomAlerts" + }, { "key": "GreenLightAlert", "label": "Green Light Alert", diff --git a/starpilot/ui/qt/offroad/sounds_settings.cc b/starpilot/ui/qt/offroad/sounds_settings.cc index 959354a6..f204c534 100644 --- a/starpilot/ui/qt/offroad/sounds_settings.cc +++ b/starpilot/ui/qt/offroad/sounds_settings.cc @@ -35,6 +35,7 @@ StarPilotSoundsPanel::StarPilotSoundsPanel(StarPilotSettingsWindow *parent, bool {"CustomAlerts", tr("StarPilot Alerts"), tr("Optional StarPilot alerts that highlight driving events in a more noticeable way."), "../../starpilot/assets/toggle_icons/icon_green_light.png"}, {"GoatScream", tr("Goat Scream"), tr("Play the infamous \"Goat Scream\" when the steering controller reaches its limit. Based on the \"Turn Exceeds Steering Limit\" event."), ""}, + {"GoatScreamCriticalAlerts", tr("Goat Scream Critical Alerts"), tr("Play the infamous \"Goat Scream\" for full-screen critical alerts that require immediate takeover.

Examples include: \"TAKE CONTROL IMMEDIATELY\" and \"Stock AEB: Risk of Collision\"."), ""}, {"GreenLightAlert", tr("Green Light Alert"), tr("Play an alert when the model predicts a red light has turned green.

Disclaimer: openpilot does not explicitly detect traffic lights. This alert is based on end-to-end model predictions from camera input and may trigger even when the light has not changed."), ""}, {"LeadDepartingAlert", tr("Lead Departing Alert"), tr("Play an alert when the lead vehicle departs from a stop."), ""}, {"LoudBlindspotAlert", tr("Loud \"Car Detected in Blindspot\" Alert"), tr("Play a louder alert if a vehicle is in the blind spot when attempting to change lanes. Based on the \"Car Detected in Blindspot\" event."), ""}, diff --git a/starpilot/ui/qt/offroad/sounds_settings.h b/starpilot/ui/qt/offroad/sounds_settings.h index 7329263c..a6b63db9 100644 --- a/starpilot/ui/qt/offroad/sounds_settings.h +++ b/starpilot/ui/qt/offroad/sounds_settings.h @@ -27,7 +27,7 @@ private: QSet alertCooldownKeys {"SwitchbackModeCooldown"}; QSet alertVolumeControlKeys {"BelowSteerSpeedVolume", "DisengageVolume", "EngageVolume", "PromptDistractedVolume", "PromptVolume", "RefuseVolume", "WarningImmediateVolume", "WarningSoftVolume"}; - QSet customAlertsKeys {"GoatScream", "GreenLightAlert", "LeadDepartingAlert", "LoudBlindspotAlert", "SpeedLimitChangedAlert"}; + QSet customAlertsKeys {"GoatScream", "GoatScreamCriticalAlerts", "GreenLightAlert", "LeadDepartingAlert", "LoudBlindspotAlert", "SpeedLimitChangedAlert"}; QSet parentKeys;