From fb8540f6c21db1e1576e80b265939d4c3118a558 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sat, 11 May 2024 12:41:27 -0700 Subject: [PATCH] Visuals - Custom Alerts - Loud Blindspot Alert Enable a louder alert for when a vehicle is detected in the blindspot when attempting to change lanes. --- selfdrive/controls/controlsd.py | 5 ++++- selfdrive/controls/lib/events.py | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 561c411..b1049ce 100644 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -300,7 +300,10 @@ class Controls: direction = self.sm['modelV2'].meta.laneChangeDirection if (CS.leftBlindspot and direction == LaneChangeDirection.left) or \ (CS.rightBlindspot and direction == LaneChangeDirection.right): - self.events.add(EventName.laneChangeBlocked) + if self.frogpilot_toggles.loud_blindspot_alert: + self.events.add(EventName.laneChangeBlockedLoud) + else: + self.events.add(EventName.laneChangeBlocked) else: if direction == LaneChangeDirection.left: if self.sm['frogpilotPlan'].laneWidthLeft >= self.frogpilot_toggles.lane_detection_width: diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index bfd0e16..c27f144 100755 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -998,6 +998,14 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { Priority.MID, VisualAlert.none, AudibleAlert.prompt, 3.), }, + EventName.laneChangeBlockedLoud: { + ET.WARNING: Alert( + "Car Detected in Blindspot", + "", + AlertStatus.userPrompt, AlertSize.small, + Priority.LOW, VisualAlert.none, AudibleAlert.warningSoft, .1), + }, + EventName.leadDeparting: { ET.PERMANENT: Alert( "Lead departed",