mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-21 22:13:45 +08:00
fix big model alert (#38500)
This commit is contained in:
@@ -167,7 +167,8 @@ class SelfdriveD:
|
||||
|
||||
big_active = self.params.get("UsbGpuActive")
|
||||
usbgpu_present = self.sm['deviceState'].chestnutPresent
|
||||
big_failed = big_active is False or (self.big_model_active and not usbgpu_present)
|
||||
model_unavailable = big_active is True and self.sm.seen['modelV2'] and not self.sm.alive['modelV2']
|
||||
big_failed = big_active is False or model_unavailable or (self.big_model_active and not usbgpu_present)
|
||||
if big_failed and not self.big_model_failed:
|
||||
self.events.add(EventName.bigModelFailed)
|
||||
self.big_model_failed = big_failed
|
||||
@@ -175,9 +176,7 @@ class SelfdriveD:
|
||||
# soft disable if the big model fails
|
||||
if big_active:
|
||||
self.big_model_active = True
|
||||
if self.enabled and self.big_model_active and (not big_active or not usbgpu_present):
|
||||
self.events.add(EventName.modeldLagging)
|
||||
if not self.enabled:
|
||||
if not self.enabled and not model_unavailable:
|
||||
self.big_model_active = False
|
||||
|
||||
if self.sm.recv_frame['lateralManeuverPlan'] > 0:
|
||||
@@ -343,6 +342,9 @@ class SelfdriveD:
|
||||
# All events here should at least have NO_ENTRY and SOFT_DISABLE.
|
||||
num_events = len(self.events)
|
||||
|
||||
if self.big_model_active and big_failed:
|
||||
self.events.add(EventName.modeldLagging)
|
||||
|
||||
not_running = {p.name for p in self.sm['managerState'].processes if not p.running and p.shouldBeRunning}
|
||||
if self.sm.recv_frame['managerState'] and len(not_running):
|
||||
if not_running != self.not_running_prev:
|
||||
|
||||
@@ -196,6 +196,8 @@ class HudRenderer(Widget):
|
||||
return
|
||||
|
||||
big_failed = (ui_state.usbgpu_active is False or not ui_state.sm['deviceState'].chestnutPresent or
|
||||
(ui_state.usbgpu_active is True and ui_state.sm.recv_frame['modelV2'] > ui_state.started_frame and
|
||||
not ui_state.sm.alive['modelV2']) or
|
||||
(ui_state.usbgpu_active is None and ui_state.sm.recv_frame['modelV2'] > ui_state.started_frame))
|
||||
self._small_model_engaged &= big_failed
|
||||
if ui_state.usbgpu_loading or (ui_state.usbgpu_active is None and not big_failed):
|
||||
|
||||
Reference in New Issue
Block a user