From 5df744cd6be74c559c6e4a9e7417c5f5b522a36d Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sat, 11 May 2024 14:57:32 -0700 Subject: [PATCH] Visuals - Model UI - Path Width Customize the width of the driving path shown on your UI. Default matches the width of a 2019 Lexus ES 350. --- selfdrive/ui/ui.cc | 3 ++- selfdrive/ui/ui.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 3b964e07c..2a0e173e8 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -117,7 +117,7 @@ void update_model(UIState *s, float path; if (scene.dynamic_path_width) { float multiplier = scene.enabled ? 1.0f : scene.always_on_lateral_active ? 0.75f : 0.50f; - path = 0.9 * multiplier; + path = scene.path_width * multiplier; } else { path = scene.path_width; } @@ -408,6 +408,7 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) { scene.hide_lead_marker = scene.model_ui && params.getBool("HideLeadMarker"); scene.lane_line_width = params.getInt("LaneLinesWidth") * (scene.is_metric ? 1.0f : INCH_TO_CM) / 200.0f; scene.path_edge_width = params.getInt("PathEdgeWidth"); + scene.path_width = params.getInt("PathWidth") / 10.0f * (scene.is_metric ? 1.0f : FOOT_TO_METER) / 2.0f; 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 86e07406d..7142c7cbe 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -210,6 +210,7 @@ typedef struct UIScene { float lat_accel; float lead_detection_threshold; float path_edge_width; + float path_width; float speed_jerk; float speed_jerk_difference; float speed_limit;