Visuals - Custom Alerts - Loud Blindspot Alert

Enable a louder alert for when a vehicle is detected in the blindspot when attempting to change lanes.
This commit is contained in:
FrogAi
2024-05-11 12:41:27 -07:00
parent 0b08728013
commit a18dec0260
2 changed files with 12 additions and 1 deletions
+4 -1
View File
@@ -297,7 +297,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:
+8
View File
@@ -1002,6 +1002,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",