Skip to content

Commit

Permalink
Prevent runaway acceleration
Browse files Browse the repository at this point in the history
  • Loading branch information
David Abrahams committed Aug 30, 2018
1 parent 47b66fc commit d4fef82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion selfdrive/car/tesla/ACC_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ def calc_op_button(self, CS, pcm_speed, current_time_ms):
return button_to_press

def should_autoengage_cc(self, CS, current_time_ms):
# In auto-resume mode, we must not to engage during deceleration other than
# during the first moment after ACC was engaged.
autoresume_supressed_by_braking = (
self.autoresume
and CS.a_ego < 0
Expand Down Expand Up @@ -267,7 +269,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.RES_ACCEL
button = CruiseButtons.DECEL_SET
# 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

0 comments on commit d4fef82

Please sign in to comment.