|
|
|
@ -54,7 +54,7 @@ def update_v_cruise(v_cruise_kph, buttonEvents, button_timers, enabled, metric): |
|
|
|
|
long_press = False |
|
|
|
|
button_type = None |
|
|
|
|
|
|
|
|
|
v_cruise_delta = 1 if metric else 1.6 |
|
|
|
|
v_cruise_delta = 1. if metric else CV.MPH_TO_KPH |
|
|
|
|
|
|
|
|
|
for b in buttonEvents: |
|
|
|
|
if b.type.raw in button_timers and not b.pressed: |
|
|
|
@ -91,9 +91,9 @@ def initialize_v_cruise(v_ego, buttonEvents, v_cruise_last): |
|
|
|
|
|
|
|
|
|
def get_lag_adjusted_curvature(CP, v_ego, psis, curvatures, curvature_rates): |
|
|
|
|
if len(psis) != CONTROL_N: |
|
|
|
|
psis = [0.0 for i in range(CONTROL_N)] |
|
|
|
|
curvatures = [0.0 for i in range(CONTROL_N)] |
|
|
|
|
curvature_rates = [0.0 for i in range(CONTROL_N)] |
|
|
|
|
psis = [0.0]*CONTROL_N |
|
|
|
|
curvatures = [0.0]*CONTROL_N |
|
|
|
|
curvature_rates = [0.0]*CONTROL_N |
|
|
|
|
|
|
|
|
|
# TODO this needs more thought, use .2s extra for now to estimate other delays |
|
|
|
|
delay = CP.steerActuatorDelay + .2 |
|
|
|
|