From 40abf9541607b88bfe541e4c7d0bc14315bada65 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sat, 11 May 2024 14:59:04 -0700 Subject: [PATCH] Visuals - Model UI - 'Unlimited' Road UI Length Extend the display of the path, lane lines, and road edges out as far as the model can see. --- selfdrive/ui/ui.cc | 4 +++- selfdrive/ui/ui.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 6697773..e30799c 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -90,7 +90,8 @@ void update_model(UIState *s, if (plan_position.getX().size() < model.getPosition().getX().size()) { plan_position = model.getPosition(); } - float max_distance = std::clamp(*(plan_position.getX().end() - 1), + float max_distance = scene.unlimited_road_ui_length ? *(plan_position.getX().end() - 1) : + std::clamp(*(plan_position.getX().end() - 1), MIN_DRAW_DISTANCE, MAX_DRAW_DISTANCE); // update lane lines @@ -390,6 +391,7 @@ void ui_update_frogpilot_params(UIState *s) { 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; scene.road_edge_width = params.getInt("RoadEdgesWidth") * (scene.is_metric ? 1.0f : INCH_TO_CM) / 200.0f; + scene.unlimited_road_ui_length = scene.model_ui && params.getBool("UnlimitedLength"); 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 9f11e6e..03f9a6d 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -249,6 +249,7 @@ typedef struct UIScene { bool traffic_mode_active; bool turn_signal_left; bool turn_signal_right; + bool unlimited_road_ui_length; bool use_kaofui_icons; bool use_si; bool use_vienna_slc_sign;