From 6f0efe4ea05bf72182f46ffa2f78fd3286ee1b8b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 6 May 2023 03:03:28 -0700 Subject: [PATCH] Lane Departure Warning: fix desire index bug (#28119) don't subtract 1 old-commit-hash: 4e951e4524e2035d8382d08ab6028c4bc326ab6a --- 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 1391d6570c..e1a12dc7b2 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -707,8 +707,8 @@ class Controls: if len(desire_prediction) and ldw_allowed: right_lane_visible = model_v2.laneLineProbs[2] > 0.5 left_lane_visible = model_v2.laneLineProbs[1] > 0.5 - l_lane_change_prob = desire_prediction[Desire.laneChangeLeft - 1] - r_lane_change_prob = desire_prediction[Desire.laneChangeRight - 1] + l_lane_change_prob = desire_prediction[Desire.laneChangeLeft] + r_lane_change_prob = desire_prediction[Desire.laneChangeRight] lane_lines = model_v2.laneLines l_lane_close = left_lane_visible and (lane_lines[1].y[0] > -(1.08 + CAMERA_OFFSET))