Controls - Lane Change Customizations - Minimum Lane Change Speed

Customize the minimum driving speed to allow openpilot to change lanes.
This commit is contained in:
FrogAi 2024-05-27 03:02:18 -07:00
parent 16bc06cb98
commit 2e90b94ee6

View File

@ -5,7 +5,6 @@ from openpilot.common.realtime import DT_MDL
LaneChangeState = log.LaneChangeState LaneChangeState = log.LaneChangeState
LaneChangeDirection = log.LaneChangeDirection LaneChangeDirection = log.LaneChangeDirection
LANE_CHANGE_SPEED_MIN = 20 * CV.MPH_TO_MS
LANE_CHANGE_TIME_MAX = 10. LANE_CHANGE_TIME_MAX = 10.
DESIRES = { DESIRES = {
@ -43,7 +42,7 @@ class DesireHelper:
def update(self, carstate, lateral_active, lane_change_prob, frogpilotPlan, frogpilot_toggles): def update(self, carstate, lateral_active, lane_change_prob, frogpilotPlan, frogpilot_toggles):
v_ego = carstate.vEgo v_ego = carstate.vEgo
one_blinker = carstate.leftBlinker != carstate.rightBlinker one_blinker = carstate.leftBlinker != carstate.rightBlinker
below_lane_change_speed = v_ego < LANE_CHANGE_SPEED_MIN below_lane_change_speed = v_ego < frogpilot_toggles.minimum_lane_change_speed
if not lateral_active or self.lane_change_timer > LANE_CHANGE_TIME_MAX: if not lateral_active or self.lane_change_timer > LANE_CHANGE_TIME_MAX:
self.lane_change_state = LaneChangeState.off self.lane_change_state = LaneChangeState.off