diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index fa2da2c237..6628848ff7 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -61,9 +61,9 @@ def check_excessive_actuation(sm: messaging.SubMaster, CS: car.CarState, calibra # livePose acceleration can be noisy due to bad mounting or aliased livePose measurements accel_valid = abs(CS.aEgo - accel_calibrated) < 2 - excessive_actuation = (accel_calibrated > ACCEL_MAX * 2 or accel_calibrated < ACCEL_MIN * 2 or - abs(roll_compensated_lateral_accel) > ISO_LATERAL_ACCEL * 2) - counter = counter + 1 if sm['carControl'].longActive and excessive_actuation and accel_valid else 0 + excessive_long_actuation = sm['carControl'].longActive and accel_valid and (accel_calibrated > ACCEL_MAX * 2 or accel_calibrated < ACCEL_MIN * 2) + excessive_lat_actuation = sm['carControl'].latActive and abs(roll_compensated_lateral_accel) > ISO_LATERAL_ACCEL * 2 + counter = counter + 1 if sm['carControl'].longActive and (excessive_long_actuation or excessive_lat_actuation) else 0 return counter, counter > MIN_EXCESSIVE_ACTUATION_COUNT