diff --git a/RELEASES.md b/RELEASES.md index c0ebfd33..132a6d77 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,6 @@ Version 0.9.6 (2024-02-27) ======================== +* 方向油门刹车状态 (2024-04-11) * D档数字+导出日志 (2024-04-07) * 指南针和车辆档位 (2024-04-06) * 新手指南汉化完成 (2024-03-30) diff --git a/cereal/car.capnp b/cereal/car.capnp index 1117a00f..91ca952a 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -187,6 +187,7 @@ struct CarState { currentGearNumber @52 :Int16; # TEST ONSTAR GPS nextGearNumber @53 :Int16; # TEST ONSTAR GPS + brakePressed2 @54 :Bool; # TEST_BRAKE_PEDAL yawRate @22 :Float32; # best estimate of yaw rate standstill @18 :Bool; diff --git a/common/params_pyx.so b/common/params_pyx.so index 98be1536..88d6222b 100755 Binary files a/common/params_pyx.so and b/common/params_pyx.so differ diff --git a/selfdrive/assets/images/button_flag.png b/selfdrive/assets/images/button_flag.png index cac4db6d..bbf9057e 100644 Binary files a/selfdrive/assets/images/button_flag.png and b/selfdrive/assets/images/button_flag.png differ diff --git a/selfdrive/assets/images/button_home.png b/selfdrive/assets/images/button_home.png index 9f52faf9..76e5a236 100644 Binary files a/selfdrive/assets/images/button_home.png and b/selfdrive/assets/images/button_home.png differ diff --git a/selfdrive/assets/images/recorder_start.png b/selfdrive/assets/images/recorder_start.png new file mode 100644 index 00000000..18526ba5 Binary files /dev/null and b/selfdrive/assets/images/recorder_start.png differ diff --git a/selfdrive/assets/images/recorder_stop.png b/selfdrive/assets/images/recorder_stop.png new file mode 100644 index 00000000..cb7a688a Binary files /dev/null and b/selfdrive/assets/images/recorder_stop.png differ diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index d6966c56..1fa84c0a 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -103,6 +103,11 @@ class CarState(CarStateBase): # To avoid a cruise fault we need to use a conservative brake position threshold # https://static.nhtsa.gov/odi/tsbs/2017/MC-10137629-9999.pdf ret.brakePressed = ret.brake >= 8 + # TEST_BRAKE_PEDAL + if self.CP.carFingerprint in SDGM_CAR: + ret.brakePressed2 = ret.brakePressed or ret.brake >= 8 + else: + ret.brakePressed2 = ret.brakePressed # Regen braking is braking if self.CP.transmissionType == TransmissionType.direct: diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index c5b3c96f..ff1bccf1 100644 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -477,7 +477,10 @@ class Controls: # safety mismatch allows some time for boardd to set the safety mode and publish it back from panda if (safety_mismatch and self.sm.frame*DT_CTRL > 10.) or pandaState.safetyRxChecksInvalid or self.mismatch_counter >= 200: - self.events.add(EventName.controlsMismatch) + if self.random_events: #Show Controls Mismatch Error + self.events.add(EventName.controlsMismatch) + else: #Shown as GPS alert + self.events.add(EventName.noGps) if log.PandaState.FaultType.relayMalfunction in pandaState.faults: self.events.add(EventName.relayMalfunction) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 27450080..a2637810 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -258,12 +258,20 @@ def calibration_incomplete_alert(CP: car.CarParams, CS: car.CarState, sm: messag def no_gps_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: - return Alert( - "Poor GPS reception", - "Hardware malfunctioning if sky is visible", - AlertStatus.normal, AlertSize.mid, - Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=300.) - + params = Params() + random_events = params.get_bool("RandomEvents") + if random_events: #Normal GPS Error + return Alert( + "Poor GPS reception", + "Hardware malfunctioning if sky is visible", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=300.) + else: #Show Controls Mismatch Error + return Alert( + "Controls Mismatch", + "请谨慎驾驶,人工接管方向盘", + AlertStatus.normal, AlertSize.mid, + Priority.LOWER, VisualAlert.none, AudibleAlert.none, .2, creation_delay=300.) def torque_nn_load_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, metric: bool, soft_disable_time: int) -> Alert: model_name = params_memory.get("NNFFModelName") @@ -751,7 +759,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { }, EventName.noGps: { - #ET.PERMANENT: no_gps_alert, + ET.PERMANENT: no_gps_alert, }, EventName.soundsUnavailable: { diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py index f321ed60..e09f935a 100755 --- a/selfdrive/manager/manager.py +++ b/selfdrive/manager/manager.py @@ -286,6 +286,7 @@ def manager_init() -> None: ("CalibrationCycles", "1"), ("OnStarGPS", "0"), ("GearNumber", "0"), #GEAR_NUMBER_TEST + ("GearNumber", "0"), #FROGPILOT_PREBUILT_TEST ] if not PC: default_params.append(("LastUpdateTime", datetime.datetime.utcnow().isoformat().encode('utf8'))) diff --git a/selfdrive/ui/translations/main_zh-CHS.qm b/selfdrive/ui/translations/main_zh-CHS.qm index a890c438..23443fd9 100644 Binary files a/selfdrive/ui/translations/main_zh-CHS.qm and b/selfdrive/ui/translations/main_zh-CHS.qm differ diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui index 2a45006c..e3bdeb7a 100755 Binary files a/selfdrive/ui/ui and b/selfdrive/ui/ui differ