Skip to content

Commit

Permalink
1 bar and 2 bar tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonGalaxy75 authored Dec 17, 2018
1 parent 31bd6b3 commit 663ece1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions selfdrive/controls/lib/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ 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 < 9 or (x_lead < 17.5 and self.v_rel < 0.5):
if x_lead < 17.5 and self.v_rel < 0.5 and not CS.aEgo > 0.25:
self.tailgating = 1
else:
self.tailgating = 0
Expand All @@ -246,13 +246,13 @@ def update(self, CS, lead, v_cruise_setpoint):
else:
self.street_speed = 0

# Is the gap from the lead car shrinking?
if self.v_rel < -1:
# Is the gap from the lead car shrinking and car isn't accelerating?
if self.v_rel < -1 and and not CS.aEgo > 0.25:
self.lead_car_gap_shrinking = 1
else:
self.lead_car_gap_shrinking = 0

# Is the gap from the lead car shrinking FAST (or approaching a nearly stopped vehicle)?
# Is the gap from the lead car shrinking FAST and car isn't accelerating (or approaching a nearly stopped vehicle)?
if self.v_rel < -7.5:
self.lead_car_gap_shrinking_fast = 1
else:
Expand Down

0 comments on commit 663ece1

Please sign in to comment.