|
|
@ -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 |
|
|
|
# livePose acceleration can be noisy due to bad mounting or aliased livePose measurements |
|
|
|
accel_valid = abs(CS.aEgo - accel_calibrated) < 2 |
|
|
|
accel_valid = abs(CS.aEgo - accel_calibrated) < 2 |
|
|
|
|
|
|
|
|
|
|
|
excessive_actuation = (accel_calibrated > ACCEL_MAX * 2 or accel_calibrated < ACCEL_MIN * 2 or |
|
|
|
excessive_long_actuation = sm['carControl'].longActive and accel_valid and (accel_calibrated > ACCEL_MAX * 2 or accel_calibrated < ACCEL_MIN * 2) |
|
|
|
abs(roll_compensated_lateral_accel) > ISO_LATERAL_ACCEL * 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_actuation and accel_valid else 0 |
|
|
|
counter = counter + 1 if sm['carControl'].longActive and (excessive_long_actuation or excessive_lat_actuation) else 0 |
|
|
|
|
|
|
|
|
|
|
|
return counter, counter > MIN_EXCESSIVE_ACTUATION_COUNT |
|
|
|
return counter, counter > MIN_EXCESSIVE_ACTUATION_COUNT |
|
|
|
|
|
|
|
|
|
|
|