This commit is contained in:
Your Name
2024-05-10 04:14:00 -05:00
parent ad3a0476e9
commit bc2a4e2266
12 changed files with 136 additions and 203 deletions

View File

@@ -1,43 +1,43 @@
- Test if activation fix works for op long, submit to frog maintain
- no lateral on turn signal - only enforce if model curvature > 10 degrees, hands on wheel, or wheel override (maybe curve not necessary?)
- disable all turn signal output commands - they are causing issues
- test "create_acc_cancel" on canfd on cc engaged on boot
- work on /data/userspace/qtwaylandbuild/qt5 and see if we can get it to include webview
- try extract boot image, maybe we can replace the boot logo
- Test and fix activation on button + brakes
- Create clearpilot process. manages behaviors.
- experiment with reduced jerk values
- if thermal warning on dash, do ghost on a beach with sun image until cooled down
- test toggle stop all canbus output
- make functions - make functions
--- get_curvature --- get_curvature
--- get_wheel_angle --- get_wheel_angle
--- get_distance_to_left_lane --- get_distance_to_left_lane
--- get_distance_to_right_lane --- get_distance_to_right_lane
--- are hands on wheel
--- distance traveled for lane change --- distance traveled for lane change
--- distance to lead
- put these on a debug.
- Design alternate settings webview
- get speed limit display working
- get calculated experimental speed display working
- get button press emulation working
- get experimental mode working
- get speed limit set working
- dev enable lateral on blinker but no wheel pressure or no wheel presence
- bluetooth dummy device
- Test if activation fix works for op long, submit to frog maintain
- (test) disable all turn signal output commands - they are causing issues
- test "create_acc_cancel" on canfd on cc engaged on boot
- Create clearpilot process. manages behaviors.
- experiment with reduced jerk values
- test toggle stop all canbus output
- Warn if significantly slower traffic
behaviors: behaviors:
- lane change wrong way reenable lateral - lane change wrong way reenable lateral
- blinker signal wheel angle minor enable lateral - blinker signal wheel angle minor enable lateral
- wheel angle sharp only engage lateral if over lane edge unless hands not on wheel - wheel angle sharp only engage lateral if over lane edge unless hands not on wheel
- no lateral on turn signal - only enforce if model curvature > 10 degrees, hands on wheel, or wheel override (maybe curve not necessary?)
- debug mode activated bu lkas - debug mode activated bu lkas
- If possible, debug what happened to frogpilot process on may 4th
- See where disk free is going with NCDU and add smarter log rotation - See where disk free is going with NCDU and add smarter log rotation
- Maybe this has logs where it could show what happened to frogpilot process? - Maybe this has logs where it could show what happened to frogpilot process?
- Test supress cruise icon on long paused - Test supress cruise icon on long paused
- Move pac man ghost logo up 10%
- increase center lane brightness 50% and make it blueish - increase center lane brightness 50% and make it blueish
- make drive mode color much brighter and 30% more white - make drive mode color much brighter and 30% more white
- maintain lateral on icon on stop on dash - maintain lateral on icon on stop on dash
@@ -62,7 +62,7 @@ behaviors:
- bluetooth dummy device - bluetooth dummy device
- dash cam - dash cam
- change disk used on sidebar to disk free / percent used - change disk used on sidebar to disk free / percent used
- show distance to lead on dash -
- warn if lead is going more than 30 under my speed or 20 if auto mode is off - warn if lead is going more than 30 under my speed or 20 if auto mode is off
- mark os version different than release, forcing a os reinstall - mark os version different than release, forcing a os reinstall

View File

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

View File

Before

Width:  |  Height:  |  Size: 454 KiB

After

Width:  |  Height:  |  Size: 454 KiB

View File

