diff --git a/common/params.cc b/common/params.cc index 7b90e6b..0eb18ef 100644 --- a/common/params.cc +++ b/common/params.cc @@ -209,6 +209,7 @@ std::unordered_map keys = { {"VisionRadarToggle", PERSISTENT}, // FrogPilot parameters + {"AccelerationPath", PERSISTENT}, {"CustomAlerts", PERSISTENT}, {"CustomUI", PERSISTENT}, {"FrogPilotTogglesUpdated", PERSISTENT}, diff --git a/selfdrive/frogpilot/ui/visual_settings.cc b/selfdrive/frogpilot/ui/visual_settings.cc index 5488eb6..a12bb22 100644 --- a/selfdrive/frogpilot/ui/visual_settings.cc +++ b/selfdrive/frogpilot/ui/visual_settings.cc @@ -5,6 +5,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot {"CustomAlerts", "Custom Alerts", "Enable custom alerts for various logic or situational changes.", "../frogpilot/assets/toggle_icons/icon_green_light.png"}, {"CustomUI", "Custom Onroad UI", "Customize the Onroad UI with some additional visual functions.", "../assets/offroad/icon_road.png"}, + {"AccelerationPath", "Acceleration Path", "Visualize the car's intended acceleration or deceleration with a color-coded path.", ""}, {"QOLVisuals", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"}, }; diff --git a/selfdrive/frogpilot/ui/visual_settings.h b/selfdrive/frogpilot/ui/visual_settings.h index ce69c60..228f0b4 100644 --- a/selfdrive/frogpilot/ui/visual_settings.h +++ b/selfdrive/frogpilot/ui/visual_settings.h @@ -30,7 +30,7 @@ private: std::set alertVolumeControlKeys = {}; std::set customAlertsKeys = {}; - std::set customOnroadUIKeys = {}; + std::set customOnroadUIKeys = {"AccelerationPath"}; std::set customThemeKeys = {}; std::set modelUIKeys = {}; std::set qolKeys = {}; diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 775a89e..acacdc9 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -501,7 +501,7 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) { // paint path QLinearGradient bg(0, height(), 0, 0); - if (sm["controlsState"].getControlsState().getExperimentalMode()) { + if (sm["controlsState"].getControlsState().getExperimentalMode() || 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 140f879..560747e 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -244,6 +244,7 @@ void ui_update_frogpilot_params(UIState *s) { UIScene &scene = s->scene; bool custom_onroad_ui = params.getBool("CustomUI"); + scene.acceleration_path = custom_onroad_ui && params.getBool("AccelerationPath"); bool quality_of_life_controls = params.getBool("QOLControls"); diff --git a/selfdrive/ui/ui.h b/selfdrive/ui/ui.h index 8ac8034..fa6ee80 100644 --- a/selfdrive/ui/ui.h +++ b/selfdrive/ui/ui.h @@ -167,6 +167,7 @@ typedef struct UIScene { uint64_t started_frame; // FrogPilot variables + bool acceleration_path; bool enabled; bool experimental_mode;