diff --git a/openpilot/selfdrive/ui/sunnypilot/mici/onroad/blendful.py b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/blendful.py index 10d8c9c9b4..02cb8883de 100644 --- a/openpilot/selfdrive/ui/sunnypilot/mici/onroad/blendful.py +++ b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/blendful.py @@ -11,12 +11,13 @@ import pyray as rl from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.ui.ui_state import ui_state -from openpilot.sunnypilot.modeld_v2.blendful import LANE_WIDTH_CLIP, LOOKAHEAD_TIME, MIN_LOOKAHEAD, MAX_ERROR +from openpilot.sunnypilot.modeld_v2.blendful import LANE_WIDTH_CLIP, LOOKAHEAD_TIME, MIN_LOOKAHEAD from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.shader_polygon import draw_polygon from openpilot.system.ui.lib.text_measure import measure_text_cached BLENDFUL_COLOR = (0, 200, 255) +FULL_BAR = 1.0 class BlendfulRenderer: @@ -86,7 +87,7 @@ class BlendfulRenderer: bar = rl.Rectangle(x + 24, y + h - 16, w - 48, 6) rl.draw_rectangle_rounded(bar, 1.0, 6, self._color((255, 255, 255), 40)) rl.draw_rectangle(int(cx - 1), int(bar.y - 2), 2, int(bar.height + 4), self._color((255, 255, 255), 120)) - fill = bar.width / 2 * float(np.sqrt(np.clip(abs(pull) / MAX_ERROR, 0.0, 1.0))) + fill = bar.width / 2 * float(np.sqrt(np.clip(abs(pull) / FULL_BAR, 0.0, 1.0))) if fill > 1: fill_x = cx if pull > 0 else cx - fill rl.draw_rectangle_rounded(rl.Rectangle(fill_x, bar.y, fill, bar.height), 1.0, 6, diff --git a/openpilot/sunnypilot/modeld_v2/blendful.py b/openpilot/sunnypilot/modeld_v2/blendful.py index 90783d3e3d..3f7a0a94b1 100644 --- a/openpilot/sunnypilot/modeld_v2/blendful.py +++ b/openpilot/sunnypilot/modeld_v2/blendful.py @@ -17,7 +17,6 @@ MIN_LOOKAHEAD = 10.0 # m MIN_SPEED = 5.0 # m/s LINE_STD = (0.2, 0.6) POINT_STD = 0.1 -MAX_ERROR = 1.0 YIELD = (0.2, 0.45) X_IDXS = np.array(ModelConstants.X_IDXS)