forked from IQ.Lvbs/IQ.Pilot
IQ.Pilot Release Commit @ 0798119
This commit is contained in:
3
iqpilot/ui/mici/__init__.py
Normal file
3
iqpilot/ui/mici/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
3
iqpilot/ui/mici/onroad/__init__.py
Normal file
3
iqpilot/ui/mici/onroad/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
31
iqpilot/ui/mici/onroad/confidence_ball.py
Normal file
31
iqpilot/ui/mici/onroad/confidence_ball.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
import pyray as rl
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state, UIStatus
|
||||
|
||||
|
||||
ACTIVE_CONFIDENCE_TOP = rl.Color(0x22, 0xB8, 0xB9, 0xFF)
|
||||
ACTIVE_CONFIDENCE_BOTTOM = rl.Color(0x0C, 0x94, 0x96, 0xFF)
|
||||
MEDIUM_CONFIDENCE_TOP = rl.Color(255, 200, 0, 255)
|
||||
MEDIUM_CONFIDENCE_BOTTOM = rl.Color(255, 115, 0, 255)
|
||||
LOW_CONFIDENCE_TOP = rl.Color(255, 0, 21, 255)
|
||||
LOW_CONFIDENCE_BOTTOM = rl.Color(255, 0, 89, 255)
|
||||
|
||||
|
||||
class IQConfidenceBall:
|
||||
@staticmethod
|
||||
def get_animate_status_probs():
|
||||
if ui_state.status == UIStatus.LAT_ONLY:
|
||||
return ui_state.sm['modelV2'].meta.disengagePredictions.steerOverrideProbs
|
||||
|
||||
# UIStatus.LONG_ONLY
|
||||
return ui_state.sm['modelV2'].meta.disengagePredictions.brakeDisengageProbs
|
||||
|
||||
@staticmethod
|
||||
def get_lat_long_dot_colors(confidence: float) -> tuple[rl.Color, rl.Color]:
|
||||
if confidence > 0.5:
|
||||
return ACTIVE_CONFIDENCE_TOP, ACTIVE_CONFIDENCE_BOTTOM
|
||||
if confidence > 0.2:
|
||||
return MEDIUM_CONFIDENCE_TOP, MEDIUM_CONFIDENCE_BOTTOM
|
||||
return LOW_CONFIDENCE_TOP, LOW_CONFIDENCE_BOTTOM
|
||||
32
iqpilot/ui/mici/onroad/hud_renderer.py
Normal file
32
iqpilot/ui/mici/onroad/hud_renderer.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
import pyray as rl
|
||||
|
||||
from openpilot.selfdrive.ui.mici.onroad.hud_renderer import HudRenderer
|
||||
from openpilot.iqpilot.ui.onroad.hud_overlays import IQBlindSpotOverlay
|
||||
|
||||
|
||||
class IQMiciHudRenderer(HudRenderer):
|
||||
"""Stock Mici HUD extended with IQ.Pilot's own onroad overlays.
|
||||
|
||||
Overlays live in a list so the renderer stays overlay-agnostic — each just needs
|
||||
update()/render(rect); blind-spot state is surfaced by any overlay that exposes it.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._overlays = [IQBlindSpotOverlay()]
|
||||
|
||||
def _update_state(self) -> None:
|
||||
super()._update_state()
|
||||
for overlay in self._overlays:
|
||||
overlay.update()
|
||||
|
||||
def _render(self, rect: rl.Rectangle) -> None:
|
||||
super()._render(rect)
|
||||
for overlay in self._overlays:
|
||||
overlay.render(rect)
|
||||
|
||||
def _has_blind_spot_detected(self) -> bool:
|
||||
return any(getattr(overlay, "detected", False) for overlay in self._overlays)
|
||||
10
iqpilot/ui/mici/onroad/model_renderer.py
Normal file
10
iqpilot/ui/mici/onroad/model_renderer.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
import pyray as rl
|
||||
from openpilot.selfdrive.ui.ui_state import UIStatus
|
||||
|
||||
IQ_LANE_LINE_COLORS = {
|
||||
UIStatus.LAT_ONLY: rl.Color(0x0C, 0x94, 0x96, 0xFF),
|
||||
UIStatus.LONG_ONLY: rl.Color(0x0C, 0x94, 0x96, 0xFF),
|
||||
}
|
||||
20
iqpilot/ui/mici/onroad/road_label.py
Normal file
20
iqpilot/ui/mici/onroad/road_label.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos/
|
||||
"""
|
||||
from openpilot.iqpilot.ui.onroad.hud_overlays import RoadNameBanner
|
||||
|
||||
|
||||
class RoadNameRendererMici(RoadNameBanner):
|
||||
"""Compact capsule tuned for the mici's small panel."""
|
||||
|
||||
TYPE_SIZE = 28
|
||||
FLOOR_WIDTH = 120
|
||||
SIDE_PAD = 28
|
||||
MARGIN = 200
|
||||
DROP = 8
|
||||
BAR_H = TYPE_SIZE + 14
|
||||
CURVE = 0.35
|
||||
SEGS = 8
|
||||
BACKDROP_A = 140
|
||||
INK_A = 210
|
||||
INNER_PAD = 16
|
||||
Reference in New Issue
Block a user