From 374ef6d465e349473341e277c27956fd95dd7fbf Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sun, 12 May 2024 00:27:49 -0700 Subject: [PATCH] Visuals - Model UI - Hide Lead Marker Hide the lead marker from the onroad UI. --- selfdrive/ui/qt/onroad.cc | 2 +- selfdrive/ui/ui.cc | 1 + selfdrive/ui/ui.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 45d6bb1..8cc695d 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -1197,7 +1197,7 @@ void AnnotatedCameraWidget::paintGL() { update_model(s, model, sm["uiPlan"].getUiPlan()); drawLaneLines(painter, s); - if (s->scene.longitudinal_control && sm.rcv_frame("modelV2") > s->scene.started_frame) { + if (s->scene.longitudinal_control && sm.rcv_frame("modelV2") > s->scene.started_frame && !s->scene.hide_lead_marker) { update_leads(s, model); float prev_drel = -1; for (int i = 0; i < model.getLeadsV3().size() && i < 2; i++) { diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 989b7fe..0bd2b66 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -382,6 +382,7 @@ void ui_update_frogpilot_params(UIState *s) { scene.model_ui = params.getBool("ModelUI"); scene.dynamic_path_width = scene.model_ui && params.getBool("DynamicPathWidth"); + scene.hide_lead_marker = scene.model_ui && params.getBool("HideLeadMarker"); bool quality_of_life_controls = params.getBool("QOLControls"); scene.reverse_cruise = quality_of_life_controls && params.getBool("ReverseCruise"); diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 8bf9091..81e3d88 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -206,6 +206,7 @@ typedef struct UIScene { bool fahrenheit; bool fps_counter; bool has_auto_tune; + bool hide_lead_marker; bool holiday_themes; bool is_CPU; bool is_GPU;