a better remote body teleoperation experience#37732
Conversation
…tream for better error finding
…webrtc negotiation for better error handling
… about being starved during cereal bridge + webrtc connection
UI Previewmici: |
61f7f7c to
4413ae6
Compare
| ssid = self._wifi_manager.connected_ssid | ||
| if ssid and len(ssid) > 20: | ||
| ssid = ssid[:17] + "..." | ||
| wifi_text = f"WiFi: {ssid}" if ssid else "wifi: not connected" | ||
| rl.draw_text_ex(self._font, wifi_text, rl.Vector2(label_x, y), 22, 0, MICI_TEXT_COLOR) |
There was a problem hiding this comment.
you can use a UnifiedLabel for automatic eliding (the ...) and positioning, and VBoxLayout to remove a bunch of code as well
| for _ in gui_app.render(): | ||
| pass |
There was a problem hiding this comment.
| for _ in gui_app.render(): | |
| pass | |
| gui_app.render() |
you can just do this now
There was a problem hiding this comment.
why is this all duplicated?
| # def _draw_flag_button(self, rect: rl.Rectangle): | ||
| # if not ui_state.started: | ||
| # return | ||
|
|
||
| # mouse_pos = rl.get_mouse_position() | ||
| # mouse_down = self.is_pressed and rl.is_mouse_button_down(rl.MouseButton.MOUSE_BUTTON_LEFT) | ||
|
|
||
| # btn_x = int(rect.x + rect.width - 100) | ||
| # btn_y = int(rect.y + 30) | ||
| # flag_rect = rl.Rectangle(btn_x, btn_y, 60, 60) | ||
| # flag_pressed = mouse_down and rl.check_collision_point_rec(mouse_pos, flag_rect) | ||
| # tint = Colors.BUTTON_PRESSED if flag_pressed else Colors.BUTTON_NORMAL | ||
| # rl.draw_texture(self._flag_img, btn_x, btn_y, tint) |
selfdrive/ui/layouts/main.py
Outdated
| self._layouts = {MainState.HOME: HomeLayout(), MainState.SETTINGS: SettingsLayout(), MainState.ONROAD: AugmentedRoadView()} | ||
| if self._is_body: | ||
| self._layouts = {MainState.HOME: BodyLayout(), MainState.SETTINGS: SettingsLayout(), MainState.ONROAD: BodyLayout()} | ||
| self._sidebar.set_visible(False) |
There was a problem hiding this comment.
you can just make the body side bar set itself not visible
| class _PairingBigButton(BigButton): | ||
| def _get_label_font_size(self): | ||
| return 64 | ||
|
|
||
|
|
||
| class MiciBodyPairingScreen(NavScroller): | ||
| """MICI pairing screen: NavScroller with BigButtons for each pairing method.""" | ||
|
|
||
| def __init__(self): | ||
| super().__init__() | ||
|
|
||
| self._wifi_manager = WifiManager() | ||
| self._wifi_manager.set_active(False) | ||
|
|
||
| self._connect_panel = OneTimeConnectPanel() | ||
| connect_btn = _PairingBigButton("connect", "", | ||
| gui_app.texture("icons_mici/settings/network/wifi_strength_full.png", 76, 56)) | ||
| connect_btn.set_click_callback(lambda: gui_app.push_widget(self._connect_panel)) | ||
|
|
||
| self._connect_btn = connect_btn | ||
| self._scroller.add_widgets([connect_btn]) |
There was a problem hiding this comment.
wait you have two pairing screens? I don't see this one when I click connet on home screen for mici
| self.color = color | ||
|
|
||
|
|
||
| class BodySidebar(Widget): |
There was a problem hiding this comment.
just subclass Sidebar and override render?
selfdrive/ui/layouts/main.py
Outdated
| if self._is_body: | ||
| self._layouts[MainState.HOME].set_click_callback(self._on_onroad_clicked) | ||
| self._layouts[MainState.ONROAD].set_click_callback(self._on_onroad_clicked) | ||
|
|
There was a problem hiding this comment.
This breaks tapping onroad for cars now! Why do we do this?
| # Body sidebar always starts closed; regular sidebar starts open | ||
| if not self._is_body: | ||
| self._sidebar.set_visible(True) |
There was a problem hiding this comment.
another splittable PR, if this was using the nav stack each sidebar could manage its own show event behavior ;)
| if self._is_body: # overlay sidebar but recompute boundaries for proper click events | ||
| parent_rect = rl.Rectangle(self._rect.x, self._rect.y + BODY_SIDEBAR_HEIGHT, | ||
| self._rect.width, self._rect.height - BODY_SIDEBAR_HEIGHT) if self._sidebar.is_visible else None | ||
| self._layouts[self._current_mode].set_parent_rect(parent_rect) | ||
| self._layouts[self._current_mode].render(self._rect) | ||
| if self._sidebar.is_visible: | ||
| self._sidebar.render(self._sidebar_rect) | ||
| else: | ||
| if self._sidebar.is_visible: | ||
| self._sidebar.render(self._sidebar_rect) | ||
| content_rect = self._content_rect if self._sidebar.is_visible else self._rect | ||
| self._layouts[self._current_mode].render(content_rect) |
There was a problem hiding this comment.
two
if self._sidebar.is_visible:
self._sidebar.render(self._sidebar_rect)
|
failing static analysis test too, make sure it's all in a final state, i.e. something you're happy with merging now |
|
for the generic nav stack touch valid fix, I think we first need to fix the different use of enabled and touch_valid. can do that one later @stefpi |
f8a23d3 to
71a2950
Compare
71a2950 to
23e38f7
Compare
changes
layouts
webrtcd
soundd
/streamon webrtc and then post a message on cereal, which is then picked up by the sound daemon and then that alert sound is queued up to be playedathena
debug
process manager
other
Related PRs that this PR depends on: