From d3c406964f487cf89a0459fdcf8a7a8093f08f41 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/annotated_camera.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/annotated_camera.cc b/selfdrive/ui/qt/onroad/annotated_camera.cc index 43d01de10..6148d9b3d 100644 --- a/selfdrive/ui/qt/onroad/annotated_camera.cc +++ b/selfdrive/ui/qt/onroad/annotated_camera.cc @@ -613,7 +613,7 @@ void AnnotatedCameraWidget::paintGL() { update_model(s, model, sm["uiPlan"].getUiPlan()); drawLaneLines(painter, s, v_ego); - 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 6cd04fad8..67da8db3f 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -402,6 +402,7 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) { 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 f9d3183ed..c3aa5ede1 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -142,6 +142,7 @@ typedef struct UIScene { bool fahrenheit; bool has_auto_tune; bool has_lead; + bool hide_lead_marker; bool holiday_themes; bool is_CPU; bool is_GPU;