|
|
|
@ -132,7 +132,7 @@ def apply_std_steer_angle_limits(apply_angle, apply_angle_last, v_ego, LIMITS): |
|
|
|
|
return clip(apply_angle, apply_angle_last - angle_rate_lim, apply_angle_last + angle_rate_lim) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def common_fault_avoidance(measured_value: float, max_value: float, request: bool, above_limit_frames: int, |
|
|
|
|
def common_fault_avoidance(fault_condition: bool, request: bool, above_limit_frames: int, |
|
|
|
|
max_above_limit_frames: int, max_mismatching_frames: int = 1): |
|
|
|
|
""" |
|
|
|
|
Several cars have the ability to work around their EPS limits by cutting the |
|
|
|
@ -140,7 +140,7 @@ def common_fault_avoidance(measured_value: float, max_value: float, request: boo |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
# Count up to max_above_limit_frames, at which point we need to cut the request for above_limit_frames to avoid a fault |
|
|
|
|
if request and abs(measured_value) >= max_value: |
|
|
|
|
if request and fault_condition: |
|
|
|
|
above_limit_frames += 1 |
|
|
|
|
else: |
|
|
|
|
above_limit_frames = 0 |
|
|
|
|