From 269f15140cd485573df0c89930af3a2ad3ea87fa Mon Sep 17 00:00:00 2001 From: Candy0707 Date: Wed, 20 Aug 2025 00:43:51 +0800 Subject: [PATCH] Bug Fix --- selfdrive/controls/controlsd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index e750cb55cd..8f310ee027 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -160,8 +160,10 @@ class Controls: hudControl.leadDistanceBars = self.sm['selfdriveState'].personality.raw + 1 hudControl.visualAlert = self.sm['selfdriveState'].alertHudVisual - hudControl.rightLaneVisible = 1 if(model_v2.laneLines[2] and model_v2.laneLineProbs[2] > 0.5) else 0 - hudControl.leftLaneVisible = 1 if(model_v2.laneLines[1] and model_v2.laneLineProbs[1] > 0.5) else 0 + desire_prediction = model_v2.meta.desirePrediction + if len(desire_prediction): + hudControl.leftLaneVisible = bool(model_v2.laneLines[1] and model_v2.laneLineProbs[1] > 0.5) + hudControl.rightLaneVisible = bool(model_v2.laneLines[2] and model_v2.laneLineProbs[2] > 0.5) if self.sm.valid['driverAssistance']: hudControl.leftLaneDepart = self.sm['driverAssistance'].leftLaneDeparture hudControl.rightLaneDepart = self.sm['driverAssistance'].rightLaneDeparture