@@ -65,6 +65,11 @@ class DesireHelper:
# Clearpilot test lane change no lat # Clearpilot test lane change no lat
clearpilot_disable_lat_on_lane_change = True clearpilot_disable_lat_on_lane_change = True
# Todo, we want to count how many lanes we have moved during this process either left or right.
# Then, if blinker left, but we have traveled rightwards, reenable lateral and vice versa.
# Also, if we are less than 25% twoards our lane change and we get a blind spot, reenable lateral
# with influence back to our lane on wheel.
v_ego = carstate.vEgo v_ego = carstate.vEgo
one_blinker = carstate.leftBlinker != carstate.rightBlinker one_blinker = carstate.leftBlinker != carstate.rightBlinker
below_lane_change_speed = v_ego < LANE_CHANGE_SPEED_MIN below_lane_change_speed = v_ego < LANE_CHANGE_SPEED_MIN

View File

@@ -92,8 +92,7 @@ qt_webengine_libs = qt_libs + ['Qt5WebEngineWidgets']
# Create clearpilot tools # Create clearpilot tools
qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_shell", ["/data/openpilot/system/clearpilot/tools/qt_shell.cc"], LIBS=qt_libs) qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_shell", ["/data/openpilot/system/clearpilot/tools/qt_shell.cc"], LIBS=qt_libs)
qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_webview", ["/data/openpilot/system/clearpilot/tools/qt_webview.cc"], LIBS=qt_webengine_libs) # qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_webview", ["/data/openpilot/system/clearpilot/tools/qt_webview.cc"], LIBS=qt_webengine_libs)
qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_webview2", ["/data/openpilot/system/clearpilot/tools/qt_webview2.cc"], LIBS=qt_webengine_libs)
# build main UI # build main UI
qt_env.Program("ui", qt_src + [asset_obj], LIBS=qt_webengine_libs) qt_env.Program("ui", qt_src + [asset_obj], LIBS=qt_webengine_libs)

View File

@@ -192,12 +192,12 @@ OffroadHome::OffroadHome(QWidget* parent) : QFrame(parent) {
home_layout->setContentsMargins(0, 0, 0, 0); home_layout->setContentsMargins(0, 0, 0, 0);
home_layout->setSpacing(30); home_layout->setSpacing(30);
// // Create a QWebEngineView // // // Create a QWebEngineView
QWebEngineView *web_view = new QWebEngineView(); // QWebEngineView *web_view = new QWebEngineView();
web_view->load(QUrl("http://fark.com")); // web_view->load(QUrl("http://fark.com"));
// Add the QWebEngineView to the layout // // Add the QWebEngineView to the layout
home_layout->addWidget(web_view); // home_layout->addWidget(web_view);
} }
center_layout->addWidget(home_widget); center_layout->addWidget(home_widget);

View File

