Skip to content

Commit

Permalink
use rounded constant instead of hard-coded value for incrementing set…
Browse files Browse the repository at this point in the history
… speed (commaai#32992)

* use rounded constant instead of hard-coded value for incrementing set speed

* better comment
  • Loading branch information
gregjhogan authored Jul 17, 2024
1 parent aa84840 commit 4b79477
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/drive_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
V_CRUISE_UNSET = 255
V_CRUISE_INITIAL = 40
V_CRUISE_INITIAL_EXPERIMENTAL_MODE = 105
IMPERIAL_INCREMENT = 1.6 # should be CV.MPH_TO_KPH, but this causes rounding errors
IMPERIAL_INCREMENT = round(CV.MPH_TO_KPH, 1) # round here to avoid rounding errors incrementing set speed

MIN_SPEED = 1.0
CONTROL_N = 17
Expand Down

0 comments on commit 4b79477

Please sign in to comment.