From ab487baf0e8ecbb4ca87b18b37e0973b7205f611 Mon Sep 17 00:00:00 2001 From: James <91348155+FrogAi@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:00:00 -0700 Subject: [PATCH] Dynamic Path Width --- selfdrive/ui/qt/onroad/model.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad/model.cc b/selfdrive/ui/qt/onroad/model.cc index 3ba3908d..2816f09a 100644 --- a/selfdrive/ui/qt/onroad/model.cc +++ b/selfdrive/ui/qt/onroad/model.cc @@ -111,7 +111,12 @@ void ModelRenderer::update_model(const cereal::ModelDataV2::Reader &model, const } max_idx = get_path_length_idx(model_position, max_distance); // FrogPilot variables - mapLineToPolygon(model_position, frogpilot_toggles.value("model_ui").toBool() ? frogpilot_toggles.value("path_width").toDouble() : 0.9, path_offset_z, &track_vertices, max_idx, false); + float path_width = frogpilot_toggles.value("path_width").toDouble(); + if (frogpilot_toggles.value("dynamic_path_width").toBool()) { + UIState *s = uiState(); + path_width *= s->status == STATUS_ENGAGED ? 1.0f : s->status == STATUS_ALWAYS_ON_LATERAL_ACTIVE ? 0.75f : 0.50f; + } + mapLineToPolygon(model_position, frogpilot_toggles.value("model_ui").toBool() ? path_width : 0.9, path_offset_z, &track_vertices, max_idx, false); // FrogPilot variables FrogPilotUIState *fs = frogpilotUIState();