pull/35700/head
Shane Smiskol 3 weeks ago
parent 5d8c605717
commit 3a1df15404
  1. 6
      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

Loading…
Cancel
Save