From 41e6bd563bcf5f4dea63f0c605f0d055de024fbf 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 ba09c66c4..db6066bd8 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -89,7 +89,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 @@ -406,6 +407,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 2f7062a73..392e84a62 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -187,6 +187,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;