diff --git a/opendbc_repo/opendbc/car/car.capnp b/opendbc_repo/opendbc/car/car.capnp index 9ab37fe..211a0a6 100644 --- a/opendbc_repo/opendbc/car/car.capnp +++ b/opendbc_repo/opendbc/car/car.capnp @@ -477,6 +477,8 @@ struct CarControl { audio8 @31; audio9 @32; audio10 @33; + + nnff @34; } } diff --git a/scripts/add/events_ko.py b/scripts/add/events_ko.py index be8bdfc..fc7e72d 100644 --- a/scripts/add/events_ko.py +++ b/scripts/add/events_ko.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 import bisect import math import os @@ -8,6 +8,7 @@ from collections.abc import Callable from cereal import log, car import cereal.messaging as messaging from openpilot.common.conversions import Conversions as CV +from openpilot.common.params import Params from openpilot.common.git import get_short_branch from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.locationd.calibrationd import MIN_SPEED_FILTER @@ -251,6 +252,20 @@ def calibration_incomplete_alert(CP: car.CarParams, CS: car.CarState, sm: messag AlertStatus.normal, AlertSize.mid, Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2) +def torque_nn_load_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, personality) -> Alert: + model_name = Params().get("NNFFModelName", encoding='utf-8') + if model_name == "": + return Alert( + "NNFF Torque Controller not available", + "Donate logs to Twilsonco to get it added!", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, VisualAlert.none, AudibleAlert.prompt, 6.0) + else: + return Alert( + "NNFF Torque Controller loaded", + model_name, + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, VisualAlert.none, AudibleAlert.nnff, 5.0) # *** debug alerts *** diff --git a/selfdrive/ui/soundd.py b/selfdrive/ui/soundd.py index 693bb3c..29b6676 100644 --- a/selfdrive/ui/soundd.py +++ b/selfdrive/ui/soundd.py @@ -65,6 +65,7 @@ sound_list: dict[int, tuple[str, int | None, float]] = { AudibleAlert.audio8: ("audio_8.wav", None, MAX_VOLUME), AudibleAlert.audio9: ("audio_9.wav", None, MAX_VOLUME), AudibleAlert.audio10: ("audio_10.wav", None, MAX_VOLUME), + AudibleAlert.nnff: ("nnff.wav", None, MAX_VOLUME), } def check_selfdrive_timeout_alert(sm):