IQ.Pilot Release Commit @ ba009d5
This commit is contained in:
@@ -552,7 +552,8 @@ class ModelsLayoutMici(NavScroller):
|
||||
def _update_steer_delay_subtext(self):
|
||||
if self._steer_delay._checked:
|
||||
try:
|
||||
self._steer_delay.set_value(f"measured {ui_state.sm['lateralDelay'].lateralDelay:.3f} s")
|
||||
measured = ui_state.measured_steer_delay()
|
||||
self._steer_delay.set_value("calibrating" if measured is None else f"measured {measured:.3f} s")
|
||||
except Exception:
|
||||
self._steer_delay.set_value("")
|
||||
return
|
||||
|
||||
@@ -54,7 +54,9 @@ MICI_BORDER_THICKNESS = 50
|
||||
MICI_BORDER_ROUNDNESS = 0.2 * 1.02
|
||||
MICI_BORDER_BOTTOM_ONLY_HEIGHT = 95
|
||||
MICI_EXPERIMENTAL_ICON_SIZE = 28
|
||||
MICI_EXPERIMENTAL_ICON_SPACING = 8
|
||||
MICI_EXPERIMENTAL_ICON_SLOT = 60
|
||||
MICI_EXPERIMENTAL_ICON_MARGIN_X = 16
|
||||
MICI_EXPERIMENTAL_ICON_MARGIN_Y = 10
|
||||
|
||||
|
||||
class BookmarkIcon(Widget):
|
||||
@@ -274,7 +276,7 @@ class AugmentedRoadView(CameraView):
|
||||
# don't draw the experimental/IQ.Dynamic icon over alert text (it falls back to the
|
||||
# top-left alert anchor when the DMoji is hidden while disengaged)
|
||||
if alert_to_render is None:
|
||||
self._draw_experimental_icon(should_draw_dmoji)
|
||||
self._draw_experimental_icon()
|
||||
|
||||
# End clipping region
|
||||
rl.end_scissor_mode()
|
||||
@@ -304,7 +306,7 @@ class AugmentedRoadView(CameraView):
|
||||
rl.draw_rectangle(int(self.rect.x), int(self.rect.y), int(self.rect.width), int(self.rect.height), rl.Color(0, 0, 0, 175))
|
||||
self._offroad_label.render(self._content_rect)
|
||||
|
||||
def _draw_experimental_icon(self, draw_below_driver_state: bool) -> None:
|
||||
def _draw_experimental_icon(self) -> None:
|
||||
if not ui_state.started:
|
||||
return
|
||||
|
||||
@@ -316,13 +318,10 @@ class AugmentedRoadView(CameraView):
|
||||
else:
|
||||
icon = self._iqstandard_txt
|
||||
|
||||
if draw_below_driver_state:
|
||||
pos_x = self._rect.x + 16 + (self._driver_state_renderer.rect.width - icon.width) / 2
|
||||
pos_y = self._rect.y + 10 + self._driver_state_renderer.rect.height + MICI_EXPERIMENTAL_ICON_SPACING
|
||||
else:
|
||||
pos_x = self._rect.x + 18
|
||||
pos_y = self._rect.y + 18
|
||||
|
||||
slot_x = self._content_rect.x + self._content_rect.width - MICI_EXPERIMENTAL_ICON_MARGIN_X - MICI_EXPERIMENTAL_ICON_SLOT
|
||||
slot_y = self._content_rect.y + MICI_EXPERIMENTAL_ICON_MARGIN_Y
|
||||
pos_x = slot_x + (MICI_EXPERIMENTAL_ICON_SLOT - icon.width) / 2
|
||||
pos_y = slot_y + (MICI_EXPERIMENTAL_ICON_SLOT - icon.height) / 2
|
||||
rl.draw_texture(icon, int(pos_x), int(pos_y), rl.WHITE)
|
||||
|
||||
def _draw_border(self):
|
||||
|
||||
@@ -14,6 +14,7 @@ from iqpilot.selfdrive.ui.mici.onroad import blend_colors
|
||||
from iqpilot.system.ui.lib.application import gui_app
|
||||
from iqpilot.system.ui.lib.shader_polygon import draw_polygon, Gradient
|
||||
from iqpilot.system.ui.widgets import Widget
|
||||
from iqpilot.ui.theme import NeonTheme
|
||||
|
||||
CLIP_MARGIN = 500
|
||||
MIN_DRAW_DISTANCE = 10.0
|
||||
@@ -297,7 +298,10 @@ class ModelRenderer(Widget):
|
||||
def _get_ll_color(self, prob: float, adjacent: bool, left: bool):
|
||||
alpha = np.clip(prob, 0.0, 0.7)
|
||||
if adjacent:
|
||||
_base_color = LANE_LINE_COLORS.get(ui_state.status, LANE_LINE_COLORS[UIStatus.DISENGAGED])
|
||||
if gui_app.iqpilot_ui() and ui_state.status == UIStatus.ENGAGED:
|
||||
_base_color = NeonTheme.glow()
|
||||
else:
|
||||
_base_color = LANE_LINE_COLORS.get(ui_state.status, LANE_LINE_COLORS[UIStatus.DISENGAGED])
|
||||
color = rl.Color(_base_color.r, _base_color.g, _base_color.b, int(alpha * 255))
|
||||
|
||||
# turn adjacent lls orange if torque is high
|
||||
|
||||
@@ -424,6 +424,13 @@ class UIState(IQUIState):
|
||||
|
||||
self._started_prev = self.started
|
||||
|
||||
def measured_steer_delay(self) -> float | None:
|
||||
# estimatord is onroad-only, so offroad the lateralDelay socket reads back a default 0.0
|
||||
if self.sm.alive['lateralDelay']:
|
||||
return float(self.sm['lateralDelay'].lateralDelay)
|
||||
lag = log_param_from_bytes(self.params, "LiveDelay", log.Event)
|
||||
return float(lag.lateralDelay.lateralDelay) if lag is not None else None
|
||||
|
||||
def update_params(self) -> None:
|
||||
CP = log_param_from_bytes(self.params, "CarParamsPersistent", car.CarParams)
|
||||
if CP is not None:
|
||||
|
||||
Reference in New Issue
Block a user