Skip to content

Commit d359f70

Browse files
author
David Abrahams
committed
ACC: Don't autoresume if there is a slow car in front
1 parent e5c1762 commit d359f70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

selfdrive/car/tesla/ACC_module.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,16 @@ def _should_autoengage_cc(self, CS, lead_car=None):
284284
and CS.pcm_acc_status == 1
285285
and CS.v_ego >= self.MIN_CRUISE_SPEED_MS
286286
and _current_time_millis() > self.fast_decel_time + 2000)
287+
288+
no_slow_lead = not lead_car or lead_car.vRel >= 0
287289

288290
# "Autoresume" mode allows cruise to engage even after brake events, but
289291
# shouldn't trigger DURING braking.
290292
autoresume_ready = self.autoresume and CS.a_ego >= 0.1
291293

292294
braked = self.user_has_braked or self.has_gone_below_min_speed
293295

294-
return cruise_ready and (autoresume_ready or not braked)
296+
return cruise_ready and no_slow_lead and (autoresume_ready or not braked)
295297

296298
def _fast_decel_required(self, CS, lead_car):
297299
""" Identifies situations which call for rapid deceleration. """

0 commit comments

Comments
 (0)