fix: speed limit rounding, controlsd crashes, modeld calibration rate
- Speed limit display uses round() instead of floor() to fix off-by-one - Initialize driving_gear in controlsd __init__ to prevent AttributeError - Fix gpsLocation capnp access (attribute style, not getter methods) - Fix sm.valid dict access (brackets not parentheses) - modeld runs full 20fps during calibration instead of throttled 4fps - Over-speed warning threshold below 50mph changed from 5 to 7 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -43,7 +43,7 @@ class SpeedState:
|
||||
unit = "mph"
|
||||
|
||||
speed_int = int(math.floor(speed_display))
|
||||
speed_limit_int = int(math.floor(speed_limit_display))
|
||||
speed_limit_int = int(round(speed_limit_display))
|
||||
cruise_int = int(round(cruise_display))
|
||||
|
||||
self.prev_speed_limit = speed_limit_int
|
||||
@@ -61,7 +61,7 @@ class SpeedState:
|
||||
cruise_engaged = cruise_active and not cruise_standstill
|
||||
|
||||
if speed_limit_int >= 20 and cruise_engaged and cruise_int > 0:
|
||||
over_threshold = 10 if speed_limit_int >= 50 else 5
|
||||
over_threshold = 10 if speed_limit_int >= 50 else 7
|
||||
if cruise_int >= speed_limit_int + over_threshold:
|
||||
warning = "over"
|
||||
warning_speed = str(cruise_int)
|
||||
|
||||
Reference in New Issue
Block a user