Acceleration path
Added toggle to always show the vehicle's acceleration/deceleration via the onroad UI path.
This commit is contained in:
@@ -209,6 +209,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
{"VisionRadarToggle", PERSISTENT},
|
{"VisionRadarToggle", PERSISTENT},
|
||||||
|
|
||||||
// FrogPilot parameters
|
// FrogPilot parameters
|
||||||
|
{"AccelerationPath", PERSISTENT},
|
||||||
{"CustomAlerts", PERSISTENT},
|
{"CustomAlerts", PERSISTENT},
|
||||||
{"CustomUI", PERSISTENT},
|
{"CustomUI", PERSISTENT},
|
||||||
{"FrogPilotTogglesUpdated", PERSISTENT},
|
{"FrogPilotTogglesUpdated", PERSISTENT},
|
||||||
|
|||||||
@@ -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"},
|
{"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"},
|
{"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"},
|
{"QOLVisuals", "Quality of Life", "Miscellaneous quality of life changes to improve your overall openpilot experience.", "../frogpilot/assets/toggle_icons/quality_of_life.png"},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ private:
|
|||||||
|
|
||||||
std::set<QString> alertVolumeControlKeys = {};
|
std::set<QString> alertVolumeControlKeys = {};
|
||||||
std::set<QString> customAlertsKeys = {};
|
std::set<QString> customAlertsKeys = {};
|
||||||
std::set<QString> customOnroadUIKeys = {};
|
std::set<QString> customOnroadUIKeys = {"AccelerationPath"};
|
||||||
std::set<QString> customThemeKeys = {};
|
std::set<QString> customThemeKeys = {};
|
||||||
std::set<QString> modelUIKeys = {};
|
std::set<QString> modelUIKeys = {};
|
||||||
std::set<QString> qolKeys = {};
|
std::set<QString> qolKeys = {};
|
||||||
|
|||||||
@@ -501,7 +501,7 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
|
|||||||
|
|
||||||
// paint path
|
// paint path
|
||||||
QLinearGradient bg(0, height(), 0, 0);
|
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
|
// 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
|
// and the indices match the positions of accel from uiPlan
|
||||||
const auto &acceleration = sm["uiPlan"].getUiPlan().getAccel();
|
const auto &acceleration = sm["uiPlan"].getUiPlan().getAccel();
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ void ui_update_frogpilot_params(UIState *s) {
|
|||||||
UIScene &scene = s->scene;
|
UIScene &scene = s->scene;
|
||||||
|
|
||||||
bool custom_onroad_ui = params.getBool("CustomUI");
|
bool custom_onroad_ui = params.getBool("CustomUI");
|
||||||
|
scene.acceleration_path = custom_onroad_ui && params.getBool("AccelerationPath");
|
||||||
|
|
||||||
bool quality_of_life_controls = params.getBool("QOLControls");
|
bool quality_of_life_controls = params.getBool("QOLControls");
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ typedef struct UIScene {
|
|||||||
uint64_t started_frame;
|
uint64_t started_frame;
|
||||||
|
|
||||||
// FrogPilot variables
|
// FrogPilot variables
|
||||||
|
bool acceleration_path;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
bool experimental_mode;
|
bool experimental_mode;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user