FrogPilot setup

This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent 9d97e0ecc1
commit 7308c1b35c
60 changed files with 1660 additions and 49 deletions

View File

@@ -14,13 +14,14 @@
const int btn_size = 192;
const int img_size = (btn_size / 4) * 3;
// FrogPilot global variables
// ***** onroad widgets *****
class OnroadAlerts : public QWidget {
Q_OBJECT
public:
OnroadAlerts(QWidget *parent = 0) : QWidget(parent) {}
OnroadAlerts(QWidget *parent = 0) : QWidget(parent), scene(uiState()->scene) {}
void updateAlert(const Alert &a);
protected:
@@ -29,6 +30,9 @@ protected:
private:
QColor bg;
Alert alert = {};
// FrogPilot variables
UIScene &scene;
};
class ExperimentalButton : public QPushButton {
@@ -47,6 +51,9 @@ private:
QPixmap experimental_img;
bool experimental_mode;
bool engageable;
// FrogPilot variables
UIScene &scene;
};
@@ -71,6 +78,7 @@ public:
void updateState(const UIState &s);
MapSettingsButton *map_settings_btn;
MapSettingsButton *map_settings_btn_bottom;
private:
void drawText(QPainter &p, int x, int y, const QString &text, int alpha = 255);
@@ -97,6 +105,20 @@ private:
int skip_frame_count = 0;
bool wide_cam_requested = false;
// FrogPilot widgets
void drawStatusBar(QPainter &p);
void initializeFrogPilotWidgets();
void updateFrogPilotWidgets(QPainter &p);
// FrogPilot variables
Params paramsMemory{"/dev/shm/params"};
UIScene &scene;
QHBoxLayout *bottom_layout;
bool experimentalMode;
protected:
void paintGL() override;
void initializeGL() override;
@@ -135,6 +157,9 @@ private:
QWidget *map = nullptr;
QHBoxLayout* split;
// FrogPilot variables
UIScene &scene;
private slots:
void offroadTransition(bool offroad);
void primeChanged(bool prime);