From ab98ae54bbf927eb471405a4e23cf2e109f431e3 Mon Sep 17 00:00:00 2001 From: Prabhaav Pillai Date: Fri, 21 Aug 2026 01:00:55 -0400 Subject: [PATCH] Fix turn allowed conditions for lane changes in DesireHelper --- selfdrive/controls/lib/desire_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/desire_helper.py b/selfdrive/controls/lib/desire_helper.py index 1a9585098..8d1330b49 100644 --- a/selfdrive/controls/lib/desire_helper.py +++ b/selfdrive/controls/lib/desire_helper.py @@ -224,12 +224,12 @@ class DesireHelper: if desired_lane_width >= starpilot_toggles.lane_detection_width and self._nav_torque_applied(carstate, lane_change_direction): return log.Desire.keepRight elif modifier in ("left", "sharpLeft"): - turn_allowed = not carstate.rightBlinker and not carstate.leftBlindspot + turn_allowed = carstate.leftBlinker and not carstate.rightBlinker and not carstate.leftBlindspot turn_allowed &= carstate.vEgo < starpilot_toggles.minimum_lane_change_speed and not carstate.standstill if turn_allowed and self._nav_turn_is_imminent(carstate, maneuver_distance): return log.Desire.turnLeft elif modifier in ("right", "sharpRight"): - turn_allowed = not carstate.leftBlinker and not carstate.rightBlindspot + turn_allowed = carstate.rightBlinker and not carstate.leftBlinker and not carstate.rightBlindspot turn_allowed &= carstate.vEgo < starpilot_toggles.minimum_lane_change_speed and not carstate.standstill if turn_allowed and self._nav_turn_is_imminent(carstate, maneuver_distance): return log.Desire.turnRight