IQ.Pilot Release Commit @ 2f37564

This commit is contained in:
IQ.Lvbs CI [bot]
2026-07-27 01:30:19 -05:00
parent 6a4096e52e
commit 15c14e1369
236 changed files with 2475 additions and 990 deletions

View File

@@ -200,7 +200,7 @@ class TrainingGuideDMTutorial(Widget):
looking_center = False
# stay at 100% once reached
if (dm_state.faceDetected and looking_center) or self._progress.x > 0.99:
if (dm_state.visionPolicyState.faceDetected and looking_center) or self._progress.x > 0.99:
slow = self._progress.x < 0.25
duration = self.PROGRESS_DURATION * 2 if slow else self.PROGRESS_DURATION
self._progress.x += 1.0 / (duration * gui_app.target_fps)

View File

@@ -27,7 +27,7 @@ class DisplayLayoutMici(NavScroller):
self._force_mici = BigParamControl("force mici UI", "ForceSmallUI")
self._display_bright = MappedParamToggle("display brightness", "Brightness",
_DISPLAY_BRIGHT_OPTIONS, _DISPLAY_BRIGHT_VALUES)
self._onroad_bright = MappedParamToggle("onroad brightness", "OnroadScreenOffBrightness",
self._onroad_bright = MappedParamToggle("driving brightness", "OnroadScreenOffBrightness",
_ONROAD_BRIGHT_OPTIONS, _ONROAD_BRIGHT_VALUES)
self._delay = MappedParamToggle("brightness delay", "OnroadScreenOffTimer",
_DELAY_OPTIONS, _DELAY_VALUES)

View File

@@ -10,7 +10,7 @@ import pyray as rl
from cereal import custom
from openpilot.system.ui.iqpilot.widgets.helpers.glyphs import draw_star
from openpilot.system.ui.iqwidgets.widgets.helpers.glyphs import draw_star
from openpilot.selfdrive.ui.ui_state import ui_state
from openpilot.system.ui.lib.application import gui_app
@@ -96,10 +96,10 @@ class ModelsLayoutMici(NavScroller):
self._redownload_icon = gui_app.texture("icons_mici/settings/device/update.png", 56, 56, keep_aspect_ratio=True)
self._reset_icon = gui_app.texture("icons_mici/wheel.png", 56, 56)
self._current = BigButton("current model")
self._current = BigButton("active model")
self._current.set_click_callback(self._show_folders)
self._cancel = BigButton("cancel download")
self._cancel = BigButton("stop download")
self._cancel.set_click_callback(self._cancel_model_request)
self._cancel.set_visible(self._is_downloading)
@@ -107,17 +107,17 @@ class ModelsLayoutMici(NavScroller):
self._redownload.set_click_callback(self._confirm_redownload_model)
self._redownload.set_enabled(self._can_redownload)
self._refresh = BigButton("refresh model list")
self._refresh = BigButton("reload model list")
self._refresh.set_click_callback(lambda: ui_state.params.put("ModelManager_LastSyncTime", 0))
self._supercombo = GreyBigButton("driving model")
self._supercombo = GreyBigButton("combined model")
self._supercombo.set_visible(False)
self._vision = GreyBigButton("vision model")
self._vision = GreyBigButton("vision weights")
self._vision.set_visible(False)
self._policy = GreyBigButton("policy model")
self._policy = GreyBigButton("policy weights")
self._policy.set_visible(False)
self._clear = BigButton("clear model cache")
self._clear = BigButton("purge model cache")
self._clear.set_click_callback(self._confirm_clear_cache)
self._clear.set_enabled(lambda: ui_state.is_offroad())
@@ -125,7 +125,7 @@ class ModelsLayoutMici(NavScroller):
self._sw_delay = MappedParamToggle("manual delay offset", "IQSoftwareSteerDelay", _DELAY_OPTIONS, _DELAY_VALUES)
self._sw_delay.set_visible(lambda: not self._steer_delay._checked)
self._lane_turn = BigParamControl("use lane turn desires", "IQLaneTurnDesire")
self._lane_turn = BigParamControl("low-speed turn planning", "IQLaneTurnDesire")
self._lane_speed = MappedParamToggle("lane turn speed", "IQLaneTurnValue", _LANE_TURN_OPTIONS, _LANE_TURN_VALUES)
self._lane_speed.set_visible(lambda: self._lane_turn._checked)

View File

@@ -99,6 +99,32 @@ class ForgetButton(Widget):
rl.draw_texture_ex(self._trash_txt, (trash_x, trash_y), 0, 1.0, rl.WHITE)
class DisconnectButton(Widget):
MARGIN = 12
RADIUS = 42
# the only round button art is the destructive red one, and dropping a connection is not destructive
BG = rl.Color(56, 56, 61, 255)
BG_PRESSED = rl.Color(84, 84, 90, 255)
def __init__(self, disconnect_network: Callable):
super().__init__()
self._disconnect_network = disconnect_network
self._slash_txt = gui_app.texture("icons_mici/settings/network/wifi_strength_slash.png", 38, 38)
self.set_rect(rl.Rectangle(0, 0, 84 + self.MARGIN * 2, 84 + self.MARGIN * 2))
def _handle_mouse_release(self, mouse_pos: MousePos):
super()._handle_mouse_release(mouse_pos)
dlg = BigConfirmationDialog("slide to\ndisconnect", gui_app.texture("icons_mici/settings/network/wifi_strength_slash.png", 54, 54),
self._disconnect_network)
gui_app.push_widget(dlg)
def _render(self, _):
center = rl.Vector2(self._rect.x + self._rect.width / 2, self._rect.y + self._rect.height / 2)
rl.draw_circle_v(center, self.RADIUS, self.BG_PRESSED if self.is_pressed else self.BG)
rl.draw_texture_ex(self._slash_txt, (center.x - self._slash_txt.width / 2, center.y - self._slash_txt.height / 2),
0, 1.0, rl.WHITE)
class WifiButton(BigButton):
LABEL_PADDING = 98
LABEL_WIDTH = 402 - 98 - 28
@@ -111,9 +137,11 @@ class WifiButton(BigButton):
self._connecting_ssid = connecting_ssid
self._wifi_icon = WifiIcon(network)
self._forget_btn = ForgetButton(self._forget_network)
self._disconnect_btn = DisconnectButton(self._disconnect_network)
self._check_txt = gui_app.texture("icons_mici/setup/driver_monitoring/dm_check.png", 32, 32)
self._network_missing = False
self._network_forgetting = False
self._network_disconnecting = False
self._wrong_password = False
@property
@@ -142,9 +170,18 @@ class WifiButton(BigButton):
self._network_forgetting = True
self._wifi_manager.forget_connection(self._network.ssid)
def _disconnect_network(self):
if self._network_disconnecting:
return
self._network_disconnecting = True
self._wifi_manager.disconnect_connection(self._network.ssid)
def on_forgotten(self):
self._network_forgetting = False
def on_disconnected(self):
self._network_disconnecting = False
def set_network_missing(self, missing: bool):
self._network_missing = missing
self._wifi_icon.set_network_missing(missing)
@@ -171,31 +208,44 @@ class WifiButton(BigButton):
@property
def _show_forget_btn(self) -> bool:
if self._is_tethering or self._network_forgetting:
if self._is_tethering or self._network_forgetting or self._show_disconnect_btn:
return False
return (self._is_saved and not self._wrong_password) or self._is_connecting
@property
def _show_disconnect_btn(self) -> bool:
# 402 units of row cannot hold both buttons plus the status word, so the slot is contextual:
# disconnect while connected, forget once it is only saved
if self._is_tethering or self._network_forgetting or self._network_disconnecting:
return False
return self._is_connected
def _handle_mouse_release(self, mouse_pos: MousePos):
if self._show_forget_btn and rl.check_collision_point_rec(mouse_pos, self._forget_btn.rect):
return
if self._show_disconnect_btn and rl.check_collision_point_rec(mouse_pos, self._disconnect_btn.rect):
return
super()._handle_mouse_release(mouse_pos)
def _get_label_font_size(self):
return 48
def set_touch_valid_callback(self, touch_callback: Callable[[], bool]) -> None:
super().set_touch_valid_callback(lambda: touch_callback() and not self._forget_btn.is_pressed)
super().set_touch_valid_callback(lambda: touch_callback() and not self._forget_btn.is_pressed and not self._disconnect_btn.is_pressed)
self._forget_btn.set_touch_valid_callback(touch_callback)
self._disconnect_btn.set_touch_valid_callback(touch_callback)
def _update_state(self):
super()._update_state()
if any((self._network_missing, self._is_connecting, self._is_connected, self._network_forgetting,
self._network.security_type == SecurityType.UNSUPPORTED)):
self._network_disconnecting, self._network.security_type == SecurityType.UNSUPPORTED)):
self.set_enabled(False)
self._sub_label.set_color(rl.Color(255, 255, 255, int(255 * 0.585)))
self._sub_label.set_font_weight(FontWeight.ROMAN)
if self._network_forgetting:
self.set_value("forgetting...")
elif self._network_disconnecting:
self.set_value("disconnecting...")
elif self._is_connecting:
self.set_value("starting..." if self._is_tethering else "connecting...")
elif self._is_connected:
@@ -219,9 +269,10 @@ class WifiButton(BigButton):
if self.value:
sub_label_x = self._rect.x + self.LABEL_HORIZONTAL_PADDING
label_y = btn_y + self._rect.height - self.LABEL_VERTICAL_PADDING
sub_label_w = self.SUB_LABEL_WIDTH - (self._forget_btn.rect.width if self._show_forget_btn else 0)
sub_label_w = self.SUB_LABEL_WIDTH - (self._forget_btn.rect.width if self._show_forget_btn else 0) \
- (self._disconnect_btn.rect.width if self._show_disconnect_btn else 0)
sub_label_height = self._sub_label.get_content_height(sub_label_w)
if self._is_connected and not self._network_forgetting:
if self._is_connected and not self._network_forgetting and not self._network_disconnecting:
check_y = int(label_y - sub_label_height + (sub_label_height - self._check_txt.height) / 2)
rl.draw_texture_ex(self._check_txt, rl.Vector2(sub_label_x, check_y), 0.0, 1.0, rl.Color(255, 255, 255, int(255 * 0.9 * 0.65)))
sub_label_x += self._check_txt.width + 14
@@ -230,11 +281,19 @@ class WifiButton(BigButton):
self._wifi_icon.render(rl.Rectangle(self._rect.x + 30, btn_y + 30, self._wifi_icon.rect.width, self._wifi_icon.rect.height))
btn_right = self._rect.x + self._rect.width
if self._show_forget_btn:
self._forget_btn.render(rl.Rectangle(
self._rect.x + self._rect.width - self._forget_btn.rect.width,
btn_right - self._forget_btn.rect.width,
btn_y + self._rect.height - self._forget_btn.rect.height,
self._forget_btn.rect.width, self._forget_btn.rect.height))
btn_right -= self._forget_btn.rect.width
if self._show_disconnect_btn:
self._disconnect_btn.render(rl.Rectangle(
btn_right - self._disconnect_btn.rect.width,
btn_y + self._rect.height - self._disconnect_btn.rect.height,
self._disconnect_btn.rect.width, self._disconnect_btn.rect.height))
class ScanningButton(BigButton):
@@ -298,6 +357,9 @@ class WifiUIMici(NavScroller):
def _on_disconnected(self):
self._connecting = None
for btn in self._scroller.items:
if isinstance(btn, WifiButton):
btn.on_disconnected()
def _on_forgotten(self, ssid=None):
self._connecting = None

