Holiday Themes
@@ -120,6 +120,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
# FrogPilot events
|
||||
frogSteerSaturated @122;
|
||||
greenLight @123;
|
||||
holidayActive @124;
|
||||
|
||||
radarCanErrorDEPRECATED @15;
|
||||
communityFeatureDisallowedDEPRECATED @62;
|
||||
|
||||
@@ -239,6 +239,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"CEStopLights", PERSISTENT},
|
||||
{"CEStopLightsLead", PERSISTENT},
|
||||
{"ConditionalExperimental", PERSISTENT},
|
||||
{"CurrentHolidayTheme", PERSISTENT},
|
||||
{"CustomAlerts", PERSISTENT},
|
||||
{"CustomColors", PERSISTENT},
|
||||
{"CustomIcons", PERSISTENT},
|
||||
@@ -276,6 +277,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"HideSpeed", PERSISTENT},
|
||||
{"HideSpeedUI", PERSISTENT},
|
||||
{"HigherBitrate", PERSISTENT},
|
||||
{"HolidayThemes", PERSISTENT},
|
||||
{"LaneLinesWidth", PERSISTENT},
|
||||
{"LateralTune", PERSISTENT},
|
||||
{"LeadInfo", PERSISTENT},
|
||||
|
||||
7
selfdrive/controls/controlsd.py
Executable file → Normal file
@@ -178,6 +178,7 @@ class Controls:
|
||||
self.frogpilot_variables = SimpleNamespace()
|
||||
|
||||
self.driving_gear = False
|
||||
self.holiday_theme_alerted = False
|
||||
self.previously_enabled = False
|
||||
self.stopped_for_light_previously = False
|
||||
|
||||
@@ -320,6 +321,11 @@ class Controls:
|
||||
|
||||
frogpilot_plan = self.sm['frogpilotPlan']
|
||||
|
||||
# Show holiday related event to indicate which holiday is active
|
||||
if self.sm.frame >= 1000 and self.holiday_themes and self.params_memory.get_int("CurrentHolidayTheme") != 0 and not self.holiday_theme_alerted:
|
||||
self.events.add(EventName.holidayActive)
|
||||
self.holiday_theme_alerted = True
|
||||
|
||||
# Add joystick event, static on cars, dynamic on nonCars
|
||||
if self.joystick_mode:
|
||||
self.events.add(EventName.joystickDebug)
|
||||
@@ -1041,6 +1047,7 @@ class Controls:
|
||||
custom_sounds = self.params.get_int("CustomSounds") if custom_theme else 0
|
||||
frog_sounds = custom_sounds == 1
|
||||
self.goat_scream = frog_sounds and self.params.get_bool("GoatScream")
|
||||
self.holiday_themes = custom_theme and self.params.get_bool("HolidayThemes")
|
||||
|
||||
experimental_mode_activation = self.params.get_bool("ExperimentalModeActivation")
|
||||
self.frogpilot_variables.experimental_mode_via_distance = experimental_mode_activation and self.params.get_bool("ExperimentalModeViaDistance")
|
||||
|
||||
@@ -11,6 +11,8 @@ from openpilot.common.realtime import DT_CTRL
|
||||
from openpilot.selfdrive.locationd.calibrationd import MIN_SPEED_FILTER
|
||||
from openpilot.system.version import get_short_branch
|
||||
|
||||
params_memory = Params("/dev/shm/params")
|
||||
|
||||
AlertSize = log.ControlsState.AlertSize
|
||||
AlertStatus = log.ControlsState.AlertStatus
|
||||
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
||||
@@ -333,6 +335,29 @@ def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster,
|
||||
|
||||
|
||||
# FrogPilot alerts
|
||||
def holiday_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert:
|
||||
holiday_messages = {
|
||||
1: ("Happy April Fool's Day! 🤡", "aprilFoolsAlert"),
|
||||
2: ("Merry Christmas! 🎄", "christmasAlert"),
|
||||
3: ("¡Feliz Cinco de Mayo! 🌮", "cincoDeMayoAlert"),
|
||||
4: ("Happy Easter! 🐰", "easterAlert"),
|
||||
5: ("Happy Fourth of July! 🎆", "fourthOfJulyAlert"),
|
||||
6: ("Happy Halloween! 🎃", "halloweenAlert"),
|
||||
7: ("Happy New Year! 🎉", "newYearsDayAlert"),
|
||||
8: ("Happy St. Patrick's Day! 🍀", "stPatricksDayAlert"),
|
||||
9: ("Happy Thanksgiving! 🦃", "thanksgivingAlert"),
|
||||
10: ("Happy Valentine's Day! ❤️", "valentinesDayAlert"),
|
||||
11: ("Happy World Frog Day! 🐸", "worldFrogDayAlert"),
|
||||
}
|
||||
|
||||
theme_id = params_memory.get_int("CurrentHolidayTheme")
|
||||
message, alert_type = holiday_messages.get(theme_id, ("", ""))
|
||||
|
||||
return Alert(
|
||||
message,
|
||||
"",
|
||||
AlertStatus.normal, AlertSize.small,
|
||||
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, 5.)
|
||||
|
||||
EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
|
||||
# ********** events with no alerts **********
|
||||
@@ -974,6 +999,9 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
|
||||
Priority.MID, VisualAlert.none, AudibleAlert.prompt, 3.),
|
||||
},
|
||||
|
||||
EventName.holidayActive: {
|
||||
ET.PERMANENT: holiday_alert,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 150 KiB |
|
After Width: | Height: | Size: 254 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 140 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 86 KiB |