From 358d37f8ee1ba96e19c1f43b0adf816078cb32c0 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Sat, 11 May 2024 12:47:25 -0700 Subject: [PATCH] Visuals - Custom Onroad UI - Paths - Acceleration Show your projected acceleration on the driving path. --- selfdrive/ui/qt/onroad.cc | 2 +- selfdrive/ui/ui.cc | 2 ++ selfdrive/ui/ui.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 332ea42..d107e6e 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -605,7 +605,7 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) { // paint path QLinearGradient bg(0, height(), 0, 0); - if (experimentalMode) { + if (experimentalMode || scene.acceleration_path) { // The first half of track_vertices are the points for the right side of the path // and the indices match the positions of accel from uiPlan const auto &acceleration = sm["uiPlan"].getUiPlan().getAccel(); diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 1a6b40d..97467b8 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -289,6 +289,8 @@ void ui_update_frogpilot_params(UIState *s) { scene.show_cem_status_bar = scene.conditional_experimental && !params.getBool("HideCEMStatusBar"); bool custom_onroad_ui = params.getBool("CustomUI"); + bool custom_paths = custom_onroad_ui && params.getBool("CustomPaths"); + scene.acceleration_path = custom_paths && params.getBool("AccelerationPath"); scene.compass = custom_onroad_ui && params.getBool("Compass"); scene.disable_smoothing_mtsc = params.getBool("MTSCEnabled") && params.getBool("DisableMTSCSmoothing"); diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index bd97413..068a8d3 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -186,6 +186,7 @@ typedef struct UIScene { uint64_t started_frame; // FrogPilot variables + bool acceleration_path; bool always_on_lateral_active; bool compass; bool conditional_experimental;