View File

@@ -47,7 +47,7 @@ class SabSettingsPanel(NavScroller):
self._main_cruise = BigParamControl("Availability While Cruise Changes", "AolMainCruiseAllowed")
self._brake = SabBrakeToggle()
self._mode = MappedParamToggle("Brake Response Mode", "AolSteeringMode",
["remain active", "standby", "disengage"], [0, 1, 2])
["stay engaged", "standby", "disengage"], [0, 1, 2])
self._scroller.add_widgets([self._main_cruise, self._brake, self._mode])
def show_event(self):
@@ -67,7 +67,7 @@ class LaneChangePanel(NavScroller):
def __init__(self):
super().__init__()
self._timer = MappedParamToggle("Auto Lane Change", "IQLaneChangeTimer",
["off", "nudge", "nudgeless", "0.5 s", "1 s", "2 s", "3 s"],
["off", "nudge", "no nudge", "0.5 s", "1 s", "2 s", "3 s"],
[-1, 0, 1, 2, 3, 4, 5])
self._bsm_delay = BigParamControl("Delay with Blind Spot", "IQLaneChangeBsmDelay")
self._continuous = BigParamControl("Continuous Changes", "LaneChangeContinuous")
@@ -87,7 +87,7 @@ class LaneChangePanel(NavScroller):
class SteeringLayoutMici(NavScroller):
_AOL_MODES = ["remain active", "standby", "disengage"]
_AOL_MODES = ["stay engaged", "standby", "disengage"]
def __init__(self):
super().__init__()

