From 33784f77bc16d0ed00dc79c7bead37d6a3a59700 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 28 Jul 2025 14:27:00 -0700 Subject: [PATCH] fix borkenness --- selfdrive/selfdrived/selfdrived.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index 6628848ff7..8c2e58035f 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -59,11 +59,11 @@ def check_excessive_actuation(sm: messaging.SubMaster, CS: car.CarState, calibra roll_compensated_lateral_accel = (CS.vEgo * yaw_rate) - (math.sin(roll) * ACCELERATION_DUE_TO_GRAVITY) # livePose acceleration can be noisy due to bad mounting or aliased livePose measurements - accel_valid = abs(CS.aEgo - accel_calibrated) < 2 + livepose_valid = abs(CS.aEgo - accel_calibrated) < 2 - excessive_long_actuation = sm['carControl'].longActive and accel_valid and (accel_calibrated > ACCEL_MAX * 2 or accel_calibrated < ACCEL_MIN * 2) + excessive_long_actuation = sm['carControl'].longActive 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 + counter = counter + 1 if livepose_valid and (excessive_long_actuation or excessive_lat_actuation) else 0 return counter, counter > MIN_EXCESSIVE_ACTUATION_COUNT