@@ -1,127 +1,127 @@
#include <QCommandLineParser> // #include <QCommandLineParser>
#include <QApplication> // #include <QApplication>
#include <QWidget> // #include <QWidget>
#include <QTextEdit> // #include <QTextEdit>
#include <QLabel> // #include <QLabel>
#include <QTimer> // #include <QTimer>
#include <QProcess> // #include <QProcess>
#include <QVBoxLayout> // #include <QVBoxLayout>
#include <QFont> // #include <QFont>
#include <QScreen> // #include <QScreen>
#include <QScrollBar> // #include <QScrollBar>
#include <QGuiApplication> // #include <QGuiApplication>
#include <qpa/qplatformnativeinterface.h> // #include <qpa/qplatformnativeinterface.h>
#include <wayland-client-protocol.h> // #include <wayland-client-protocol.h>
#include <cstdlib> // #include <cstdlib>
#include <QWebEngineView> // #include <QWebEngineView>
class WebViewFrame : public QFrame { // class WebViewFrame : public QFrame {
Q_OBJECT // Q_OBJECT
public: // public:
explicit WebViewFrame(QWidget *parent = nullptr) : QFrame(parent) { // explicit WebViewFrame(QWidget *parent = nullptr) : QFrame(parent) {
QVBoxLayout *layout = new QVBoxLayout(this); // QVBoxLayout *layout = new QVBoxLayout(this);
QWebEngineView *web_view = new QWebEngineView(); // QWebEngineView *web_view = new QWebEngineView();
web_view->load(QUrl("http://example.com")); // Change URL as needed // web_view->load(QUrl("http://example.com")); // Change URL as needed
layout->addWidget(web_view); // layout->addWidget(web_view);
} // }
}; // };
class MainWindow : public QWidget { // class MainWindow : public QWidget {
Q_OBJECT // Q_OBJECT
public: // public:
explicit MainWindow(QWidget *parent = nullptr) { // explicit MainWindow(QWidget *parent = nullptr) {
this->setWindowTitle("Webview in Frame"); // this->setWindowTitle("Webview in Frame");
this->setStyleSheet("background-color: black;"); // this->setStyleSheet("background-color: black;");
this->showFullScreen(); // this->showFullScreen();
QVBoxLayout *mainLayout = new QVBoxLayout(this); // QVBoxLayout *mainLayout = new QVBoxLayout(this);
this->setLayout(mainLayout); // this->setLayout(mainLayout);
WebViewFrame *webViewFrame = nullptr; // Declare pointer but do not initialize // WebViewFrame *webViewFrame = nullptr; // Declare pointer but do not initialize
QTimer::singleShot(2000, this, [=, &webViewFrame]() mutable { // QTimer::singleShot(2000, this, [=, &webViewFrame]() mutable {
webViewFrame = new WebViewFrame(this); // Initialize here // webViewFrame = new WebViewFrame(this); // Initialize here
mainLayout->addWidget(webViewFrame); // mainLayout->addWidget(webViewFrame);
}); // });
this->show(); // this->show();
} // }
}; // };
int main(int argc, char *argv[]) { // int main(int argc, char *argv[]) {
setenv("XDG_RUNTIME_DIR", "/var/tmp/weston", 1); // setenv("XDG_RUNTIME_DIR", "/var/tmp/weston", 1);
setenv("WAYLAND_DISPLAY", "wayland-0", 1); // setenv("WAYLAND_DISPLAY", "wayland-0", 1);
setenv("QT_QPA_PLATFORM", "wayland", 1); // setenv("QT_QPA_PLATFORM", "wayland", 1);
setenv("QT_WAYLAND_SHELL_INTEGRATION", "wl-shell", 1); // setenv("QT_WAYLAND_SHELL_INTEGRATION", "wl-shell", 1);
QApplication app(argc, argv); // QApplication app(argc, argv);
QCommandLineParser parser; // QCommandLineParser parser;
parser.addHelpOption(); // parser.addHelpOption();
parser.addPositionalArgument("command", "The URL to open."); // parser.addPositionalArgument("command", "The URL to open.");
parser.process(app); // parser.process(app);
QStringList args = parser.positionalArguments(); // QStringList args = parser.positionalArguments();
if (args.isEmpty()) { // if (args.isEmpty()) {
fprintf(stderr, "Usage: %s '<command>'\n", argv[0]); // fprintf(stderr, "Usage: %s '<command>'\n", argv[0]);
return 1; // return 1;
} // }
// Common init // // Common init
MainWindow window; // MainWindow window;
auto windowHandle = window.windowHandle(); // auto windowHandle = window.windowHandle();
if (!windowHandle) { // if (!windowHandle) {
fprintf(stderr, "Error: Unable to obtain window handle.\n"); // fprintf(stderr, "Error: Unable to obtain window handle.\n");
return 1; // return 1;
} // }
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); // QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
auto *s = static_cast<wl_surface*>(native->nativeResourceForWindow("surface", windowHandle)); // auto *s = static_cast<wl_surface*>(native->nativeResourceForWindow("surface", windowHandle));
if (!s) { // if (!s) {
fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n"); // fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n");
return 1; // return 1;
} // }
wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); // wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270);
wl_surface_commit(s); // wl_surface_commit(s);
window.setFixedSize(2160, 1080); // window.setFixedSize(2160, 1080);
// QVBoxLayout *layout = new QVBoxLayout(&window); // // QVBoxLayout *layout = new QVBoxLayout(&window);
// layout->setSpacing(0); // // layout->setSpacing(0);
// layout->setContentsMargins(0, 0, 0, 0); // // layout->setContentsMargins(0, 0, 0, 0);
// QTextEdit *outputDisplay = new QTextEdit; // // QTextEdit *outputDisplay = new QTextEdit;
// outputDisplay->setFont(QFont("Consolas", 32)); // // outputDisplay->setFont(QFont("Consolas", 32));
// outputDisplay->setReadOnly(true); // // outputDisplay->setReadOnly(true);
// outputDisplay->setFixedSize(window.width(), window.height()); // // outputDisplay->setFixedSize(window.width(), window.height());
// outputDisplay->setStyleSheet("color: white; background-color: black;"); // // outputDisplay->setStyleSheet("color: white; background-color: black;");
// outputDisplay->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Hide the vertical scrollbar // // outputDisplay->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Hide the vertical scrollbar
// layout->addWidget(outputDisplay); // // layout->addWidget(outputDisplay);
// QString url = args.first(); // // QString url = args.first();
// web_view->load(QUrl(argv[1])); // // web_view->load(QUrl(argv[1]));
// layout->addWidget(web_view); // // layout->addWidget(web_view);
// Set a timer to change the background color and load the URL after 0.5 seconds // // Set a timer to change the background color and load the URL after 0.5 seconds
// QTimer::singleShot(2000, [&]() { // // QTimer::singleShot(2000, [&]() {
// WebViewFrame *webViewFrame = new WebViewFrame(this); // // WebViewFrame *webViewFrame = new WebViewFrame(this);
// layout->addWidget(webViewFrame); // // layout->addWidget(webViewFrame);
// // QWebEngineView *web_view = new QWebEngineView(); // // // QWebEngineView *web_view = new QWebEngineView();
// // web_view->load(QUrl(args.first())); // Load the URL // // // web_view->load(QUrl(args.first())); // Load the URL
// // layout->addWidget(web_view); // Add the web view to the layout // // // layout->addWidget(web_view); // Add the web view to the layout
// window.update(); // Refresh window to apply changes // // window.update(); // Refresh window to apply changes
// }); // // });
// window.showFullScreen(); // // window.showFullScreen();
window.show(); // window.show();
return app.exec(); // return app.exec();
} // }
#include "qt_webview.moc" // #include "qt_webview.moc"