View File

@@ -73,7 +73,7 @@ class VehicleLayoutMici(NavScroller):
toggle_callback=self._on_toyota_long)
self._hyundai_tuning = MappedParamToggle("hyundai long. tuning", "HyundaiLongitudinalTuning",
["off", "dynamic", "predictive"], [0, 1, 2])
self._subaru_snag = BigParamControl("stop and go (beta)", "SubaruStopAndGo")
self._subaru_snag = BigParamControl("creep from standstill (beta)", "SubaruStopAndGo")
self._subaru_manual = BigParamControl("stop and go manual brake", "SubaruStopAndGoManualParkingBrake")
self._vw_pq_hca = BigParamControl("PQ HCA status 7 mode", "pqhca5or7Toggle")
self._vw_lateral = BigParamControl("lateral when cruise faulted", "AllowLateralWhenLongUnavailable")

View File

@@ -10,7 +10,7 @@ class VisualsLayoutMici(NavScroller):
def __init__(self):
super().__init__()
self._blind_spot = BigParamControl("Blind Spot Warnings", "BlindSpot")
self._steering_arc = BigParamControl("Steering Arc", "TorqueBar")
self._steering_arc = BigParamControl("Steering Effort Arc", "TorqueBar")
self._road_name = BigParamControl("Road Name", "RoadNameToggle")
self._turn_signals = BigParamControl("Turn Signals", "ShowTurnSignals")
self._accel_bar = BigParamControl("Acceleration Bar", "RocketFuel")