Acceleration path

Added toggle to always show the vehicle's acceleration/deceleration via the onroad UI path.
This commit is contained in:
FrogAi
2024-04-10 18:41:16 -07:00
parent b5bd6da953
commit 14eacb8b3b
5 changed files with 6 additions and 3 deletions
+1
View File
@@ -209,6 +209,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"Version", PERSISTENT},
// FrogPilot parameters
{"AccelerationPath", PERSISTENT},
{"CustomAlerts", PERSISTENT},
{"CustomPaths", PERSISTENT},
{"CustomUI", PERSISTENT},
@@ -37,8 +37,8 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot
});
toggle = customUIToggle;
} else if (param == "CustomPaths") {
std::vector<QString> pathToggles{};
std::vector<QString> pathToggleNames{};
std::vector<QString> pathToggles{"AccelerationPath"};
std::vector<QString> pathToggleNames{tr("Acceleration")};
toggle = new FrogPilotParamToggleControl(param, title, desc, icon, pathToggles, pathToggleNames);
} else if (param == "QOLVisuals") {
+1 -1
View File
@@ -502,7 +502,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();
+1
View File
@@ -252,6 +252,7 @@ void ui_update_frogpilot_params(UIState *s) {
bool custom_onroad_ui = params.getBool("CustomUI");
bool custom_paths = custom_onroad_ui && params.getBool("CustomPaths");
scene.acceleration_path = custom_paths && params.getBool("AccelerationPath");
bool quality_of_life_controls = params.getBool("QOLControls");
+1
View File
@@ -169,6 +169,7 @@ typedef struct UIScene {
uint64_t started_frame;
// FrogPilot variables
bool acceleration_path;
bool enabled;
bool experimental_mode;
bool map_open;