From 754d5a4f1e636936557d52224ff3c17545ff2ab9 Mon Sep 17 00:00:00 2001 From: Candy0707 Date: Tue, 19 Aug 2025 23:10:53 +0800 Subject: [PATCH 1/6] updata HudControl Display lane lines --- selfdrive/controls/controlsd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 029d16e59e..74dff61f52 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -138,6 +138,7 @@ class Controls: def publish(self, CC, lac_log): CS = self.sm['carState'] + model = self.sm['model_v2'] # Orientation and angle rates can be useful for carcontroller # Only calibrated (car) frame is relevant for the carcontroller @@ -158,8 +159,8 @@ class Controls: hudControl.leadDistanceBars = self.sm['selfdriveState'].personality.raw + 1 hudControl.visualAlert = self.sm['selfdriveState'].alertHudVisual - hudControl.rightLaneVisible = True - hudControl.leftLaneVisible = True + hudControl.rightLaneVisible = 1 if(model.LaneLines[2] and model.LaneLineProbs[2] > 0.5) else 0 + hudControl.leftLaneVisible = 1 if(model.LaneLines[1] and model.LaneLineProbs[1] > 0.5) else 0 if self.sm.valid['driverAssistance']: hudControl.leftLaneDepart = self.sm['driverAssistance'].leftLaneDeparture hudControl.rightLaneDepart = self.sm['driverAssistance'].rightLaneDeparture From e0e288ff2f82a4c7b91bebe1b63ba1360b670fd7 Mon Sep 17 00:00:00 2001 From: Candy0707 Date: Wed, 20 Aug 2025 00:14:39 +0800 Subject: [PATCH 2/6] Bug Fix --- selfdrive/controls/controlsd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 74dff61f52..ca656a9166 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -138,7 +138,8 @@ class Controls: def publish(self, CC, lac_log): CS = self.sm['carState'] - model = self.sm['model_v2'] + model_v2 = self.sm['modelV2'] + # Orientation and angle rates can be useful for carcontroller # Only calibrated (car) frame is relevant for the carcontroller @@ -159,8 +160,8 @@ class Controls: hudControl.leadDistanceBars = self.sm['selfdriveState'].personality.raw + 1 hudControl.visualAlert = self.sm['selfdriveState'].alertHudVisual - hudControl.rightLaneVisible = 1 if(model.LaneLines[2] and model.LaneLineProbs[2] > 0.5) else 0 - hudControl.leftLaneVisible = 1 if(model.LaneLines[1] and model.LaneLineProbs[1] > 0.5) else 0 + 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 if self.sm.valid['driverAssistance']: hudControl.leftLaneDepart = self.sm['driverAssistance'].leftLaneDeparture hudControl.rightLaneDepart = self.sm['driverAssistance'].rightLaneDeparture From 700fa8c13dc96875ba9abf5214ca3fe3d80241a8 Mon Sep 17 00:00:00 2001 From: Candy0707 Date: Wed, 20 Aug 2025 00:27:20 +0800 Subject: [PATCH 3/6] Bug Fix --- selfdrive/controls/controlsd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index ca656a9166..e750cb55cd 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -160,8 +160,8 @@ 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 + 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 if self.sm.valid['driverAssistance']: hudControl.leftLaneDepart = self.sm['driverAssistance'].leftLaneDeparture hudControl.rightLaneDepart = self.sm['driverAssistance'].rightLaneDeparture From 269f15140cd485573df0c89930af3a2ad3ea87fa Mon Sep 17 00:00:00 2001 From: Candy0707 Date: Wed, 20 Aug 2025 00:43:51 +0800 Subject: [PATCH 4/6] 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 From 104a927192902a92807d9032bb9b52316a95e75f Mon Sep 17 00:00:00 2001 From: Candy0707 Date: Wed, 20 Aug 2025 01:09:29 +0800 Subject: [PATCH 5/6] Bug Fix --- selfdrive/controls/controlsd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 8f310ee027..0147c3cfd1 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -160,10 +160,10 @@ class Controls: hudControl.leadDistanceBars = self.sm['selfdriveState'].personality.raw + 1 hudControl.visualAlert = self.sm['selfdriveState'].alertHudVisual - 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) + LaneVisible = len(model_v2.laneLines) > 2 and len(model_v2.laneLineProbs) > 2 + hudControl.leftLaneVisible = bool(LaneVisible and model_v2.laneLines[1] and model_v2.laneLineProbs[1] > 0.5) + hudControl.rightLaneVisible = bool(LaneVisible and 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 From 9b913ac509b049d7d0030bd8661e13225c721810 Mon Sep 17 00:00:00 2001 From: Candy0707 Date: Wed, 20 Aug 2025 02:03:14 +0800 Subject: [PATCH 6/6] Bux Fix --- selfdrive/controls/controlsd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 0147c3cfd1..a42f754ec5 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -160,9 +160,9 @@ class Controls: hudControl.leadDistanceBars = self.sm['selfdriveState'].personality.raw + 1 hudControl.visualAlert = self.sm['selfdriveState'].alertHudVisual - LaneVisible = len(model_v2.laneLines) > 2 and len(model_v2.laneLineProbs) > 2 - hudControl.leftLaneVisible = bool(LaneVisible and model_v2.laneLines[1] and model_v2.laneLineProbs[1] > 0.5) - hudControl.rightLaneVisible = bool(LaneVisible and model_v2.laneLines[2] and model_v2.laneLineProbs[2] > 0.5) + laneVisible = len(model_v2.laneLines) > 2 and len(model_v2.laneLineProbs) > 2 + hudControl.leftLaneVisible = bool(laneVisible and len(model_v2.laneLines[1].x) > 0 and model_v2.laneLineProbs[1] > 0.5) + hudControl.rightLaneVisible = bool(laneVisible and len(model_v2.laneLines[2].x) > 0 and model_v2.laneLineProbs[2] > 0.5) if self.sm.valid['driverAssistance']: hudControl.leftLaneDepart = self.sm['driverAssistance'].leftLaneDeparture