From 4b794773b0486a15732ce5551771584af7c41e43 Mon Sep 17 00:00:00 2001 From: Greg Hogan Date: Tue, 16 Jul 2024 18:24:01 -0700 Subject: [PATCH] use rounded constant instead of hard-coded value for incrementing set speed (#32992) * use rounded constant instead of hard-coded value for incrementing set speed * better comment --- selfdrive/controls/lib/drive_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py index cfc6374a1d1faf..bd74051374a384 100644 --- a/selfdrive/controls/lib/drive_helpers.py +++ b/selfdrive/controls/lib/drive_helpers.py @@ -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