mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-27 13:03:42 +08:00
test: add tici onroad navigation panel
This commit is contained in:
@@ -10,7 +10,7 @@ from openpilot.selfdrive.ui.mici.onroad.driver_state import DriverStateRenderer
|
||||
from openpilot.selfdrive.ui.mici.onroad.hud_renderer import HudRenderer
|
||||
from openpilot.selfdrive.ui.mici.onroad.long_indicator import LongIndicator
|
||||
from openpilot.selfdrive.ui.mici.onroad.model_renderer import ModelRenderer
|
||||
from openpilot.selfdrive.ui.mici.onroad.navigation import NavigationPanel, PANEL_WIDTH
|
||||
from openpilot.selfdrive.ui.onroad.navigation import NavigationPanel, PANEL_WIDTH
|
||||
from openpilot.selfdrive.ui.mici.onroad.confidence_ball import ConfidenceBall
|
||||
from openpilot.selfdrive.ui.mici.onroad.cameraview import CameraView
|
||||
from openpilot.system.ui.lib.application import FontWeight, gui_app, MousePos, MouseEvent, TextAlignment, TextAlignmentVertical
|
||||
|
||||
@@ -9,6 +9,7 @@ from openpilot.selfdrive.ui.onroad.driver_state import DriverStateRenderer
|
||||
from openpilot.selfdrive.ui.onroad.hud_renderer import HudRenderer
|
||||
from openpilot.selfdrive.ui.onroad.model_renderer import ModelRenderer
|
||||
from openpilot.selfdrive.ui.onroad.cameraview import CameraView
|
||||
from openpilot.selfdrive.ui.onroad.navigation import NavigationPanel
|
||||
from openpilot.system.ui.lib.application import gui_app
|
||||
from openpilot.common.transformations.camera import DEVICE_CAMERAS, DeviceCameraConfig, view_frame_from_device_frame
|
||||
from openpilot.common.transformations.orientation import rot_from_euler
|
||||
@@ -56,6 +57,7 @@ class AugmentedRoadView(CameraView, AugmentedRoadViewSP):
|
||||
self._hud_renderer = HudRenderer()
|
||||
self.alert_renderer = AlertRenderer()
|
||||
self.driver_state_renderer = DriverStateRenderer()
|
||||
self.navigation_panel = NavigationPanel()
|
||||
|
||||
def _render(self, rect):
|
||||
# Only render when system is started to avoid invalid data access
|
||||
@@ -91,6 +93,15 @@ class AugmentedRoadView(CameraView, AugmentedRoadViewSP):
|
||||
self.model_renderer.render(self._content_rect)
|
||||
AugmentedRoadViewSP.update_fade_out_bottom_overlay(self, self._content_rect)
|
||||
self._hud_renderer.render(self._content_rect)
|
||||
if ui_state.navigation_enabled and ui_state.nav_destination_set:
|
||||
panel_width = min(380.0, self._content_rect.width * 0.32)
|
||||
panel_height = min(620.0, self._content_rect.height * 0.70)
|
||||
self.navigation_panel.render(rl.Rectangle(
|
||||
self._content_rect.x + self._content_rect.width - panel_width - 24,
|
||||
self._content_rect.y + (self._content_rect.height - panel_height) / 2,
|
||||
panel_width,
|
||||
panel_height,
|
||||
))
|
||||
self.alert_renderer.render(self._content_rect)
|
||||
self.driver_state_renderer.render(self._content_rect)
|
||||
|
||||
|
||||
+1
-1
@@ -6,13 +6,13 @@ from openpilot.cereal.visionipc import VisionStreamType
|
||||
from openpilot.common.constants import CV
|
||||
from openpilot.selfdrive.navigation.helpers import latest_gps_source
|
||||
from openpilot.selfdrive.navigation.renderer import EGO, ROUTE_INTENSITY, SIZE
|
||||
from openpilot.selfdrive.ui.mici.onroad.cameraview import CONNECTION_RETRY_INTERVAL
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state
|
||||
from openpilot.system.ui.lib.application import FontWeight, TextAlignmentVertical
|
||||
from openpilot.system.ui.widgets import Widget
|
||||
from openpilot.system.ui.widgets.label import UnifiedLabel, gui_label
|
||||
|
||||
PANEL_WIDTH = 261
|
||||
CONNECTION_RETRY_INTERVAL = 1.0
|
||||
STALE_SECONDS = 3
|
||||
MARKER_MARGIN = 18 # pixels kept below the ego so its marker stays visible
|
||||
|
||||
Reference in New Issue
Block a user