View File

@@ -1,71 +0,0 @@
#include <sys/resource.h>
#include <cstdlib>
// #include <QApplication>
// #include <QTranslator>
#include "/data/openpilot/system/hardware/hw.h"
#include "/data/openpilot/selfdrive/ui/qt/qt_window.h"
#include "/data/openpilot/selfdrive/ui/qt/util.h"
// #include <QCommandLineParser>
// #include <QApplication>
// #include <QWidget>
// #include <QTextEdit>
// #include <QLabel>
// #include <QProcess>
// #include <QVBoxLayout>
// #include <QFont>
// #include <QScreen>
// #include <QScrollBar>
// #include <QGuiApplication>
// #include <QWebEngineView>
// #include <QStackedLayout>
#include <QApplication>
#include <QFrame>
#include <QVBoxLayout>
#include <QWebEngineView>
#include <QWidget>
class WebViewFrame : public QFrame {
Q_OBJECT
public:
explicit WebViewFrame(QWidget *parent = nullptr) : QFrame(parent) {
QVBoxLayout *layout = new QVBoxLayout(this);
QWebEngineView *web_view = new QWebEngineView();
web_view->load(QUrl("http://example.com")); // Change URL as needed
layout->addWidget(web_view);
}
};
class MainWindow : public QWidget {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr) {
this->setWindowTitle("Webview in Frame");
this->setStyleSheet("background-color: black;");
WebViewFrame *webViewFrame = new WebViewFrame(this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(webViewFrame);
this->setLayout(mainLayout);
this->show();
}
};
int main(int argc, char *argv[]) {
setenv("XDG_RUNTIME_DIR", "/var/tmp/weston", 1);
setenv("WAYLAND_DISPLAY", "wayland-0", 1);
setenv("QT_QPA_PLATFORM", "wayland", 1);
setenv("QT_WAYLAND_SHELL_INTEGRATION", "wl-shell", 1);
setpriority(PRIO_PROCESS, 0, -20);
initApp(argc, argv);
QApplication app(argc, argv);
MainWindow mainWindow;
setMainWindow(&mainWindow);
return app.exec();
}
#include "qt_webview2.moc"