Skip to content

Commit

Permalink
remove accel requirement for engage ACC in follow function
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-D committed Aug 29, 2018
1 parent ad84411 commit 8334032
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions selfdrive/car/tesla/ACC_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def calc_follow_button(self, CS):
rel_speed = self.lead_1.vRel * CV.MS_TO_KPH
# Current speed in kph
cur_speed = CS.v_ego * CV.MS_TO_KPH
# v_ego is in m/s, so safe_dist_mance is in meters.
# v_ego is in m/s, so safe_dist_m is in meters.
safe_dist_m = CS.v_ego * follow_time
# How much we can accelerate without exceeding the max allowed speed.
available_speed = self.acc_speed_kph - CS.v_cruise_actual
Expand All @@ -239,11 +239,10 @@ def calc_follow_button(self, CS):
### Logic to determine best cruise speed ###

# Automatically engange traditional cruise if it is idle and we are
# going fast enough and accelerating.
# going fast enough.
if (CS.pcm_acc_status == 1
and self.enable_adaptive_cruise
and CS.v_ego > self.MIN_CRUISE_SPEED_MS
and CS.a_ego > 0.12):
and CS.v_ego > self.MIN_CRUISE_SPEED_MS):
button = CruiseButtons.DECEL_SET
# If traditional cruise is engaged, then control it.
elif CS.pcm_acc_status == 2:
Expand Down

0 comments on commit 8334032

Please sign in to comment.