From b7e5fb51e534489d67fac8c4c88e5377983b5487 Mon Sep 17 00:00:00 2001 From: kegman Date: Sun, 2 Dec 2018 18:56:12 -0500 Subject: [PATCH] Revert auto-distance for 1 bar distance setting --- selfdrive/controls/lib/planner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/controls/lib/planner.py b/selfdrive/controls/lib/planner.py index d6cec5a400a09f..29a6a2ed549df5 100755 --- a/selfdrive/controls/lib/planner.py +++ b/selfdrive/controls/lib/planner.py @@ -230,13 +230,13 @@ def update(self, CS, lead, v_cruise_setpoint): # Defining some variables to make the logic more human readable for auto distance override below # Is the car tailgating the lead car? - if x_lead < 15 and self.v_rel >= -1 and self.v_rel < 0.25: + if x_lead < 7.5 and self.v_rel >= -1 and self.v_rel < 0.25: self.tailgating = 1 else: self.tailgating = 0 # Is the car running surface street speeds? - if CS.vEgo < 19.44: + if CS.vEgo < 18.06: self.street_speed = 1 else: self.street_speed = 0 @@ -251,9 +251,9 @@ def update(self, CS, lead, v_cruise_setpoint): if CS.readdistancelines == 1: # If one bar distance, auto set to 2 bar distance under current conditions to prevent rear ending lead car if self.street_speed and (self.lead_car_gap_shrinking or self.tailgating): - TR=2.2 + TR=1.8 if self.lastTR != 0: - self.libmpc.init(MPC_COST_LONG.TTC, 0.075, MPC_COST_LONG.ACCELERATION, MPC_COST_LONG.JERK) + self.libmpc.init(MPC_COST_LONG.TTC, 0.1, MPC_COST_LONG.ACCELERATION, MPC_COST_LONG.JERK) self.lastTR = 0 else: TR=0.9 # 10m at 40km/hr