ui: fix DM orange transitions (#37922)

* fix transitions and use eff active

* huh

* wtf

* clean up

* strict

* strict

* back

* back
This commit is contained in:
Shane Smiskol
2026-04-27 00:13:30 -07:00
committed by GitHub
parent dc6e644359
commit 13ea74bcb4
+5 -7
View File
@@ -105,13 +105,8 @@ class DriverStateRenderer(Widget):
self._rect.y + (self._rect.height - self._dm_person.height) / 2), 0.0, 1.0,
rl.Color(255, 255, 255, int(255 * 0.9 * self._fade_filter.x)))
green_amount = self._color_fade_filter.update(0.0 if self._awareness_unfull else 1.0)
if self.effective_active:
self._color_fade_filter.update(0.0 if self._awareness_unfull else 1.0)
t = self._color_fade_filter.x
r = int(round(CONE_COLOR_GREEN[0] * t + CONE_COLOR_ORANGE[0] * (1 - t)))
g = int(round(CONE_COLOR_GREEN[1] * t + CONE_COLOR_ORANGE[1] * (1 - t)))
b = int(round(CONE_COLOR_GREEN[2] * t + CONE_COLOR_ORANGE[2] * (1 - t)))
source_rect = rl.Rectangle(0, 0, self._dm_cone.width, self._dm_cone.height)
dest_rect = rl.Rectangle(
self._rect.x + self._rect.width / 2,
@@ -121,6 +116,9 @@ class DriverStateRenderer(Widget):
)
if not self._lines:
r = int(round(CONE_COLOR_GREEN[0] * green_amount + CONE_COLOR_ORANGE[0] * (1 - green_amount)))
g = int(round(CONE_COLOR_GREEN[1] * green_amount + CONE_COLOR_ORANGE[1] * (1 - green_amount)))
b = int(round(CONE_COLOR_GREEN[2] * green_amount + CONE_COLOR_ORANGE[2] * (1 - green_amount)))
rl.draw_texture_pro(
self._dm_cone,
source_rect,
@@ -170,7 +168,7 @@ class DriverStateRenderer(Widget):
self._is_active = dm_state.activePolicy == log.DriverMonitoringState.MonitoringPolicy.vision
self._is_rhd = dm_state.isRHD
self._face_detected = dm_state.visionPolicyState.faceDetected
self._awareness_unfull = self._is_active and dm_state.visionPolicyState.awarenessPercent < self.AWARENESS_UNFULL_PERCENT
self._awareness_unfull = self.effective_active and dm_state.visionPolicyState.awarenessPercent < self.AWARENESS_UNFULL_PERCENT
self._face_pitch = dm_state.visionPolicyState.pose.pitch + math.radians(6) # calib or DM pose is not accurate, add a fake upward pitch to bias forward
self._face_yaw = -dm_state.visionPolicyState.pose.yaw # undo sign flip in face_orientation_from_model to match UI convention