diff --git a/frogpilot/assets/nnff_models/TOYOTA_WILDLANDER_PHEV.json b/frogpilot/assets/nnff_models/TOYOTA_WILDLANDER_PHEV.json new file mode 100644 index 0000000..c219d98 --- /dev/null +++ b/frogpilot/assets/nnff_models/TOYOTA_WILDLANDER_PHEV.json @@ -0,0 +1 @@ +{"input_std":[[9.668097],[1.5244726],[1.2700657],[0.03216253],[1.6078212],[1.5848233],[1.5577372],[1.3927742],[1.2935301],[1.1931615],[1.1020583],[0.032136116],[0.03217024],[0.032196537],[0.03225218],[0.032214258],[0.032031752],[0.03179372]],"model_test_loss":0.018995385617017746,"input_size":18,"current_date_and_time":"2025-05-15_14-47-45","input_mean":[[18.09652],[-0.017798662],[0.027145168],[-0.0054331655],[-0.025215305],[-0.022640774],[-0.019500963],[-0.010056124],[-0.0057649272],[0.001960505],[0.0020118994],[-0.005499858],[-0.005477372],[-0.005444631],[-0.0053683305],[-0.005257134],[-0.005035867],[-0.0050971555]],"input_vars":["v_ego","lateral_accel","lateral_jerk","roll","lateral_accel_m03","lateral_accel_m02","lateral_accel_m01","lateral_accel_p03","lateral_accel_p06","lateral_accel_p10","lateral_accel_p15","roll_m03","roll_m02","roll_m01","roll_p03","roll_p06","roll_p10","roll_p15"],"output_size":1,"layers":[{"dense_1_b":[[-0.016405884],[1.4187009],[-0.30671495],[-1.4047697],[-0.20383339],[-0.3632745],[-0.028944347]],"dense_1_W":[[0.13070685,-0.6662394,-1.0739188,-0.41523784,0.019285621,-0.5666617,0.02941118,0.2413377,0.11430891,-0.15557496,-0.36541316,0.44118378,0.038414165,0.117383294,-0.026998837,-0.3802126,-0.23443018,0.43427357],[0.5493235,0.7341044,0.30259728,-0.09170222,-0.066015296,0.41798133,-0.062179696,-0.1925674,-0.15322368,0.017662844,0.21162434,-0.12112619,-0.027021965,0.05653779,0.14749303,0.28017008,-0.15880422,-0.07834965],[1.3052936,-0.038109165,1.2192534,-0.18676366,0.21888737,0.45998427,0.94506985,-0.87686205,0.044812016,-0.07512292,0.69492793,-0.59623814,0.3278255,0.39913544,0.15354112,0.04995451,-0.031020898,-0.10582342],[-0.4683151,1.0002598,0.29120648,-0.05860625,0.010191997,0.17896307,-0.3321235,0.19332078,-0.44497126,0.09236495,0.17685813,0.022076255,-0.23972619,0.11622197,0.11574386,0.1640551,0.028836682,-0.14775941],[1.2240227,0.5504716,-1.161672,0.10151114,-0.6311718,-0.4365897,-0.63896364,0.4033335,0.012773022,0.025944846,-0.62420815,0.05751297,0.043608528,-0.13193272,-0.33345297,0.18925929,0.0925279,-0.03600548],[-0.0033800902,-0.41361037,-8.50345,0.27523437,2.0881453,2.3587928,2.1091182,-2.467406,-1.9167688,-0.8961217,-0.22510983,0.037862107,-0.23643681,0.03247474,0.067485854,0.04660773,-0.2583531,0.077512406],[0.0035197088,-0.43985325,0.07051937,0.38219255,-0.67769414,-0.29911998,1.0818627,-0.6217103,-0.5443828,0.22882973,0.013560748,-0.29820752,0.11540977,-0.40309906,-0.00034299958,0.69976795,0.13301164,-0.32934943]],"activation":"σ"},{"dense_2_W":[[-0.014842439,-0.3306524,0.254514,-0.6639507,-0.534733,0.07840164,0.2324318],[-0.15334646,-0.290343,-1.047474,0.41780674,0.04612693,-0.73001504,-0.3465528],[-0.6260714,-0.5115335,-0.71161246,0.4046027,-1.2324069,-1.2851475,-0.16620061],[-0.05566019,0.48536706,-0.42460826,0.83332616,0.47045597,-0.061004266,-1.1440438],[0.42156544,-0.6722497,-0.10824958,-0.32994938,0.31952205,-0.46266714,-0.07230821],[-0.38416666,-0.7271572,-0.39645803,-0.4259647,-0.24740903,-0.17667961,-0.10970643],[0.19652602,0.026280575,-0.1651507,-0.38475782,-0.5457258,-0.1882665,0.82107437],[-0.08976335,0.35238677,0.25231764,0.004611504,-0.5936927,-0.29342756,-0.22477138],[0.25490662,-0.4851788,-0.07538396,-0.36808714,-0.05157315,-0.2439695,0.9720866],[0.48479185,-0.68759876,0.42557424,-0.56957704,-0.32759178,-0.3047872,0.7597776],[0.4211342,-1.4932247,-0.66635305,-0.10591562,-0.9298172,1.04872,0.32208702],[-0.2918295,0.63893354,0.044817235,0.87641054,0.38387123,-0.48429132,-0.8803729],[-0.60936576,-0.29061803,-0.94329685,0.6586833,0.15280105,-0.8124564,-0.538523]],"activation":"σ","dense_2_b":[[-0.009386154],[-0.25074136],[0.02986496],[-0.028872054],[-0.06481484],[-0.2976481],[-0.072934344],[-0.117011935],[0.028236326],[-0.009000545],[-0.42297846],[0.030614687],[-0.105583444]]},{"dense_3_W":[[-0.035136532,-0.27008098,-0.5048698,-0.5295355,0.29823285,0.5058221,-0.09186966,0.26433602,0.50751793,0.49806535,0.8154631,-0.5854975,-0.525581],[0.08374179,0.16962804,0.2263017,0.5973136,0.2815238,-0.0505521,0.26001385,0.36577544,-0.68805265,-0.8057493,-0.42594707,0.633128,0.08724391],[0.5107981,0.064214274,-0.061156582,-0.33331737,0.07700428,-0.40398338,0.3673148,-0.42669702,0.38095382,0.33056983,-0.3025643,-0.58125204,-0.3484819]],"activation":"identity","dense_3_b":[[0.01880667],[-0.04986152],[0.030190725]]},{"dense_4_W":[[-1.0120764,0.477425,-1.0690569]],"dense_4_b":[[-0.027314244]],"activation":"identity"}]} \ No newline at end of file diff --git a/selfdrive/car/torque_data/substitute.toml b/selfdrive/car/torque_data/substitute.toml index 1525bf1..b5e760f 100644 --- a/selfdrive/car/torque_data/substitute.toml +++ b/selfdrive/car/torque_data/substitute.toml @@ -10,6 +10,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "TOYOTA_ALPHARD_TSS2" = "TOYOTA_SIENNA" "TOYOTA_PRIUS_V" = "TOYOTA_PRIUS" "TOYOTA_RAV4_PRIME" = "TOYOTA_RAV4_TSS2" +"TOYOTA_WILDLANDER_PHEV" = "TOYOTA_RAV4_TSS2" "TOYOTA_SIENNA_4TH_GEN" = "TOYOTA_RAV4_TSS2" "LEXUS_IS" = "LEXUS_NX" "LEXUS_CTH" = "LEXUS_NX" diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 295188c..322ab97 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -207,7 +207,7 @@ class CarState(CarStateBase): if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) or (self.CP.flags & ToyotaFlags.SMART_DSU and not self.CP.flags & ToyotaFlags.RADAR_CAN_FILTER): # distance button is wired to the ACC module (camera or radar) self.prev_distance_button = self.distance_button - if self.CP.carFingerprint in (SECOC_CAR - RADAR_ACC_CAR): + if self.CP.carFingerprint in (SECOC_CAR - RADAR_ACC_CAR) and self.CP.carFingerprint not in [CAR.TOYOTA_WILDLANDER_PHEV]: self.distance_button = cp.vl["PCM_CRUISE_4"]["DISTANCE"] elif self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR): self.distance_button = cp_acc.vl["ACC_CONTROL"]["DISTANCE"] @@ -277,7 +277,7 @@ class CarState(CarStateBase): ("SECOC_SYNCHRONIZATION", 10), ("GAS_PEDAL", 42), ] - if CP.carFingerprint not in RADAR_ACC_CAR: + if CP.carFingerprint not in RADAR_ACC_CAR and CP.carFingerprint not in [CAR.TOYOTA_WILDLANDER_PHEV]: messages.append(("PCM_CRUISE_4", 1)) else: messages.append(("VSC1S07", 20)) diff --git a/selfdrive/car/toyota/fingerprints.py b/selfdrive/car/toyota/fingerprints.py index 025f775..ee9cbb8 100644 --- a/selfdrive/car/toyota/fingerprints.py +++ b/selfdrive/car/toyota/fingerprints.py @@ -1047,6 +1047,29 @@ FW_VERSIONS = { b'\x028646F4210100\x00\x00\x00\x008646G3305000\x00\x00\x00\x00', ], }, + CAR.TOYOTA_WILDLANDER_PHEV: { + (Ecu.engine, 0x700, None): [ + b'\x01896630R57001\x00\x00\x00\x00', + ], + (Ecu.abs, 0x7b0, None): [ + b'\x01F152642C4000\x00\x00\x00\x00', + ], + (Ecu.eps, 0x7a1, None): [ + b'\x018965B4221000\x00\x00\x00\x00', + ], + (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F0R01000\x00\x00\x00\x008646G4202000\x00\x00\x00\x00', + ], + (Ecu.fwdRadar, 0x750, 0xf): [ + b'\x018821F3301400\x00\x00\x00\x00', + ], + (Ecu.srs, 0x780, None): [ + b'\x018917F0R18000\x00\x00\x00\x00' + ], + (Ecu.hybrid, 0x7d2, None): [ + b'\x02899830R24000\x00\x00\x00\x00899850R05000\x00\x00\x00\x00' + ], + }, CAR.TOYOTA_RAV4_TSS2: { (Ecu.engine, 0x700, None): [ b'\x01896630R58000\x00\x00\x00\x00', diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 7cc9300..49a74cf 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -73,7 +73,7 @@ class CarInterface(CarInterfaceBase): elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RX_TSS2): ret.wheelSpeedFactor = 1.035 - elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_4TH_GEN): + elif candidate in (CAR.TOYOTA_RAV4_TSS2, CAR.TOYOTA_RAV4_TSS2_2022, CAR.TOYOTA_RAV4_TSS2_2023, CAR.TOYOTA_RAV4_PRIME, CAR.TOYOTA_SIENNA_4TH_GEN, CAR.TOYOTA_WILDLANDER_PHEV): ret.lateralTuning.init('pid') ret.lateralTuning.pid.kiBP = [0.0] ret.lateralTuning.pid.kpBP = [0.0] diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index bd87e33..91bc587 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -271,6 +271,10 @@ class CAR(Platforms): [ToyotaCarDocs("Toyota RAV4 Prime 2021-23", min_enable_speed=MIN_ACC_SPEED)], CarSpecs(mass=4372. * CV.LB_TO_KG, wheelbase=2.68, steerRatio=16.88, tireStiffnessFactor=0.5533), ) + TOYOTA_WILDLANDER_PHEV = ToyotaSecOCPlatformConfig( + [ToyotaCarDocs("Toyota Wildlander PHEV 2021-23", min_enable_speed=MIN_ACC_SPEED)], + CarSpecs(mass=4155. * CV.LB_TO_KG, wheelbase=2.69, steerRatio=16.88, tireStiffnessFactor=0.5533), + ) TOYOTA_YARIS = ToyotaSecOCPlatformConfig( [ToyotaCarDocs("Toyota Yaris (Non-US only) 2020, 2023", min_enable_speed=MIN_ACC_SPEED)], CarSpecs(mass=1170, wheelbase=2.55, steerRatio=14.80, tireStiffnessFactor=0.5533), diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 67d3489..c545eb9 100644 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -435,7 +435,8 @@ class Controls: if not SIMULATION or REPLAY: # Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1500): - self.events.add(EventName.noGps) + # self.events.add(EventName.noGps) + pass if self.sm['liveLocationKalman'].gpsOK: self.distance_traveled = 0 self.distance_traveled += CS.vEgo * DT_CTRL diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 8499ee8..a517adb 100755 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -155,7 +155,7 @@ class Alert: class NoEntryAlert(Alert): def __init__(self, alert_text_2: str, - alert_text_1: str = "openpilot Unavailable", + alert_text_1: str = "openpilot 不可用", visual_alert: car.CarControl.HUDControl.VisualAlert=VisualAlert.none): super().__init__(alert_text_1, alert_text_2, AlertStatus.normal, AlertSize.mid, Priority.LOW, visual_alert, @@ -164,7 +164,7 @@ class NoEntryAlert(Alert): class SoftDisableAlert(Alert): def __init__(self, alert_text_2: str): - super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2, + super().__init__("立即接管控制", alert_text_2, AlertStatus.userPrompt, AlertSize.full, Priority.MID, VisualAlert.steerRequired, AudibleAlert.warningSoft, 2.), @@ -174,12 +174,12 @@ class SoftDisableAlert(Alert): class UserSoftDisableAlert(SoftDisableAlert): def __init__(self, alert_text_2: str): super().__init__(alert_text_2), - self.alert_text_1 = "openpilot will disengage" + self.alert_text_1 = "openpilot 即将退出" class ImmediateDisableAlert(Alert): def __init__(self, alert_text_2: str): - super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2, + super().__init__("立即接管控制", alert_text_2, AlertStatus.critical, AlertSize.full, Priority.HIGHEST, VisualAlert.steerRequired, AudibleAlert.warningImmediate, 4.), @@ -201,7 +201,7 @@ class NormalPermanentAlert(Alert): class StartupAlert(Alert): - def __init__(self, alert_text_1: str, alert_text_2: str = "Always keep hands on wheel and eyes on road", alert_status=AlertStatus.normal): + def __init__(self, alert_text_1: str, alert_text_2: str = "始终保持双手在方向盘上,眼睛注视道路", alert_status=AlertStatus.normal): super().__init__(alert_text_1, alert_text_2, alert_status, AlertSize.mid, Priority.LOWER, VisualAlert.none, AudibleAlert.none, 5.), @@ -238,25 +238,25 @@ def startup_master_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubM if "REPLAY" in os.environ: branch = "replay" - return StartupAlert("WARNING: This branch is not tested", branch, alert_status=AlertStatus.userPrompt) + return StartupAlert("警告:此分支未经测试", branch, alert_status=AlertStatus.userPrompt) def below_engage_speed_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: - return NoEntryAlert(f"Drive above {get_display_speed(CP.minEnableSpeed, metric)} to engage") + return NoEntryAlert(f"车速超过 {get_display_speed(CP.minEnableSpeed, metric)} 才能启用") def below_steer_speed_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: return Alert( - f"Steer Unavailable Below {get_display_speed(CP.minSteerSpeed, metric)}", + f"车速低于 {get_display_speed(CP.minSteerSpeed, metric)} 时转向不可用", "", AlertStatus.userPrompt, AlertSize.small, Priority.LOW, VisualAlert.steerRequired, AudibleAlert.prompt, 0.4) def calibration_incomplete_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: - first_word = 'Recalibration' if sm['liveCalibration'].calStatus == log.LiveCalibrationData.Status.recalibrating else 'Calibration' + first_word = '重新校准' if sm['liveCalibration'].calStatus == log.LiveCalibrationData.Status.recalibrating else '校准' return Alert( - f"{first_word} in Progress: {sm['liveCalibration'].calPerc:.0f}%", - f"Drive Above {get_display_speed(MIN_SPEED_FILTER, metric)}", + f"{first_word}进行中: {sm['liveCalibration'].calPerc:.0f}%", + f"车速超过 {get_display_speed(MIN_SPEED_FILTER, metric)}", AlertStatus.normal, AlertSize.mid, Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2) @@ -265,77 +265,77 @@ def calibration_incomplete_alert(CP: car.CarParams, CS: car.CarState, sm: messag def out_of_space_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: full_perc = round(100. - sm['deviceState'].freeSpacePercent) - return NormalPermanentAlert("Out of Storage", f"{full_perc}% full") + return NormalPermanentAlert("存储空间不足", f"已使用 {full_perc}%") def posenet_invalid_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: mdl = sm['modelV2'].velocity.x[0] if len(sm['modelV2'].velocity.x) else math.nan err = CS.vEgo - mdl - msg = f"Speed Error: {err:.1f} m/s" - return NoEntryAlert(msg, alert_text_1="Posenet Speed Invalid") + msg = f"速度误差: {err:.1f} m/s" + return NoEntryAlert(msg, alert_text_1="Posenet 速度无效") def process_not_running_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: not_running = [p.name for p in sm['managerState'].processes if not p.running and p.shouldBeRunning] msg = ', '.join(not_running) - return NoEntryAlert(msg, alert_text_1="Process Not Running") + return NoEntryAlert(msg, alert_text_1="进程未运行") def comm_issue_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: bs = [s for s in sm.data.keys() if not sm.all_checks([s, ])] msg = ', '.join(bs[:4]) # can't fit too many on one line - return NoEntryAlert(msg, alert_text_1="Communication Issue Between Processes") + return NoEntryAlert(msg, alert_text_1="进程间通信问题") def camera_malfunction_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: all_cams = ('roadCameraState', 'driverCameraState', 'wideRoadCameraState') bad_cams = [s.replace('State', '') for s in all_cams if s in sm.data.keys() and not sm.all_checks([s, ])] - return NormalPermanentAlert("Camera Malfunction", ', '.join(bad_cams)) + return NormalPermanentAlert("摄像头故障", ', '.join(bad_cams)) def calibration_invalid_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: rpy = sm['liveCalibration'].rpyCalib yaw = math.degrees(rpy[2] if len(rpy) == 3 else math.nan) pitch = math.degrees(rpy[1] if len(rpy) == 3 else math.nan) - angles = f"Remount Device (Pitch: {pitch:.1f}°, Yaw: {yaw:.1f}°)" - return NormalPermanentAlert("Calibration Invalid", angles) + angles = f"重新安装设备 (俯仰角: {pitch:.1f}°, 偏航角: {yaw:.1f}°)" + return NormalPermanentAlert("校准无效", angles) def overheat_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: cpu = max(sm['deviceState'].cpuTempC, default=0.) gpu = max(sm['deviceState'].gpuTempC, default=0.) temp = max((cpu, gpu, sm['deviceState'].memoryTempC)) - return NormalPermanentAlert("System Overheated", f"{temp:.0f} °C") + return NormalPermanentAlert("系统过热", f"{temp:.0f} °C") def low_memory_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: - return NormalPermanentAlert("Low Memory", f"{sm['deviceState'].memoryUsagePercent}% used") + return NormalPermanentAlert("内存不足", f"已使用 {sm['deviceState'].memoryUsagePercent}%") def high_cpu_usage_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: x = max(sm['deviceState'].cpuUsagePercent, default=0.) - return NormalPermanentAlert("High CPU Usage", f"{x}% used") + return NormalPermanentAlert("CPU 使用率过高", f"已使用 {x}%") def modeld_lagging_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: - return NormalPermanentAlert("Driving Model Lagging", f"{sm['modelV2'].frameDropPerc:.1f}% frames dropped") + return NormalPermanentAlert("驾驶模型延迟", f"{sm['modelV2'].frameDropPerc:.1f}% 帧丢失") def wrong_car_mode_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: if frogpilot_toggles.has_cc_long: - text = "Enable Cruise Control to Engage" + text = "启用巡航控制以激活" elif CP.carName == "honda": - text = "Enable Main Switch to Engage" + text = "启用主开关以激活" else: - text = "Enable Adaptive Cruise to Engage" + text = "启用自适应巡航以激活" return NoEntryAlert(text) def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: axes = sm['testJoystick'].axes gb, steer = list(axes)[:2] if len(axes) else (0., 0.) - vals = f"Gas: {round(gb * 100.)}%, Steer: {round(steer * 100.)}%" - return NormalPermanentAlert("Joystick Mode", vals) + vals = f"油门: {round(gb * 100.)}%, 转向: {round(steer * 100.)}%" + return NormalPermanentAlert("操纵杆模式", vals) # FrogPilot alerts @@ -345,30 +345,30 @@ def custom_startup_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubM def forcing_stop_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: model_length = sm["frogpilotPlan"].forcingStopLength - model_length_msg = f"{model_length:.1f} meters" if metric else f"{model_length * CV.METER_TO_FOOT:.1f} feet" + model_length_msg = f"{model_length:.1f} 米" if metric else f"{model_length * CV.METER_TO_FOOT:.1f} 英尺" return Alert( - f"Forcing the car to stop in {model_length_msg}", - "Press the gas pedal or 'Resume' button to override", + f"强制车辆在 {model_length_msg} 后停止", + "踩油门或按'恢复'按钮可覆盖", FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.MID, VisualAlert.none, AudibleAlert.prompt, 1.) def holiday_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: holiday_messages = { - "new_years": "Happy New Year! 🎉", - "valentines": "Happy Valentine's Day! ❤️", - "st_patricks": "Happy St. Patrick's Day! 🍀", - "world_frog_day": "Happy World Frog Day! 🐸", - "april_fools": "Happy April Fool's Day! 🤡", - "easter_week": "Happy Easter! 🐰", - "may_the_fourth": "May the 4th be with you! 🚀", - "cinco_de_mayo": "¡Feliz Cinco de Mayo! 🌮", - "stitch_day": "Happy Stitch Day! 💙", - "fourth_of_july": "Happy Fourth of July! 🎆", - "halloween_week": "Happy Halloween! 🎃", - "thanksgiving_week": "Happy Thanksgiving! 🦃", - "christmas_week": "Merry Christmas! 🎄", + "new_years": "新年快乐!🎉", + "valentines": "情人节快乐!❤️", + "st_patricks": "圣帕特里克节快乐!🍀", + "world_frog_day": "世界青蛙日快乐!🐸", + "april_fools": "愚人节快乐!🤡", + "easter_week": "复活节快乐!🐰", + "may_the_fourth": "愿原力与你同在!🚀", + "cinco_de_mayo": "五月五日节快乐!🌮", + "stitch_day": "史迪奇日快乐!💙", + "fourth_of_july": "独立日快乐!🎆", + "halloween_week": "万圣节快乐!🎃", + "thanksgiving_week": "感恩节快乐!🦃", + "christmas_week": "圣诞快乐!🎄", } return Alert( @@ -380,11 +380,11 @@ def holiday_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, def no_lane_available_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int, frogpilot_toggles: SimpleNamespace) -> Alert: lane_width = sm["frogpilotPlan"].laneWidthLeft if CS.leftBlinker else sm["frogpilotPlan"].laneWidthRight - lane_width_msg = f"{lane_width:.1f} meters" if metric else f"{lane_width * CV.METER_TO_FOOT:.1f} feet" + lane_width_msg = f"{lane_width:.1f} 米" if metric else f"{lane_width * CV.METER_TO_FOOT:.1f} 英尺" return Alert( - "No lane available", - f"Detected lane width is only {lane_width_msg}", + "无可用车道", + f"检测到的车道宽度仅为 {lane_width_msg}", AlertStatus.normal, AlertSize.mid, Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2) @@ -393,13 +393,13 @@ def torque_nn_load_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubM model_name = Params().get("NNFFModelName", encoding="utf-8") if model_name is None: return Alert( - "NNFF Torque Controller not available", - "Donate logs to Twilsonco to get your car supported!", + "NNFF 扭矩控制器不可用", + "向 Twilsonco 捐赠日志以支持您的车辆!", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.none, AudibleAlert.prompt, 10.0) else: return Alert( - "NNFF Torque Controller loaded", + "NNFF 扭矩控制器已加载", model_name, FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.LOW, VisualAlert.none, AudibleAlert.engage, 5.0) @@ -415,15 +415,15 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.joystickDebug: { ET.WARNING: joystick_alert, - ET.PERMANENT: NormalPermanentAlert("Joystick Mode"), + ET.PERMANENT: NormalPermanentAlert("操纵杆模式"), }, EventName.controlsInitializing: { - ET.NO_ENTRY: NoEntryAlert("System Initializing"), + ET.NO_ENTRY: NoEntryAlert("系统初始化中"), }, EventName.startup: { - ET.PERMANENT: StartupAlert("Be ready to take over at any time") + ET.PERMANENT: StartupAlert("随时准备接管控制") }, EventName.startupMaster: { @@ -432,35 +432,35 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # Car is recognized, but marked as dashcam only EventName.startupNoControl: { - ET.PERMANENT: StartupAlert("Dashcam mode"), - ET.NO_ENTRY: NoEntryAlert("Dashcam mode"), + ET.PERMANENT: StartupAlert("行车记录仪模式"), + ET.NO_ENTRY: NoEntryAlert("行车记录仪模式"), }, # Car is not recognized EventName.startupNoCar: { - ET.PERMANENT: StartupAlert("Dashcam mode for unsupported car"), + ET.PERMANENT: StartupAlert("不支持车辆的行车记录仪模式"), }, EventName.startupNoFw: { - ET.PERMANENT: StartupAlert("Car Unrecognized", - "Check comma power connections", + ET.PERMANENT: StartupAlert("车辆未识别", + "检查 comma 电源连接", alert_status=AlertStatus.userPrompt), }, EventName.startupNoSecOcKey: { - ET.PERMANENT: NormalPermanentAlert("Dashcam Mode", - "Security Key Not Available", + ET.PERMANENT: NormalPermanentAlert("行车记录仪模式", + "安全密钥不可用", priority=Priority.HIGH), }, EventName.dashcamMode: { - ET.PERMANENT: NormalPermanentAlert("Dashcam Mode", + ET.PERMANENT: NormalPermanentAlert("行车记录仪模式", priority=Priority.LOWEST), }, EventName.invalidLkasSetting: { - ET.PERMANENT: NormalPermanentAlert("Stock LKAS is on", - "Turn off stock LKAS to engage"), + ET.PERMANENT: NormalPermanentAlert("原厂 LKAS 已开启", + "关闭原厂 LKAS 以激活"), }, EventName.cruiseMismatch: { @@ -471,31 +471,31 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # read-only mode. This can be solved by adding your fingerprint. # See https://github.com/commaai/openpilot/wiki/Fingerprinting for more information EventName.carUnrecognized: { - ET.PERMANENT: NormalPermanentAlert("Dashcam Mode", - "Car Unrecognized", + ET.PERMANENT: NormalPermanentAlert("行车记录仪模式", + "车辆未识别", priority=Priority.LOWEST), }, EventName.stockAeb: { ET.PERMANENT: Alert( - "BRAKE!", - "Stock AEB: Risk of Collision", + "刹车!", + "原厂 AEB:碰撞风险", AlertStatus.critical, AlertSize.full, Priority.HIGHEST, VisualAlert.fcw, AudibleAlert.none, 2.), - ET.NO_ENTRY: NoEntryAlert("Stock AEB: Risk of Collision"), + ET.NO_ENTRY: NoEntryAlert("原厂 AEB:碰撞风险"), }, EventName.fcw: { ET.PERMANENT: Alert( - "BRAKE!", - "Risk of Collision", + "刹车!", + "碰撞风险", AlertStatus.critical, AlertSize.full, Priority.HIGHEST, VisualAlert.fcw, AudibleAlert.warningSoft, 2.), }, EventName.ldw: { ET.PERMANENT: Alert( - "Lane Departure Detected", + "检测到车道偏离", "", AlertStatus.userPrompt, AlertSize.small, Priority.LOW, VisualAlert.ldw, AudibleAlert.prompt, 3.), @@ -505,7 +505,7 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.steerTempUnavailableSilent: { ET.WARNING: Alert( - "Steering Temporarily Unavailable", + "转向暂时不可用", "", AlertStatus.userPrompt, AlertSize.small, Priority.LOW, VisualAlert.steerRequired, AudibleAlert.prompt, 1.8), @@ -513,7 +513,7 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.preDriverDistracted: { ET.PERMANENT: Alert( - "Pay Attention", + "请注意", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, .1), @@ -521,23 +521,23 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.promptDriverDistracted: { ET.PERMANENT: Alert( - "Pay Attention", - "Driver Distracted", + "请注意", + "驾驶员分心", AlertStatus.userPrompt, AlertSize.mid, Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), }, EventName.driverDistracted: { ET.PERMANENT: Alert( - "DISENGAGE IMMEDIATELY", - "Driver Distracted", + "立即退出", + "驾驶员分心", AlertStatus.critical, AlertSize.full, Priority.HIGH, VisualAlert.steerRequired, AudibleAlert.warningImmediate, .1), }, EventName.preDriverUnresponsive: { ET.PERMANENT: Alert( - "Touch Steering Wheel: No Face Detected", + "触摸方向盘:未检测到面部", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.steerRequired, AudibleAlert.none, .1, alert_rate=0.75), @@ -545,31 +545,31 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.promptDriverUnresponsive: { ET.PERMANENT: Alert( - "Touch Steering Wheel", - "Driver Unresponsive", + "触摸方向盘", + "驾驶员无响应", AlertStatus.userPrompt, AlertSize.mid, Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), }, EventName.driverUnresponsive: { ET.PERMANENT: Alert( - "DISENGAGE IMMEDIATELY", - "Driver Unresponsive", + "立即退出", + "驾驶员无响应", AlertStatus.critical, AlertSize.full, Priority.HIGH, VisualAlert.steerRequired, AudibleAlert.warningImmediate, .1), }, EventName.manualRestart: { ET.WARNING: Alert( - "TAKE CONTROL", - "Resume Driving Manually", + "接管控制", + "手动恢复驾驶", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.none, AudibleAlert.none, .2), }, EventName.resumeRequired: { ET.WARNING: Alert( - "Press Resume to Exit Standstill", + "按恢复键退出停车状态", "", AlertStatus.userPrompt, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, .2), @@ -581,7 +581,7 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.preLaneChangeLeft: { ET.WARNING: Alert( - "Steer Left to Start Lane Change Once Safe", + "安全时向左转向开始变道", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, .1, alert_rate=0.75), @@ -589,7 +589,7 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.preLaneChangeRight: { ET.WARNING: Alert( - "Steer Right to Start Lane Change Once Safe", + "安全时向右转向开始变道", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, .1, alert_rate=0.75), @@ -597,7 +597,7 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.laneChangeBlocked: { ET.WARNING: Alert( - "Car Detected in Blindspot", + "检测到盲区有车辆", "", AlertStatus.userPrompt, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.prompt, .1), @@ -605,7 +605,7 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.laneChange: { ET.WARNING: Alert( - "Changing Lanes", + "正在变道", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, .1), @@ -613,41 +613,41 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.steerSaturated: { ET.WARNING: Alert( - "Take Control", - "Turn Exceeds Steering Limit", + "接管控制", + "转向超出转向限制", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.steerRequired, AudibleAlert.promptRepeat, 2.), }, # Thrown when the fan is driven at >50% but is not rotating EventName.fanMalfunction: { - ET.PERMANENT: NormalPermanentAlert("Fan Malfunction", "Likely Hardware Issue"), + ET.PERMANENT: NormalPermanentAlert("风扇故障", "可能是硬件问题"), }, # Camera is not outputting frames EventName.cameraMalfunction: { ET.PERMANENT: camera_malfunction_alert, - ET.SOFT_DISABLE: soft_disable_alert("Camera Malfunction"), - ET.NO_ENTRY: NoEntryAlert("Camera Malfunction: Reboot Your Device"), + ET.SOFT_DISABLE: soft_disable_alert("摄像头故障"), + ET.NO_ENTRY: NoEntryAlert("摄像头故障:重启设备"), }, # Camera framerate too low EventName.cameraFrameRate: { - ET.PERMANENT: NormalPermanentAlert("Camera Frame Rate Low", "Reboot your Device"), - ET.SOFT_DISABLE: soft_disable_alert("Camera Frame Rate Low"), - ET.NO_ENTRY: NoEntryAlert("Camera Frame Rate Low: Reboot Your Device"), + ET.PERMANENT: NormalPermanentAlert("摄像头帧率过低", "重启设备"), + ET.SOFT_DISABLE: soft_disable_alert("摄像头帧率过低"), + ET.NO_ENTRY: NoEntryAlert("摄像头帧率过低:重启设备"), }, # Unused EventName.locationdTemporaryError: { - ET.NO_ENTRY: NoEntryAlert("locationd Temporary Error"), - ET.SOFT_DISABLE: soft_disable_alert("locationd Temporary Error"), + ET.NO_ENTRY: NoEntryAlert("locationd 临时错误"), + ET.SOFT_DISABLE: soft_disable_alert("locationd 临时错误"), }, EventName.locationdPermanentError: { - ET.NO_ENTRY: NoEntryAlert("locationd Permanent Error"), - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("locationd Permanent Error"), - ET.PERMANENT: NormalPermanentAlert("locationd Permanent Error"), + ET.NO_ENTRY: NoEntryAlert("locationd 永久错误"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("locationd 永久错误"), + ET.PERMANENT: NormalPermanentAlert("locationd 永久错误"), }, # openpilot tries to learn certain parameters about your car by observing @@ -659,14 +659,14 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # This alert is thrown when any of these values exceed a sanity check. This can be caused by # bad alignment or bad sensor data. If this happens consistently consider creating an issue on GitHub EventName.paramsdTemporaryError: { - ET.NO_ENTRY: NoEntryAlert("paramsd Temporary Error"), - ET.SOFT_DISABLE: soft_disable_alert("paramsd Temporary Error"), + ET.NO_ENTRY: NoEntryAlert("paramsd 临时错误"), + ET.SOFT_DISABLE: soft_disable_alert("paramsd 临时错误"), }, EventName.paramsdPermanentError: { - ET.NO_ENTRY: NoEntryAlert("paramsd Permanent Error"), - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("paramsd Permanent Error"), - ET.PERMANENT: NormalPermanentAlert("paramsd Permanent Error"), + ET.NO_ENTRY: NoEntryAlert("paramsd 永久错误"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("paramsd 永久错误"), + ET.PERMANENT: NormalPermanentAlert("paramsd 永久错误"), }, # ********** events that affect controls state transitions ********** @@ -685,28 +685,28 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.buttonCancel: { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), - ET.NO_ENTRY: NoEntryAlert("Cancel Pressed"), + ET.NO_ENTRY: NoEntryAlert("取消按钮已按下"), }, EventName.brakeHold: { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), - ET.NO_ENTRY: NoEntryAlert("Brake Hold Active"), + ET.NO_ENTRY: NoEntryAlert("刹车保持激活"), }, EventName.parkBrake: { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), - ET.NO_ENTRY: NoEntryAlert("Parking Brake Engaged"), + ET.NO_ENTRY: NoEntryAlert("驻车制动已启用"), }, EventName.pedalPressed: { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), - ET.NO_ENTRY: NoEntryAlert("Pedal Pressed", + ET.NO_ENTRY: NoEntryAlert("踏板已按下", visual_alert=VisualAlert.brakePressed), }, EventName.preEnableStandstill: { ET.PRE_ENABLE: Alert( - "Release Brake to Engage", + "松开刹车以激活", "", AlertStatus.normal, AlertSize.small, Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, creation_delay=1.), @@ -734,27 +734,27 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { }, EventName.resumeBlocked: { - ET.NO_ENTRY: NoEntryAlert("Press Set to Engage"), + ET.NO_ENTRY: NoEntryAlert("按设置键以激活"), }, EventName.wrongCruiseMode: { ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), - ET.NO_ENTRY: NoEntryAlert("Adaptive Cruise Disabled"), + ET.NO_ENTRY: NoEntryAlert("自适应巡航已禁用"), }, EventName.steerTempUnavailable: { - ET.SOFT_DISABLE: soft_disable_alert("Steering Temporarily Unavailable"), - ET.NO_ENTRY: NoEntryAlert("Steering Temporarily Unavailable"), + ET.SOFT_DISABLE: soft_disable_alert("转向暂时不可用"), + ET.NO_ENTRY: NoEntryAlert("转向暂时不可用"), }, EventName.steerTimeLimit: { - ET.SOFT_DISABLE: soft_disable_alert("Vehicle Steering Time Limit"), - ET.NO_ENTRY: NoEntryAlert("Vehicle Steering Time Limit"), + ET.SOFT_DISABLE: soft_disable_alert("车辆转向时间限制"), + ET.NO_ENTRY: NoEntryAlert("车辆转向时间限制"), }, EventName.outOfSpace: { ET.PERMANENT: out_of_space_alert, - ET.NO_ENTRY: NoEntryAlert("Out of Storage"), + ET.NO_ENTRY: NoEntryAlert("存储空间不足"), }, EventName.belowEngageSpeed: { @@ -763,40 +763,40 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { EventName.sensorDataInvalid: { ET.PERMANENT: Alert( - "Sensor Data Invalid", - "Possible Hardware Issue", + "传感器数据无效", + "可能是硬件问题", AlertStatus.normal, AlertSize.mid, Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=1.), - ET.NO_ENTRY: NoEntryAlert("Sensor Data Invalid"), - ET.SOFT_DISABLE: soft_disable_alert("Sensor Data Invalid"), + ET.NO_ENTRY: NoEntryAlert("传感器数据无效"), + ET.SOFT_DISABLE: soft_disable_alert("传感器数据无效"), }, EventName.noGps: { ET.PERMANENT: Alert( - "Poor GPS reception", - "Ensure device has a clear view of the sky", + "GPS 信号差", + "确保设备有清晰的天空视野", AlertStatus.normal, AlertSize.mid, Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=600.) }, EventName.soundsUnavailable: { - ET.PERMANENT: NormalPermanentAlert("Speaker not found", "Reboot your Device"), - ET.NO_ENTRY: NoEntryAlert("Speaker not found"), + ET.PERMANENT: NormalPermanentAlert("未找到扬声器", "重启设备"), + ET.NO_ENTRY: NoEntryAlert("未找到扬声器"), }, EventName.tooDistracted: { - ET.NO_ENTRY: NoEntryAlert("Distraction Level Too High"), + ET.NO_ENTRY: NoEntryAlert("分心程度过高"), }, EventName.overheat: { ET.PERMANENT: overheat_alert, - ET.SOFT_DISABLE: soft_disable_alert("System Overheated"), - ET.NO_ENTRY: NoEntryAlert("System Overheated"), + ET.SOFT_DISABLE: soft_disable_alert("系统过热"), + ET.NO_ENTRY: NoEntryAlert("系统过热"), }, EventName.wrongGear: { - ET.SOFT_DISABLE: user_soft_disable_alert("Gear not D"), - ET.NO_ENTRY: NoEntryAlert("Gear not D"), + ET.SOFT_DISABLE: user_soft_disable_alert("档位不在 D 档"), + ET.NO_ENTRY: NoEntryAlert("档位不在 D 档"), }, # This alert is thrown when the calibration angles are outside of the acceptable range. @@ -806,40 +806,40 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # See https://comma.ai/setup for more information EventName.calibrationInvalid: { ET.PERMANENT: calibration_invalid_alert, - ET.SOFT_DISABLE: soft_disable_alert("Calibration Invalid: Remount Device & Recalibrate"), - ET.NO_ENTRY: NoEntryAlert("Calibration Invalid: Remount Device & Recalibrate"), + ET.SOFT_DISABLE: soft_disable_alert("校准无效:重新安装设备并重新校准"), + ET.NO_ENTRY: NoEntryAlert("校准无效:重新安装设备并重新校准"), }, EventName.calibrationIncomplete: { ET.PERMANENT: calibration_incomplete_alert, - ET.SOFT_DISABLE: soft_disable_alert("Calibration Incomplete"), - ET.NO_ENTRY: NoEntryAlert("Calibration in Progress"), + ET.SOFT_DISABLE: soft_disable_alert("校准未完成"), + ET.NO_ENTRY: NoEntryAlert("校准进行中"), }, EventName.calibrationRecalibrating: { ET.PERMANENT: calibration_incomplete_alert, - ET.SOFT_DISABLE: soft_disable_alert("Device Remount Detected: Recalibrating"), - ET.NO_ENTRY: NoEntryAlert("Remount Detected: Recalibrating"), + ET.SOFT_DISABLE: soft_disable_alert("检测到设备重新安装:重新校准中"), + ET.NO_ENTRY: NoEntryAlert("检测到重新安装:重新校准中"), }, EventName.doorOpen: { - ET.SOFT_DISABLE: user_soft_disable_alert("Door Open"), - ET.NO_ENTRY: NoEntryAlert("Door Open"), + ET.SOFT_DISABLE: user_soft_disable_alert("车门未关"), + ET.NO_ENTRY: NoEntryAlert("车门未关"), }, EventName.seatbeltNotLatched: { - ET.SOFT_DISABLE: user_soft_disable_alert("Seatbelt Unlatched"), - ET.NO_ENTRY: NoEntryAlert("Seatbelt Unlatched"), + ET.SOFT_DISABLE: user_soft_disable_alert("安全带未系"), + ET.NO_ENTRY: NoEntryAlert("安全带未系"), }, EventName.espDisabled: { - ET.SOFT_DISABLE: soft_disable_alert("Electronic Stability Control Disabled"), - ET.NO_ENTRY: NoEntryAlert("Electronic Stability Control Disabled"), + ET.SOFT_DISABLE: soft_disable_alert("电子稳定控制系统已禁用"), + ET.NO_ENTRY: NoEntryAlert("电子稳定控制系统已禁用"), }, EventName.lowBattery: { - ET.SOFT_DISABLE: soft_disable_alert("Low Battery"), - ET.NO_ENTRY: NoEntryAlert("Low Battery"), + ET.SOFT_DISABLE: soft_disable_alert("电量低"), + ET.NO_ENTRY: NoEntryAlert("电量低"), }, # Different openpilot services communicate between each other at a certain @@ -847,36 +847,36 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # is thrown. This can mean a service crashed, did not broadcast a message for # ten times the regular interval, or the average interval is more than 10% too high. EventName.commIssue: { - ET.SOFT_DISABLE: soft_disable_alert("Communication Issue Between Processes"), + ET.SOFT_DISABLE: soft_disable_alert("进程间通信问题"), ET.NO_ENTRY: comm_issue_alert, }, EventName.commIssueAvgFreq: { - ET.SOFT_DISABLE: soft_disable_alert("Low Communication Rate Between Processes"), - ET.NO_ENTRY: NoEntryAlert("Low Communication Rate Between Processes"), + ET.SOFT_DISABLE: soft_disable_alert("进程间通信速率过低"), + ET.NO_ENTRY: NoEntryAlert("进程间通信速率过低"), }, EventName.controlsdLagging: { - ET.SOFT_DISABLE: soft_disable_alert("Controls Lagging"), - ET.NO_ENTRY: NoEntryAlert("Controls Process Lagging: Reboot Your Device"), + ET.SOFT_DISABLE: soft_disable_alert("控制进程延迟"), + ET.NO_ENTRY: NoEntryAlert("控制进程延迟:重启设备"), }, # Thrown when manager detects a service exited unexpectedly while driving EventName.processNotRunning: { ET.NO_ENTRY: process_not_running_alert, - ET.SOFT_DISABLE: soft_disable_alert("Process Not Running"), + ET.SOFT_DISABLE: soft_disable_alert("进程未运行"), }, EventName.radarFault: { - ET.SOFT_DISABLE: soft_disable_alert("Radar Error: Restart the Car"), - ET.NO_ENTRY: NoEntryAlert("Radar Error: Restart the Car"), + ET.SOFT_DISABLE: soft_disable_alert("雷达错误:重启车辆"), + ET.NO_ENTRY: NoEntryAlert("雷达错误:重启车辆"), }, # Every frame from the camera should be processed by the model. If modeld # is not processing frames fast enough they have to be dropped. This alert is # thrown when over 20% of frames are dropped. EventName.modeldLagging: { - ET.SOFT_DISABLE: soft_disable_alert("Driving Model Lagging"), - ET.NO_ENTRY: NoEntryAlert("Driving Model Lagging"), + ET.SOFT_DISABLE: soft_disable_alert("驾驶模型延迟"), + ET.NO_ENTRY: NoEntryAlert("驾驶模型延迟"), ET.PERMANENT: modeld_lagging_alert, }, @@ -886,21 +886,21 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # usually means the model has trouble understanding the scene. This is used # as a heuristic to warn the driver. EventName.posenetInvalid: { - ET.SOFT_DISABLE: soft_disable_alert("Posenet Speed Invalid"), + ET.SOFT_DISABLE: soft_disable_alert("Posenet 速度无效"), ET.NO_ENTRY: posenet_invalid_alert, }, # When the localizer detects an acceleration of more than 40 m/s^2 (~4G) we # alert the driver the device might have fallen from the windshield. EventName.deviceFalling: { - ET.SOFT_DISABLE: soft_disable_alert("Device Fell Off Mount"), - ET.NO_ENTRY: NoEntryAlert("Device Fell Off Mount"), + ET.SOFT_DISABLE: soft_disable_alert("设备从支架上掉落"), + ET.NO_ENTRY: NoEntryAlert("设备从支架上掉落"), }, EventName.lowMemory: { - ET.SOFT_DISABLE: soft_disable_alert("Low Memory: Reboot Your Device"), + ET.SOFT_DISABLE: soft_disable_alert("内存不足:重启设备"), ET.PERMANENT: low_memory_alert, - ET.NO_ENTRY: NoEntryAlert("Low Memory: Reboot Your Device"), + ET.NO_ENTRY: NoEntryAlert("内存不足:重启设备"), }, EventName.highCpuUsage: { @@ -910,14 +910,14 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { }, EventName.accFaulted: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Cruise Fault: Restart the Car"), - ET.PERMANENT: NormalPermanentAlert("Cruise Fault: Restart the car to engage"), - ET.NO_ENTRY: NoEntryAlert("Cruise Fault: Restart the Car"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("巡航故障:重启车辆"), + ET.PERMANENT: NormalPermanentAlert("巡航故障:重启车辆以启用"), + ET.NO_ENTRY: NoEntryAlert("巡航故障:重启车辆"), }, EventName.controlsMismatch: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Controls Mismatch"), - ET.NO_ENTRY: NoEntryAlert("Controls Mismatch"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("控制不匹配"), + ET.NO_ENTRY: NoEntryAlert("控制不匹配"), }, EventName.roadCameraError: { @@ -941,9 +941,9 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # Sometimes the USB stack on the device can get into a bad state # causing the connection to the panda to be lost EventName.usbError: { - ET.SOFT_DISABLE: soft_disable_alert("USB Error: Reboot Your Device"), - ET.PERMANENT: NormalPermanentAlert("USB Error: Reboot Your Device", ""), - ET.NO_ENTRY: NoEntryAlert("USB Error: Reboot Your Device"), + ET.SOFT_DISABLE: soft_disable_alert("USB 错误:重启设备"), + ET.PERMANENT: NormalPermanentAlert("USB 错误:重启设备", ""), + ET.NO_ENTRY: NoEntryAlert("USB 错误:重启设备"), }, # This alert can be thrown for the following reasons: @@ -951,45 +951,45 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # - CAN data is received, but some message are not received at the right frequency # If you're not writing a new car port, this is usually cause by faulty wiring EventName.canError: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN Error"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN 错误"), ET.PERMANENT: Alert( - "CAN Error: Check Connections", + "CAN 错误:检查连接", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, 1., creation_delay=1.), - ET.NO_ENTRY: NoEntryAlert("CAN Error: Check Connections"), + ET.NO_ENTRY: NoEntryAlert("CAN 错误:检查连接"), }, EventName.canBusMissing: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN Bus Disconnected"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN 总线断开"), ET.PERMANENT: Alert( - "CAN Bus Disconnected: Likely Faulty Cable", + "CAN 总线断开:可能是线缆故障", "", AlertStatus.normal, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.none, 1., creation_delay=1.), - ET.NO_ENTRY: NoEntryAlert("CAN Bus Disconnected: Check Connections"), + ET.NO_ENTRY: NoEntryAlert("CAN 总线断开:检查连接"), }, EventName.steerUnavailable: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("LKAS Fault: Restart the Car"), - ET.PERMANENT: NormalPermanentAlert("LKAS Fault: Restart the car to engage"), - ET.NO_ENTRY: NoEntryAlert("LKAS Fault: Restart the Car"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("LKAS 故障:重启车辆"), + ET.PERMANENT: NormalPermanentAlert("LKAS 故障:重启车辆以启用"), + ET.NO_ENTRY: NoEntryAlert("LKAS 故障:重启车辆"), }, EventName.reverseGear: { ET.PERMANENT: Alert( - "Reverse\nGear", + "倒车\n档位", "", AlertStatus.normal, AlertSize.full, Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .2, creation_delay=0.5), - ET.USER_DISABLE: ImmediateDisableAlert("Reverse Gear"), - ET.NO_ENTRY: NoEntryAlert("Reverse Gear"), + ET.USER_DISABLE: ImmediateDisableAlert("倒车档位"), + ET.NO_ENTRY: NoEntryAlert("倒车档位"), }, # On cars that use stock ACC the car can decide to cancel ACC for various reasons. # When this happens we can no long control the car so the user needs to be warned immediately. EventName.cruiseDisabled: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Cruise Is Off"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("巡航已关闭"), }, # When the relay in the harness box opens the CAN bus between the LKAS camera @@ -997,15 +997,15 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # are received on the car side this usually means the relay hasn't opened correctly # and this alert is thrown. EventName.relayMalfunction: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Harness Relay Malfunction"), - ET.PERMANENT: NormalPermanentAlert("Harness Relay Malfunction", "Check Hardware"), - ET.NO_ENTRY: NoEntryAlert("Harness Relay Malfunction"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("线束继电器故障"), + ET.PERMANENT: NormalPermanentAlert("线束继电器故障", "检查硬件"), + ET.NO_ENTRY: NoEntryAlert("线束继电器故障"), }, EventName.speedTooLow: { ET.IMMEDIATE_DISABLE: Alert( - "openpilot Canceled", - "Speed too low", + "openpilot 已取消", + "速度过低", AlertStatus.normal, AlertSize.mid, Priority.HIGH, VisualAlert.none, AudibleAlert.disengage, 3.), }, @@ -1013,35 +1013,35 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # When the car is driving faster than most cars in the training data, the model outputs can be unpredictable. EventName.speedTooHigh: { ET.WARNING: Alert( - "Speed Too High", - "Model uncertain at this speed", + "速度过高", + "模型在此速度下不确定", AlertStatus.userPrompt, AlertSize.mid, Priority.HIGH, VisualAlert.steerRequired, AudibleAlert.promptRepeat, 4.), - ET.NO_ENTRY: NoEntryAlert("Slow down to engage"), + ET.NO_ENTRY: NoEntryAlert("减速以启用"), }, EventName.lowSpeedLockout: { - ET.PERMANENT: NormalPermanentAlert("Cruise Fault: Restart the car to engage"), - ET.NO_ENTRY: NoEntryAlert("Cruise Fault: Restart the Car"), + ET.PERMANENT: NormalPermanentAlert("巡航故障:重启车辆以启用"), + ET.NO_ENTRY: NoEntryAlert("巡航故障:重启车辆"), }, EventName.lkasDisabled: { - ET.PERMANENT: NormalPermanentAlert("LKAS Disabled: Enable LKAS to engage"), - ET.NO_ENTRY: NoEntryAlert("LKAS Disabled"), + ET.PERMANENT: NormalPermanentAlert("LKAS 已禁用:启用 LKAS 以激活"), + ET.NO_ENTRY: NoEntryAlert("LKAS 已禁用"), }, EventName.vehicleSensorsInvalid: { - ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Vehicle Sensors Invalid"), - ET.PERMANENT: NormalPermanentAlert("Vehicle Sensors Calibrating", "Drive to Calibrate"), - ET.NO_ENTRY: NoEntryAlert("Vehicle Sensors Calibrating"), + ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("车辆传感器无效"), + ET.PERMANENT: NormalPermanentAlert("车辆传感器校准中", "行驶以校准"), + ET.NO_ENTRY: NoEntryAlert("车辆传感器校准中"), }, } FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.blockUser: { ET.PERMANENT: Alert( - "Don't use the 'Development' branch!", - "Forcing you into 'Dashcam Mode' for your safety", + "请不要使用'开发'分支!", + "为了您的安全,强制进入'行车记录仪模式'", AlertStatus.userPrompt, AlertSize.mid, Priority.HIGHEST, VisualAlert.none, AudibleAlert.none, 1.), }, @@ -1056,15 +1056,15 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.goatSteerSaturated: { ET.WARNING: Alert( - "JESUS TAKE THE WHEEL!!", - "Turn Exceeds Steering Limit", + "耶稣接管方向盘!!", + "转向超出转向限制", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.steerRequired, FrogPilotAudibleAlert.goat, 2.), }, FrogPilotEventName.greenLight: { ET.PERMANENT: Alert( - "Light turned green", + "绿灯已亮", "", FrogPilotAlertStatus.frogpilot, AlertSize.small, Priority.MID, VisualAlert.none, AudibleAlert.prompt, 3.), @@ -1076,7 +1076,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.laneChangeBlockedLoud: { ET.WARNING: Alert( - "Car Detected in Blindspot", + "盲区检测到车辆", "", AlertStatus.userPrompt, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.warningSoft, .1), @@ -1084,7 +1084,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.leadDeparting: { ET.PERMANENT: Alert( - "Lead departed", + "前车已离开", "", FrogPilotAlertStatus.frogpilot, AlertSize.small, Priority.MID, VisualAlert.none, AudibleAlert.prompt, 3.), @@ -1096,29 +1096,29 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.openpilotCrashed: { ET.IMMEDIATE_DISABLE: Alert( - "openpilot crashed", - "Please post the 'Error Log' in the FrogPilot Discord!", + "openpilot 已崩溃", + "请在 FrogPilot Discord 中发布'错误日志'!", AlertStatus.critical, AlertSize.mid, Priority.HIGHEST, VisualAlert.none, AudibleAlert.prompt, .1), ET.NO_ENTRY: Alert( - "openpilot crashed", - "Please post the 'Error Log' in the FrogPilot Discord!", + "openpilot 已崩溃", + "请在 FrogPilot Discord 中发布'错误日志'!", AlertStatus.critical, AlertSize.mid, Priority.HIGHEST, VisualAlert.none, AudibleAlert.prompt, .1), }, FrogPilotEventName.pedalInterceptorNoBrake: { ET.WARNING: Alert( - "Braking Unavailable", - "Shift to L", + "制动不可用", + "换到 L 档", AlertStatus.userPrompt, AlertSize.mid, Priority.HIGH, VisualAlert.wrongGear, AudibleAlert.promptRepeat, 4.), }, FrogPilotEventName.speedLimitChanged: { ET.PERMANENT: Alert( - "Speed limit changed", + "限速已更改", "", FrogPilotAlertStatus.frogpilot, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.prompt, 3.), @@ -1126,8 +1126,8 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.thisIsFineSteerSaturated: { ET.WARNING: Alert( - "This is fine ☕", - "Turn Exceeds Steering Limit", + "这很好 ☕", + "转向超出转向限制", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.steerRequired, FrogPilotAudibleAlert.thisIsFine, 2.), }, @@ -1138,7 +1138,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.trafficModeActive: { ET.WARNING: Alert( - "Traffic Mode enabled", + "交通模式已启用", "", FrogPilotAlertStatus.frogpilot, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.prompt, 3.), @@ -1146,7 +1146,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.trafficModeInactive: { ET.WARNING: Alert( - "Traffic Mode Disabled", + "交通模式已禁用", "", FrogPilotAlertStatus.frogpilot, AlertSize.small, Priority.LOW, VisualAlert.none, AudibleAlert.prompt, 3.), @@ -1154,7 +1154,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.turningLeft: { ET.WARNING: Alert( - "Turning left", + "向左转", "", AlertStatus.normal, AlertSize.small, Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, alert_rate=0.75), @@ -1162,16 +1162,16 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.turningRight: { ET.WARNING: Alert( - "Turning right", + "向右转", "", AlertStatus.normal, AlertSize.small, Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, alert_rate=0.75), }, - # Random Events + # 随机事件 FrogPilotEventName.accel30: { ET.WARNING: Alert( - "UwU u went a bit fast there!", + "UwU 你开得有点快哦!", "(⁄ ⁄•⁄ω⁄•⁄ ⁄)", FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.LOW, VisualAlert.none, FrogPilotAudibleAlert.uwu, 4.), @@ -1179,15 +1179,15 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.accel35: { ET.WARNING: Alert( - "I ain't giving you no tree-fiddy", - "You damn Loch Ness Monsta!", + "我不会给你三块五的", + "你这个该死的尼斯湖水怪!", FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.LOW, VisualAlert.none, FrogPilotAudibleAlert.nessie, 4.), }, FrogPilotEventName.accel40: { ET.WARNING: Alert( - "Great Scott!", + "天啊!", "🚗💨", FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.LOW, VisualAlert.none, FrogPilotAudibleAlert.doc, 4.), @@ -1195,7 +1195,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.dejaVuCurve: { ET.PERMANENT: Alert( - "♬♪ Deja vu! ᕕ(⌐■_■)ᕗ ♪♬", + "♬♪ 似曾相识!ᕕ(⌐■_■)ᕗ ♪♬", "🏎️", FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.LOW, VisualAlert.none, FrogPilotAudibleAlert.dejaVu, 4.), @@ -1203,37 +1203,37 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.firefoxSteerSaturated: { ET.WARNING: Alert( - "IE Has Stopped Responding...", - "Turn Exceeds Steering Limit", + "IE 已停止响应...", + "转向超出转向限制", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.steerRequired, FrogPilotAudibleAlert.firefox, 4.), }, FrogPilotEventName.hal9000: { ET.WARNING: Alert( - "I'm sorry Dave", - "I'm afraid I can't do that...", + "对不起,戴夫", + "恐怕我不能那样做...", AlertStatus.normal, AlertSize.mid, Priority.HIGH, VisualAlert.none, FrogPilotAudibleAlert.hal9000, 4.), }, FrogPilotEventName.openpilotCrashedRandomEvent: { ET.IMMEDIATE_DISABLE: Alert( - "openpilot crashed 💩", - "Please post the 'Error Log' in the FrogPilot Discord!", + "openpilot 崩溃了 💩", + "请在 FrogPilot Discord 中发布'错误日志'!", AlertStatus.normal, AlertSize.mid, Priority.HIGHEST, VisualAlert.none, FrogPilotAudibleAlert.fart, 10.), ET.NO_ENTRY: Alert( - "openpilot crashed 💩", - "Please post the 'Error Log' in the FrogPilot Discord!", + "openpilot 崩溃了 💩", + "请在 FrogPilot Discord 中发布'错误日志'!", AlertStatus.normal, AlertSize.mid, Priority.HIGHEST, VisualAlert.none, FrogPilotAudibleAlert.fart, 10.), }, FrogPilotEventName.toBeContinued: { ET.PERMANENT: Alert( - "To be continued...", + "未完待续...", "⬅️", FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.MID, VisualAlert.none, FrogPilotAudibleAlert.continued, 7.), @@ -1241,7 +1241,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.vCruise69: { ET.WARNING: Alert( - "Lol 69", + "哈哈 69", "", FrogPilotAlertStatus.frogpilot, AlertSize.small, Priority.LOW, VisualAlert.none, FrogPilotAudibleAlert.noice, 2.), @@ -1249,7 +1249,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.yourFrogTriedToKillMe: { ET.PERMANENT: Alert( - "Your Frog tried to kill me...", + "你的青蛙试图杀死我...", "👺", FrogPilotAlertStatus.frogpilot, AlertSize.mid, Priority.MID, VisualAlert.none, FrogPilotAudibleAlert.angry, 5.), @@ -1257,7 +1257,7 @@ FROGPILOT_EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { FrogPilotEventName.youveGotMail: { ET.WARNING: Alert( - "You've got mail! 📧", + "您有新邮件!📧", "", FrogPilotAlertStatus.frogpilot, AlertSize.small, Priority.LOW, VisualAlert.none, FrogPilotAudibleAlert.mail, 3.), diff --git a/selfdrive/monitoring/dmonitoringd.py b/selfdrive/monitoring/dmonitoringd.py index da09e2b..3abea14 100755 --- a/selfdrive/monitoring/dmonitoringd.py +++ b/selfdrive/monitoring/dmonitoringd.py @@ -28,9 +28,9 @@ def dmonitoringd_thread(): continue valid = sm.all_checks() - if valid: + if DM.always_on and valid: DM.run_step(sm) - elif driver_view_enabled: + elif DM.always_on and driver_view_enabled: DM.face_detected = sm['driverStateV2'].leftDriverData.faceProb > DM.settings._FACE_THRESHOLD or sm['driverStateV2'].rightDriverData.faceProb > DM.settings._FACE_THRESHOLD # publish