fix.. nnff

This commit is contained in:
ajouatom 2025-02-12 09:12:43 +09:00
parent ba63eb73df
commit 0c4319cfb3
3 changed files with 19 additions and 1 deletions

View File

@ -477,6 +477,8 @@ struct CarControl {
audio8 @31;
audio9 @32;
audio10 @33;
nnff @34;
}
}

View File

@ -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 ***

View File

@ -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):