Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve style in drive_helpers #23962

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve style in drive_helpers
GregorKikelj authored Mar 14, 2022
commit b24e901b887f3b52c1ae9f59876974f73dc652a3
8 changes: 4 additions & 4 deletions selfdrive/controls/lib/drive_helpers.py
Original file line number Diff line number Diff line change
@@ -61,7 +61,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:
@@ -98,9 +98,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