From 4eb3e3e94b2597180138f65f5aa3eb275e1a396e Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sat, 11 May 2024 14:58:28 -0700 Subject: [PATCH] Visuals - Model UI - Road Edges Adjust the visual thickness of road edges on your display. Default is 1/2 of the MUTCD average lane line width of 4 inches. --- 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 2a0e173e87d43e..dfa7922568721e 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -105,7 +105,7 @@ void update_model(UIState *s, const auto road_edge_stds = model.getRoadEdgeStds(); for (int i = 0; i < std::size(scene.road_edge_vertices); i++) { scene.road_edge_stds[i] = road_edge_stds[i]; - update_line_data(s, road_edges[i], 0.025, 0, &scene.road_edge_vertices[i], max_idx); + update_line_data(s, road_edges[i], scene.model_ui ? scene.road_edge_width : 0.025, 0, &scene.road_edge_vertices[i], max_idx); } // Update adjacent paths @@ -409,6 +409,7 @@ void ui_update_frogpilot_params(UIState *s, Params ¶ms) { 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; + scene.road_edge_width = params.getInt("RoadEdgesWidth") * (scene.is_metric ? 1.0f : INCH_TO_CM) / 200.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 7142c7cbe32a3b..e65943c41b52ee 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -211,6 +211,7 @@ typedef struct UIScene { float lead_detection_threshold; float path_edge_width; float path_width; + float road_edge_width; float speed_jerk; float speed_jerk_difference; float speed_limit;