mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-15 22:32:11 +08:00
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 = {
|
||||
{"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") {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@ typedef struct UIScene {
|
||||
uint64_t started_frame;
|
||||
|
||||
// FrogPilot variables
|
||||
bool acceleration_path;
|
||||
bool enabled;
|
||||
bool experimental_mode;
|
||||
bool map_open;
|
||||
|
||||
Reference in New Issue
Block a user