goat
This commit is contained in:
@@ -271,6 +271,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> 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}},
|
||||
|
||||
@@ -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"},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -35,6 +35,7 @@ StarPilotSoundsPanel::StarPilotSoundsPanel(StarPilotSettingsWindow *parent, bool
|
||||
|
||||
{"CustomAlerts", tr("StarPilot Alerts"), tr("<b>Optional StarPilot alerts</b> that highlight driving events in a more noticeable way."), "../../starpilot/assets/toggle_icons/icon_green_light.png"},
|
||||
{"GoatScream", tr("Goat Scream"), tr("<b>Play the infamous \"Goat Scream\" when the steering controller reaches its limit.</b> Based on the \"Turn Exceeds Steering Limit\" event."), ""},
|
||||
{"GoatScreamCriticalAlerts", tr("Goat Scream Critical Alerts"), tr("<b>Play the infamous \"Goat Scream\" for full-screen critical alerts that require immediate takeover.</b><br><br>Examples include: \"TAKE CONTROL IMMEDIATELY\" and \"Stock AEB: Risk of Collision\"."), ""},
|
||||
{"GreenLightAlert", tr("Green Light Alert"), tr("<b>Play an alert when the model predicts a red light has turned green.</b><br><br><i><b>Disclaimer</b>: 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.</i>"), ""},
|
||||
{"LeadDepartingAlert", tr("Lead Departing Alert"), tr("<b>Play an alert when the lead vehicle departs from a stop.</b>"), ""},
|
||||
{"LoudBlindspotAlert", tr("Loud \"Car Detected in Blindspot\" Alert"), tr("<b>Play a louder alert if a vehicle is in the blind spot when attempting to change lanes.</b> Based on the \"Car Detected in Blindspot\" event."), ""},
|
||||
|
||||
@@ -27,7 +27,7 @@ private:
|
||||
|
||||
QSet<QString> alertCooldownKeys {"SwitchbackModeCooldown"};
|
||||
QSet<QString> alertVolumeControlKeys {"BelowSteerSpeedVolume", "DisengageVolume", "EngageVolume", "PromptDistractedVolume", "PromptVolume", "RefuseVolume", "WarningImmediateVolume", "WarningSoftVolume"};
|
||||
QSet<QString> customAlertsKeys {"GoatScream", "GreenLightAlert", "LeadDepartingAlert", "LoudBlindspotAlert", "SpeedLimitChangedAlert"};
|
||||
QSet<QString> customAlertsKeys {"GoatScream", "GoatScreamCriticalAlerts", "GreenLightAlert", "LeadDepartingAlert", "LoudBlindspotAlert", "SpeedLimitChangedAlert"};
|
||||
|
||||
QSet<QString> parentKeys;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user