Skip to content

Commit

Permalink
fix follow accel bug and start cruise bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-D committed Aug 30, 2018
1 parent 8334032 commit c23bf6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions selfdrive/car/tesla/ACC_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def calc_follow_button(self, CS):
# if cruise is set to faster than the max speed, slow down
if CS.v_cruise_actual > self.acc_speed_kph:
msg = "Slow to max"
button = CruiseButtons.DECEL_SET
button = CruiseButtons.RES_ACCEL
# If lead_dist is reported as 0, no one is detected in front of you so you
# can speed up don't speed up when steer-angle > 2; vision radar often
# loses lead car in a turn.
Expand Down Expand Up @@ -291,7 +291,7 @@ def calc_follow_button(self, CS):
### Speed up ###
# don't speed up again until you have more than a safe distance in front
# only adjust every 2 sec
elif ((lead_dist > (safe_dist_m * 0.8) or rel_speed > 5) and half_press_kph < available_speed
if ((lead_dist > (safe_dist_m * 0.8) or rel_speed > 5) and half_press_kph < available_speed
and current_time_ms > self.automated_cruise_action_time + 100):
msg = "120pct UP half: ","{0:.1f}kph".format(half_press_kph), " avail: {0:.1f}kph".format(available_speed)
button = CruiseButtons.RES_ACCEL
Expand Down

0 comments on commit c23bf6a

Please sign in to comment.