Improve style in drive_helpers (#23962)

pull/23967/head
Gregor Kikelj 2022-03-14 22:03:28 +01:00 committed by GitHub
parent f1aab78d08
commit 08c2d066cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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