diff --git a/sunnypilot/navd/navigation_desires/navigation_desires.py b/sunnypilot/navd/navigation_desires/navigation_desires.py index b39917b89e..c68cf6ca59 100644 --- a/sunnypilot/navd/navigation_desires/navigation_desires.py +++ b/sunnypilot/navd/navigation_desires/navigation_desires.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. +Copyright (c) 2021-, James Vecellio, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. @@ -35,9 +35,9 @@ class NavigationDesires: self.desire = log.Desire.keepLeft elif upcoming == 'slightRight' and (not CS.rightBlindspot or CS.vEgo < self._turn_speed_limit): self.desire = log.Desire.keepRight - elif upcoming == 'left' and CS.leftBlinker and not CS.rightBlinker and not CS.leftBlindspot and CS.vEgo < self._turn_speed_limit: + elif upcoming == 'left' and not CS.rightBlinker and not CS.leftBlindspot and CS.vEgo < self._turn_speed_limit: self.desire = log.Desire.turnLeft - elif upcoming == 'right' and CS.rightBlinker and not CS.leftBlinker and not CS.rightBlindspot and CS.vEgo < self._turn_speed_limit: + elif upcoming == 'right' and not CS.leftBlinker and not CS.rightBlindspot and CS.vEgo < self._turn_speed_limit: self.desire = log.Desire.turnRight def get_desire(self) -> log.Desire: diff --git a/sunnypilot/navd/navigation_desires/tests/test_navigation_desires.py b/sunnypilot/navd/navigation_desires/tests/test_navigation_desires.py index 6d1ae2c192..c87e75798a 100644 --- a/sunnypilot/navd/navigation_desires/tests/test_navigation_desires.py +++ b/sunnypilot/navd/navigation_desires/tests/test_navigation_desires.py @@ -1,3 +1,9 @@ +""" +Copyright (c) 2021-, James Vecellio, Haibin Wen, sunnypilot, and a number of other contributors. + +This file is part of sunnypilot and is licensed under the MIT License. +See the LICENSE.md file in the root directory for more details. +""" import pytest import types @@ -21,7 +27,7 @@ NAVIGATION_PARAMS: list[tuple] = [ ('slightLeft', make_car(vEgo=9, leftBlindspot=True), log.Desire.none), ('slightRight', make_car(vEgo=9, rightBlindspot=True), log.Desire.none), ('left', make_car(vEgo=5, leftBlinker=True, rightBlinker=False, leftBlindspot=False), log.Desire.turnLeft), - ('left', make_car(vEgo=5, leftBlinker=False), log.Desire.none), + ('left', make_car(vEgo=5, leftBlinker=False, rightBlinker=True), log.Desire.none), ('right', make_car(vEgo=6, rightBlinker=True, leftBlindspot=False), log.Desire.turnRight), ('right', make_car(vEgo=6, rightBlinker=True, rightBlindspot=True), log.Desire.none), ('left', make_car(vEgo=9, leftBlinker=True), log.Desire.none),