diff --git a/clearpilot_devqueue_amain.txt b/clearpilot_devqueue_amain.txt index 408d082..90f7c32 100644 --- a/clearpilot_devqueue_amain.txt +++ b/clearpilot_devqueue_amain.txt @@ -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 --- get_curvature --- get_wheel_angle --- get_distance_to_left_lane --- get_distance_to_right_lane +--- are hands on wheel --- 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: + - lane change wrong way reenable lateral - blinker signal wheel angle minor enable lateral - 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 -- If possible, debug what happened to frogpilot process on may 4th - 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? - Test supress cruise icon on long paused -- Move pac man ghost logo up 10% - increase center lane brightness 50% and make it blueish - make drive mode color much brighter and 30% more white - maintain lateral on icon on stop on dash @@ -62,7 +62,7 @@ behaviors: - bluetooth dummy device - dash cam - 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 - mark os version different than release, forcing a os reinstall diff --git a/selfdrive/clearpilot/api/api.js b/selfdrive/clearpilot/api/api.js new file mode 100644 index 0000000..e69de29 diff --git a/selfdrive/clearpilot/clearpilot.js b/selfdrive/clearpilot/clearpilot.js new file mode 100644 index 0000000..e69de29 diff --git a/selfdrive/clearpilot/dev/logo.png~ b/selfdrive/clearpilot/dev/logo.png~ deleted file mode 100644 index 6ac3b76..0000000 Binary files a/selfdrive/clearpilot/dev/logo.png~ and /dev/null differ diff --git a/selfdrive/clearpilot/resource/defaults.json b/selfdrive/clearpilot/resource/defaults.json new file mode 100644 index 0000000..e69de29 diff --git a/selfdrive/clearpilot/dev/logo.png b/selfdrive/clearpilot/resource/logo.png similarity index 100% rename from selfdrive/clearpilot/dev/logo.png rename to selfdrive/clearpilot/resource/logo.png diff --git a/selfdrive/clearpilot/resource/settings.json b/selfdrive/clearpilot/resource/settings.json new file mode 100644 index 0000000..e69de29 diff --git a/selfdrive/controls/lib/desire_helper.py b/selfdrive/controls/lib/desire_helper.py index 612c127..860ec79 100644 --- a/selfdrive/controls/lib/desire_helper.py +++ b/selfdrive/controls/lib/desire_helper.py @@ -65,6 +65,11 @@ class DesireHelper: # Clearpilot test lane change no lat 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 one_blinker = carstate.leftBlinker != carstate.rightBlinker below_lane_change_speed = v_ego < LANE_CHANGE_SPEED_MIN diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript index 2267cbb..37e458d 100644 --- a/selfdrive/ui/SConscript +++ b/selfdrive/ui/SConscript @@ -92,8 +92,7 @@ qt_webengine_libs = qt_libs + ['Qt5WebEngineWidgets'] # 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_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) +# qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_webview", ["/data/openpilot/system/clearpilot/tools/qt_webview.cc"], LIBS=qt_webengine_libs) # build main UI qt_env.Program("ui", qt_src + [asset_obj], LIBS=qt_webengine_libs) diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 689a57f..687395e 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -192,12 +192,12 @@ OffroadHome::OffroadHome(QWidget* parent) : QFrame(parent) { home_layout->setContentsMargins(0, 0, 0, 0); home_layout->setSpacing(30); - // // Create a QWebEngineView - QWebEngineView *web_view = new QWebEngineView(); - web_view->load(QUrl("http://fark.com")); + // // // Create a QWebEngineView + // QWebEngineView *web_view = new QWebEngineView(); + // web_view->load(QUrl("http://fark.com")); - // Add the QWebEngineView to the layout - home_layout->addWidget(web_view); + // // Add the QWebEngineView to the layout + // home_layout->addWidget(web_view); } center_layout->addWidget(home_widget); diff --git a/system/clearpilot/tools/qt_webview.cc b/system/clearpilot/tools/qt_webview.cc index 382c46e..8ae5255 100644 --- a/system/clearpilot/tools/qt_webview.cc +++ b/system/clearpilot/tools/qt_webview.cc @@ -1,127 +1,127 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include -#include +// #include -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 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;"); - this->showFullScreen(); +// class MainWindow : public QWidget { +// Q_OBJECT +// public: +// explicit MainWindow(QWidget *parent = nullptr) { +// this->setWindowTitle("Webview in Frame"); +// this->setStyleSheet("background-color: black;"); +// this->showFullScreen(); - QVBoxLayout *mainLayout = new QVBoxLayout(this); - this->setLayout(mainLayout); +// QVBoxLayout *mainLayout = new QVBoxLayout(this); +// 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 { - webViewFrame = new WebViewFrame(this); // Initialize here - mainLayout->addWidget(webViewFrame); - }); +// QTimer::singleShot(2000, this, [=, &webViewFrame]() mutable { +// webViewFrame = new WebViewFrame(this); // Initialize here +// mainLayout->addWidget(webViewFrame); +// }); - this->show(); +// 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); +// 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); - QApplication app(argc, argv); +// QApplication app(argc, argv); - QCommandLineParser parser; - parser.addHelpOption(); - parser.addPositionalArgument("command", "The URL to open."); - parser.process(app); +// QCommandLineParser parser; +// parser.addHelpOption(); +// parser.addPositionalArgument("command", "The URL to open."); +// parser.process(app); - QStringList args = parser.positionalArguments(); - if (args.isEmpty()) { - fprintf(stderr, "Usage: %s ''\n", argv[0]); - return 1; - } +// QStringList args = parser.positionalArguments(); +// if (args.isEmpty()) { +// fprintf(stderr, "Usage: %s ''\n", argv[0]); +// return 1; +// } - // Common init - MainWindow window; +// // Common init +// MainWindow window; - auto windowHandle = window.windowHandle(); - if (!windowHandle) { - fprintf(stderr, "Error: Unable to obtain window handle.\n"); - return 1; - } +// auto windowHandle = window.windowHandle(); +// if (!windowHandle) { +// fprintf(stderr, "Error: Unable to obtain window handle.\n"); +// return 1; +// } - QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); - auto *s = static_cast(native->nativeResourceForWindow("surface", windowHandle)); - if (!s) { - fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n"); - return 1; - } +// QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); +// auto *s = static_cast(native->nativeResourceForWindow("surface", windowHandle)); +// if (!s) { +// fprintf(stderr, "Error: Unable to obtain native Wayland surface.\n"); +// return 1; +// } - wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); - wl_surface_commit(s); +// wl_surface_set_buffer_transform(s, WL_OUTPUT_TRANSFORM_270); +// wl_surface_commit(s); - window.setFixedSize(2160, 1080); +// window.setFixedSize(2160, 1080); - // QVBoxLayout *layout = new QVBoxLayout(&window); - // layout->setSpacing(0); - // layout->setContentsMargins(0, 0, 0, 0); +// // QVBoxLayout *layout = new QVBoxLayout(&window); +// // layout->setSpacing(0); +// // layout->setContentsMargins(0, 0, 0, 0); - // QTextEdit *outputDisplay = new QTextEdit; - // outputDisplay->setFont(QFont("Consolas", 32)); - // outputDisplay->setReadOnly(true); - // outputDisplay->setFixedSize(window.width(), window.height()); - // outputDisplay->setStyleSheet("color: white; background-color: black;"); - // outputDisplay->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Hide the vertical scrollbar - // layout->addWidget(outputDisplay); +// // QTextEdit *outputDisplay = new QTextEdit; +// // outputDisplay->setFont(QFont("Consolas", 32)); +// // outputDisplay->setReadOnly(true); +// // outputDisplay->setFixedSize(window.width(), window.height()); +// // outputDisplay->setStyleSheet("color: white; background-color: black;"); +// // outputDisplay->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Hide the vertical scrollbar +// // layout->addWidget(outputDisplay); - // QString url = args.first(); - // web_view->load(QUrl(argv[1])); - // layout->addWidget(web_view); +// // QString url = args.first(); +// // web_view->load(QUrl(argv[1])); +// // layout->addWidget(web_view); - // Set a timer to change the background color and load the URL after 0.5 seconds - // QTimer::singleShot(2000, [&]() { - // WebViewFrame *webViewFrame = new WebViewFrame(this); - // layout->addWidget(webViewFrame); - // // QWebEngineView *web_view = new QWebEngineView(); - // // web_view->load(QUrl(args.first())); // Load the URL - // // layout->addWidget(web_view); // Add the web view to the layout - // window.update(); // Refresh window to apply changes - // }); +// // Set a timer to change the background color and load the URL after 0.5 seconds +// // QTimer::singleShot(2000, [&]() { +// // WebViewFrame *webViewFrame = new WebViewFrame(this); +// // layout->addWidget(webViewFrame); +// // // QWebEngineView *web_view = new QWebEngineView(); +// // // web_view->load(QUrl(args.first())); // Load the URL +// // // layout->addWidget(web_view); // Add the web view to the layout +// // window.update(); // Refresh window to apply changes +// // }); - // window.showFullScreen(); - window.show(); +// // window.showFullScreen(); +// window.show(); - return app.exec(); -} +// return app.exec(); +// } -#include "qt_webview.moc" \ No newline at end of file +// #include "qt_webview.moc" \ No newline at end of file diff --git a/system/clearpilot/tools/qt_webview2.cc b/system/clearpilot/tools/qt_webview2.cc deleted file mode 100644 index 25c9a32..0000000 --- a/system/clearpilot/tools/qt_webview2.cc +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -// #include -// #include - -#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 -// #include -// #include -// #include -// #include -// #include -// #include -// #include -// #include -// #include -// #include -// #include -// #include - - -#include -#include -#include -#include -#include - -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"