From 2206ca4e3497deaaf61c4ac4112e7028bcbedbd5 Mon Sep 17 00:00:00 2001 From: Michael Perlov Date: Thu, 2 Feb 2023 17:45:17 +0200 Subject: tracker-neuralnet: russian translation --- tracker-neuralnet/lang/ru_RU.ts | 73 +++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/tracker-neuralnet/lang/ru_RU.ts b/tracker-neuralnet/lang/ru_RU.ts index a80c7e3d..b191e769 100644 --- a/tracker-neuralnet/lang/ru_RU.ts +++ b/tracker-neuralnet/lang/ru_RU.ts @@ -5,147 +5,150 @@ Form Tracker settings - + Настройки трекера Diagonal FOV - + Угол обзора Camera settings - + Настройки камеры Frames per second - + Кадры в секунду Camera name - + Камера Camera Configuration - + Конфигурация камеры Head Center Offset - + Смещение центра головы mm - + мм Use only yaw and pitch while calibrating. Don't roll or change position. - + Поворачивайте голову влево-вправо и наклоняйте вверх-вниз. +Не наклоняйте набок и не смещайте голову в сторону. Start calibration - + Начать калибровку Right - + Вправо Forward - + Вперед Up - + Вверх Show Network Input - + Показать входные данные MJPEG - + Использовать MJPEG Tuning / Debug - + Тонкая настройка ROI Smoothing Alpha - + Сглаживание ROI ROI Zoom - + Масштабирование ROI Thread Count - + Количество потоков Resolution - + Разрешение Field of view. Needed to transform the pose to world coordinates. - + Угол обзора камеры. Требуется для преобразования положения головы в глобальные координаты Requested video frame rate. Actual setting may not be supported by the camera. - + Частота кадров. Реальные значения могут не поддерживаться камерой. The requested resolution for cases where the camera delivers maximum frame rate only for a particular resolution. The image may still be downscaled to the internal resolution. - + Разрешение камеры, для тех случаев, когда быстродействие камеры максимально в определенном разрешении. Может быть масштабировано до внутреннего разрешения. Number of threads. Can be used to balance the CPU load between the game and the tracker. - + Количество потоков. Используется для балансировки нагрузки на процессор между игрой и трекером. Show the image patch that the pose estimation model sees. - + Показать изображение, используемое моделью определения позиции Amount of smoothing of the face region coordinates. Can help stabilize the pose. - + Сглаживание координат области лица. Может помочь стабилизировать позицию. Zoom factor for the face region. Applied before the patch is fed into the pose estimation model. There is a sweet spot near 1. - + Фактор масштабирования области лица. Применяется перед передачей кадра в модель определения позиции. Наилучшие результаты близки к 1 neuralnet_tracker_ns::NeuralNetDialog Default - + По умолчанию Tracker Offline - + Трекер выключен %1x%2 @ %3 FPS / Inference: %4 ms - + %1x%2 @ %3 FPS; Время оценки: %4 мс %1 yaw samples. Yaw more to %2 samples for stable calibration. - + Сэмплов поворота: %1. +Поворачивайте голову в стороны до %2 сэмплов для стабильной калибрации. %1 pitch samples. Pitch more to %2 samples for stable calibration. - + Сэмплов наклона: %1. +Наклоняйте голову вниз/вверх до %2 сэмплов для стабильной калибрации. %1 samples. Over %2, good! - + %1 сэмплов. Более %2, достаточно. Stop calibration - + Остановить калибровку Start calibration - + Начать калибровку -- cgit v1.2.3 From b4417b1c570e3fc7ac034f4fd3f34de302c7178d Mon Sep 17 00:00:00 2001 From: fsimuser9430 Date: Sun, 19 Feb 2023 18:57:18 +0200 Subject: x-plane-plugin: activate toggles only on initial button press --- x-plane-plugin/plugin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-plane-plugin/plugin.c b/x-plane-plugin/plugin.c index ed72e50e..e43ee0ef 100644 --- a/x-plane-plugin/plugin.c +++ b/x-plane-plugin/plugin.c @@ -134,6 +134,8 @@ static int TrackToggleHandler(XPLMCommandRef inCommand, XPLMCommandPhase inPhase, void* inRefCon) { + if (inPhase != xplm_CommandBegin) return 0; + if (track_disabled) { //Enable @@ -156,6 +158,8 @@ static int TranslationToggleHandler(XPLMCommandRef inCommand, XPLMCommandPhase inPhase, void* inRefCon) { + if (inPhase != xplm_CommandBegin) return 0; + translation_disabled = !translation_disabled; if (!translation_disabled) { -- cgit v1.2.3 From 9a7e5f1b6e18ee4f0c3455c683f7023c2fd66fcb Mon Sep 17 00:00:00 2001 From: Priton-CE Date: Sun, 26 Feb 2023 17:34:07 +0100 Subject: moved changes from master to upstream-merge --- proto-wine/ftnoir_protocol_wine.cpp | 31 ++++++++ proto-wine/ftnoir_protocol_wine.h | 9 ++- proto-wine/ftnoir_protocol_wine_dialog.cpp | 73 +++++++++++++++++ proto-wine/ftnoir_winecontrols.ui | 121 ++++++++++++++++++++++------- proto-wine/lang/nl_NL.ts | 43 +++++++++- proto-wine/lang/ru_RU.ts | 43 +++++++++- proto-wine/lang/stub.ts | 43 +++++++++- proto-wine/lang/zh_CN.ts | 43 +++++++++- 8 files changed, 361 insertions(+), 45 deletions(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index af53ff1f..7b82b76f 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -44,6 +44,7 @@ void wine::pose(const double *headpose, const double*) #ifndef OTR_WINE_NO_WRAPPER if (shm->gameid != gameid) { + qDebug() << "proto/wine: looking up gameData"; QString gamename; QMutexLocker foo(&game_name_mutex); /* only EZCA for FSX requires dummy process, and FSX doesn't work on Linux */ @@ -63,6 +64,22 @@ module_status wine::initialize() static const QString library_path(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH); QString wine_path = "wine"; + if (s.wine_select_path().toString() != "WINE") { + // if we are not supposed to use system wine then: + if (s.wine_select_path().toString() != "CUSTOM") { + // if we don't have a custom path then change the wine_path to the path corresponding to the selected version + wine_path = s.wine_select_path().toString(); + } + else if (!s.wine_custom_path->isEmpty()) { + // if we do have a custom path and it is not empty then + wine_path = s.wine_custom_path; + } + } + if (wine_path[0] == '~') + wine_path = qgetenv("HOME") + wine_path.mid(1); + + qDebug() << "proto/wine: wine_path:" << wine_path; + auto env = QProcessEnvironment::systemEnvironment(); if (s.variant_proton) @@ -91,6 +108,8 @@ module_status wine::initialize() if (wineprefix[0] != '/') return error(tr("Wine prefix must be an absolute path (given '%1')").arg(wineprefix)); + qDebug() << "proto/wine: wineprefix:" << wineprefix; + env.insert("WINEPREFIX", wineprefix); } @@ -104,12 +123,24 @@ module_status wine::initialize() wrapper.setProcessEnvironment(env); wrapper.setWorkingDirectory(OPENTRACK_BASE_PATH); wrapper.start(wine_path, { library_path + "opentrack-wrapper-wine.exe.so" }); + wrapper.waitForStarted(); + if (wrapper.state() == QProcess::ProcessState::NotRunning) { + return error(tr("Failed to start Wine! Make sure the binary is set correctly.")); + } #endif if (lck_shm.success()) { shm = (WineSHM*) lck_shm.ptr(); memset(shm, 0, sizeof(*shm)); + + qDebug() << "proto/wine: shm success"; + + // display "waiting for game message" (overwritten once a game is detected) + connected_game = "waiting for game..."; + } + else { + qDebug() << "proto/wine: shm no success"; } if (lck_shm.success()) diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index f7346be9..23845d51 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -26,7 +26,9 @@ struct settings : opts value proton_appid{b, "proton-appid", 0}; value proton_path{b, "proton-version", {} }; - value wineprefix{b, "wineprefix", "~/.wine"}; + value wine_select_path{b, "wine-select-version", {"WINE"}}; + value wine_custom_path{b, "wine-custom-version", ""}; + value wineprefix{b, "wineprefix", "~/Games/star-citizen/"}; value protocol{b, "protocol", 2}; }; @@ -77,6 +79,11 @@ private: settings s; private slots: + void onWinePathComboUpdated(QString selection); + + void doBrowseWine(); + void doBrowsePrefix(); + void doOK(); void doCancel(); }; diff --git a/proto-wine/ftnoir_protocol_wine_dialog.cpp b/proto-wine/ftnoir_protocol_wine_dialog.cpp index a954a752..07dc1469 100644 --- a/proto-wine/ftnoir_protocol_wine_dialog.cpp +++ b/proto-wine/ftnoir_protocol_wine_dialog.cpp @@ -1,9 +1,20 @@ #include "ftnoir_protocol_wine.h" #include +#include #include #include "api/plugin-api.hpp" +/* + * 0: path to the directory with wine versions + * 1: path from a wine version to the exectuable + * 2: name of the application using the wine versions + */ +static const char* wine_paths[][3] = { + {"/.local/share/lutris/runners/wine/", "/bin/wine", "Lutris"}, + {"/.var/app/net.lutris.Lutris/data/lutris/runners/wine/", "/bin/wine", "Flatpak Lutris"} +}; + static const char* proton_paths[] = { "/.steam/steam/steamapps/common", "/.steam/root/compatibilitytools.d", @@ -14,6 +25,23 @@ FTControls::FTControls() { ui.setupUi(this); + //populate wine select + ui.wine_path_combo->addItem("System Wine", QVariant{"WINE"}); + for (const char** path : wine_paths) { + QDir dir(QDir::homePath() + path[0]); + dir.setFilter(QDir::Dirs); + QFileInfoList list = dir.entryInfoList(); + for (int i = 0; i < list.size(); ++i) { + QFileInfo fileInfo = list.at(i); + if (fileInfo.fileName() == "." || fileInfo.fileName() == "..") continue; + + QString name = fileInfo.fileName() + " (" + path[2] + ")"; + ui.wine_path_combo->addItem(name, QVariant{fileInfo.filePath() + path[1]}); + } + } + ui.wine_path_combo->addItem("Custom path to Wine executable", QVariant{"CUSTOM"}); + + //populate proton select for (const char* path : proton_paths) { QDir dir(QDir::homePath() + path); dir.setFilter(QDir::Dirs); @@ -24,17 +52,62 @@ FTControls::FTControls() ui.proton_version->addItem(fileInfo.fileName(), QVariant{fileInfo.filePath()}); } } + tie_setting(s.proton_path, ui.proton_version); tie_setting(s.variant_wine, ui.variant_wine); tie_setting(s.variant_proton, ui.variant_proton); tie_setting(s.esync, ui.esync); tie_setting(s.fsync, ui.fsync); tie_setting(s.proton_appid, ui.proton_appid); + tie_setting(s.wine_select_path, ui.wine_path_combo); + tie_setting(s.wine_custom_path, ui.wine_path); tie_setting(s.wineprefix, ui.wineprefix); tie_setting(s.protocol, ui.protocol_selection); + connect(ui.wine_path_combo, &QComboBox::currentTextChanged, this, &FTControls::onWinePathComboUpdated); + connect(ui.browse_wine_path_button, &QPushButton::clicked, this, &FTControls::doBrowseWine); + connect(ui.browse_wine_prefix_button, &QPushButton::clicked, this, &FTControls::doBrowsePrefix); connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &FTControls::doOK); connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &FTControls::doCancel); + + // update state of the combo box and associated ui elements + onWinePathComboUpdated(ui.wine_path_combo->currentText()); +} + +void FTControls::onWinePathComboUpdated(QString selection) { + // enable the custom text field if required + if (selection == "Custom path to Wine executable") { + ui.wine_path->setEnabled(true); + ui.browse_wine_path_button->setEnabled(true); + } + else { + ui.wine_path->setEnabled(false); + ui.browse_wine_path_button->setEnabled(false); + } +} + +void FTControls::doBrowseWine() { + QFileDialog d(this); + d.setFileMode(QFileDialog::FileMode::ExistingFile); + d.setWindowTitle(tr("Select path to Wine Binary")); + if (s.wine_custom_path->startsWith("~/.local/share/lutris/runners")) { + d.selectFile(s.wine_custom_path); + } + if (d.exec()) { + s.wine_custom_path = d.selectedFiles()[0]; + } +} +void FTControls::doBrowsePrefix() { + QFileDialog d(this); + d.setFileMode(QFileDialog::FileMode::Directory); + d.setOption(QFileDialog::Option::ShowDirsOnly, true); + d.setWindowTitle(tr("Select Wine Prefix")); + if (s.wineprefix->startsWith("/") || s.wineprefix->startsWith("~")) { + d.selectFile(s.wineprefix); + } + if (d.exec()) { + s.wineprefix = d.selectedFiles()[0]; + } } void FTControls::doOK() diff --git a/proto-wine/ftnoir_winecontrols.ui b/proto-wine/ftnoir_winecontrols.ui index e9541447..365922ca 100644 --- a/proto-wine/ftnoir_winecontrols.ui +++ b/proto-wine/ftnoir_winecontrols.ui @@ -9,7 +9,7 @@ 0 0 - 528 + 951 424 @@ -33,8 +33,8 @@ Wine variant - - + + 0 @@ -42,55 +42,120 @@ - Wine (system) + Proton (Steam Play) - - + + - + 0 0 - - - 120 - 0 - + + Wine (select path and prefix) - - + + - + 0 0 - 286 + 120 0 - - - - - - - 0 - 0 - - - - Proton (Steam Play) + + Qt::LeftToRight + + + + + + + 0 + 0 + + + + + 450 + 0 + + + + <html><head/><body><p>prefix</p></body></html> + + + /path_to_the_prefix/ + + + + + + + Browse Prefix + + + + + + + + + + + false + + + + 0 + 0 + + + + + 450 + 0 + + + + <html><head/><body><p>wine/runner exectuable path</p></body></html> + + + + + + + + + + + + + false + + + Browse Wine Path + + + + + + + + diff --git a/proto-wine/lang/nl_NL.ts b/proto-wine/lang/nl_NL.ts index e2183cc8..0298092b 100644 --- a/proto-wine/lang/nl_NL.ts +++ b/proto-wine/lang/nl_NL.ts @@ -2,17 +2,24 @@ - UICFTControls + FTControls - Wine settings + Select path to Wine Binary - Wine variant + Select Wine Prefix + + + + + UICFTControls + + Wine settings - Wine (system) + Wine variant @@ -55,6 +62,30 @@ Both + + Wine (select path and prefix) + + + + <html><head/><body><p>prefix</p></body></html> + + + + /path_to_the_prefix/ + + + + Browse Prefix + + + + <html><head/><body><p>wine/runner exectuable path</p></body></html> + + + + Browse Wine Path + + wine @@ -70,6 +101,10 @@ Wine prefix must be an absolute path (given '%1') + + Failed to start Wine! Make sure the binary is set correctly. + + wine_metadata diff --git a/proto-wine/lang/ru_RU.ts b/proto-wine/lang/ru_RU.ts index f3b44bd2..c7e9c52e 100644 --- a/proto-wine/lang/ru_RU.ts +++ b/proto-wine/lang/ru_RU.ts @@ -2,17 +2,24 @@ - UICFTControls + FTControls - Wine settings + Select path to Wine Binary - Wine variant + Select Wine Prefix + + + + + UICFTControls + + Wine settings - Wine (system) + Wine variant @@ -55,6 +62,30 @@ Both + + Wine (select path and prefix) + + + + <html><head/><body><p>prefix</p></body></html> + + + + /path_to_the_prefix/ + + + + Browse Prefix + + + + <html><head/><body><p>wine/runner exectuable path</p></body></html> + + + + Browse Wine Path + + wine @@ -70,6 +101,10 @@ Wine prefix must be an absolute path (given '%1') + + Failed to start Wine! Make sure the binary is set correctly. + + wine_metadata diff --git a/proto-wine/lang/stub.ts b/proto-wine/lang/stub.ts index dd4f946f..3366b44b 100644 --- a/proto-wine/lang/stub.ts +++ b/proto-wine/lang/stub.ts @@ -2,17 +2,24 @@ - UICFTControls + FTControls - Wine settings + Select path to Wine Binary - Wine variant + Select Wine Prefix + + + + + UICFTControls + + Wine settings - Wine (system) + Wine variant @@ -55,6 +62,30 @@ Both + + Wine (select path and prefix) + + + + <html><head/><body><p>prefix</p></body></html> + + + + /path_to_the_prefix/ + + + + Browse Prefix + + + + <html><head/><body><p>wine/runner exectuable path</p></body></html> + + + + Browse Wine Path + + wine @@ -70,6 +101,10 @@ Wine prefix must be an absolute path (given '%1') + + Failed to start Wine! Make sure the binary is set correctly. + + wine_metadata diff --git a/proto-wine/lang/zh_CN.ts b/proto-wine/lang/zh_CN.ts index b7c9ea7d..0d285c7c 100644 --- a/proto-wine/lang/zh_CN.ts +++ b/proto-wine/lang/zh_CN.ts @@ -2,17 +2,24 @@ - UICFTControls + FTControls - Wine settings + Select path to Wine Binary - Wine variant + Select Wine Prefix + + + + + UICFTControls + + Wine settings - Wine (system) + Wine variant @@ -55,6 +62,30 @@ Both + + Wine (select path and prefix) + + + + <html><head/><body><p>prefix</p></body></html> + + + + /path_to_the_prefix/ + + + + Browse Prefix + + + + <html><head/><body><p>wine/runner exectuable path</p></body></html> + + + + Browse Wine Path + + wine @@ -70,6 +101,10 @@ Wine prefix must be an absolute path (given '%1') + + Failed to start Wine! Make sure the binary is set correctly. + + wine_metadata -- cgit v1.2.3 From e6ab541c19b50bca6cf371430d40f30835c9e3ea Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 Feb 2023 17:53:58 +0100 Subject: cmake: fix warning --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 337d8072..8c6613bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,8 @@ set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES ON) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/") include(opentrack-policy NO_POLICY_SCOPE) -project(opentrack) cmake_minimum_required(VERSION 3.13 FATAL_ERROR) +project(opentrack) # must be prior to CMakeDetermineCXXCompiler due to rpath if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) -- cgit v1.2.3 From 03f593ff835ab66dc4cbbb71db387e52fa17cc3a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 Feb 2023 17:55:00 +0100 Subject: proto/wine: kill verbose warning The .csv lookup may fail and thus result in this message getting printed 250 times per second. --- proto-wine/ftnoir_protocol_wine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index 7b82b76f..75526c54 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -44,7 +44,7 @@ void wine::pose(const double *headpose, const double*) #ifndef OTR_WINE_NO_WRAPPER if (shm->gameid != gameid) { - qDebug() << "proto/wine: looking up gameData"; + //qDebug() << "proto/wine: looking up gameData"; QString gamename; QMutexLocker foo(&game_name_mutex); /* only EZCA for FSX requires dummy process, and FSX doesn't work on Linux */ -- cgit v1.2.3 From da34d6ba965f7db40c1f3ee8aa2231cede573f6c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 Feb 2023 17:55:16 +0100 Subject: proto/wine: try to detect CI wineg++ --- proto-wine/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proto-wine/CMakeLists.txt b/proto-wine/CMakeLists.txt index 0beb50e1..e81b341c 100644 --- a/proto-wine/CMakeLists.txt +++ b/proto-wine/CMakeLists.txt @@ -17,10 +17,14 @@ if(NOT WIN32) endif() file(GLOB wine-deps "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx") #install(FILES ${wine-deps} DESTINATION "${opentrack-src}/proto-wine") + set(winegxx "${SDK_WINE}/bin/wine") + if(EXISTS "${SDK_WINE}/lib/wine/wineg++") + set(winegxx "${SDK_WINE}/lib/wine/wineg++") + endif() add_custom_command( OUTPUT opentrack-wrapper-wine.exe.so DEPENDS ${wine-deps} - COMMAND wineg++ -mconsole -g -DNOMINMAX -O2 -m32 -std=c++17 -fPIC -o + COMMAND "${winegxx}" -mconsole -g -DNOMINMAX -O2 -m32 -std=c++17 -fPIC -o opentrack-wrapper-wine.exe -I "${CMAKE_SOURCE_DIR}" -I "${CMAKE_BINARY_DIR}" ${wine-deps} -Wall -Wextra -Wpedantic ${my-rt}) -- cgit v1.2.3 From b076122b4682999f7787fa5f7cf6efaaf3cef755 Mon Sep 17 00:00:00 2001 From: Eric <49884065+Priton-CE@users.noreply.github.com> Date: Sun, 26 Feb 2023 17:56:00 +0100 Subject: remove Star Citizen refrence from recent PR. --- proto-wine/ftnoir_protocol_wine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index 23845d51..f79f65dc 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -28,7 +28,7 @@ struct settings : opts value proton_path{b, "proton-version", {} }; value wine_select_path{b, "wine-select-version", {"WINE"}}; value wine_custom_path{b, "wine-custom-version", ""}; - value wineprefix{b, "wineprefix", "~/Games/star-citizen/"}; + value wineprefix{b, "wineprefix", "~/.wine/"}; value protocol{b, "protocol", 2}; }; -- cgit v1.2.3 From 28760f77a78ecdbea3c390ae0d602d410852d230 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 Feb 2023 18:04:39 +0100 Subject: ci: try to build proto/wine --- .github/workflows/cmake.yml | 2 +- sdk-paths-runneradmin@GNU-Linux.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sdk-paths-runneradmin@GNU-Linux.cmake diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ce47a3db..c24e9c99 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -36,7 +36,7 @@ jobs: - uses: seanmiddleditch/gha-setup-ninja@master - name: Install Linux Dependencies - run: sudo apt update && sudo apt install libprocps-dev libopencv-dev libopencv-dev + run: sudo apt update && sudo apt install libprocps-dev libopencv-dev libopencv-dev wine64-tools if: matrix.os == 'ubuntu-latest' - name: Cache Qt diff --git a/sdk-paths-runneradmin@GNU-Linux.cmake b/sdk-paths-runneradmin@GNU-Linux.cmake new file mode 100644 index 00000000..89c39be6 --- /dev/null +++ b/sdk-paths-runneradmin@GNU-Linux.cmake @@ -0,0 +1 @@ +set(SDK_WINE /usr) -- cgit v1.2.3 From 5a0f22d281d78094552867d1b64d64f4d9600ca0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 27 Feb 2023 18:45:55 +0100 Subject: video/ps3eye: simplify false sharing protection code --- video-ps3eye/shm-layout.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/video-ps3eye/shm-layout.hpp b/video-ps3eye/shm-layout.hpp index 9eee6db4..0b6c132e 100644 --- a/video-ps3eye/shm-layout.hpp +++ b/video-ps3eye/shm-layout.hpp @@ -31,12 +31,8 @@ struct shm_out }; struct shm { - static constexpr unsigned _cacheline_len = 64; - static constexpr unsigned _padding_len = - (_cacheline_len - (sizeof(shm_in) & (_cacheline_len - 1))) & (_cacheline_len - 1); - shm_out out; - const char* _padding[_padding_len]; + [[maybe_unused]] const char _padding[128 - sizeof(shm_out) % 128]; // NOLINT shm_in in; }; -- cgit v1.2.3 From 2a2447373906dc7263279b21fba30a190b562192 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 22:38:22 +0100 Subject: Revert "proto/wine: try to detect CI wineg++" This reverts commit da34d6ba965f7db40c1f3ee8aa2231cede573f6c. Reported by: ljgdasfhk (Artem Sobolev) Issue: #726 --- proto-wine/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/proto-wine/CMakeLists.txt b/proto-wine/CMakeLists.txt index e81b341c..0beb50e1 100644 --- a/proto-wine/CMakeLists.txt +++ b/proto-wine/CMakeLists.txt @@ -17,14 +17,10 @@ if(NOT WIN32) endif() file(GLOB wine-deps "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx") #install(FILES ${wine-deps} DESTINATION "${opentrack-src}/proto-wine") - set(winegxx "${SDK_WINE}/bin/wine") - if(EXISTS "${SDK_WINE}/lib/wine/wineg++") - set(winegxx "${SDK_WINE}/lib/wine/wineg++") - endif() add_custom_command( OUTPUT opentrack-wrapper-wine.exe.so DEPENDS ${wine-deps} - COMMAND "${winegxx}" -mconsole -g -DNOMINMAX -O2 -m32 -std=c++17 -fPIC -o + COMMAND wineg++ -mconsole -g -DNOMINMAX -O2 -m32 -std=c++17 -fPIC -o opentrack-wrapper-wine.exe -I "${CMAKE_SOURCE_DIR}" -I "${CMAKE_BINARY_DIR}" ${wine-deps} -Wall -Wextra -Wpedantic ${my-rt}) -- cgit v1.2.3 From 0d133feec021d72a88515de191b7bebd46687cbb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 22:42:22 +0100 Subject: ci: try to fix wine path --- sdk-paths-runneradmin@GNU-Linux.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk-paths-runneradmin@GNU-Linux.cmake b/sdk-paths-runneradmin@GNU-Linux.cmake index 89c39be6..09207046 100644 --- a/sdk-paths-runneradmin@GNU-Linux.cmake +++ b/sdk-paths-runneradmin@GNU-Linux.cmake @@ -1 +1,2 @@ -set(SDK_WINE /usr) +set(SDK_WINE ON) +set(ENV{PATH} "/usr/lib/wine:$ENV{PATH}") -- cgit v1.2.3 From 9957115ca38733c159a4dd259b355310182a350e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 22:44:25 +0100 Subject: ci: try fix this again --- sdk-paths-runneradmin@GNU-Linux.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk-paths-runneradmin@GNU-Linux.cmake b/sdk-paths-runneradmin@GNU-Linux.cmake index 09207046..df5c6f35 100644 --- a/sdk-paths-runneradmin@GNU-Linux.cmake +++ b/sdk-paths-runneradmin@GNU-Linux.cmake @@ -1,2 +1,2 @@ -set(SDK_WINE ON) +set(SDK_WINE ON CACHE BOOL "" FORCE) set(ENV{PATH} "/usr/lib/wine:$ENV{PATH}") -- cgit v1.2.3 From f3a508830cd04266f7095f2e85b2b1b27f6dc456 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 23:00:35 +0100 Subject: try to fix ci again --- cmake/opentrack-load-user-settings.cmake | 3 +-- sdk-paths-runner@GNU-Linux.cmake | 2 ++ sdk-paths-runneradmin@GNU-Linux.cmake | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 sdk-paths-runner@GNU-Linux.cmake delete mode 100644 sdk-paths-runneradmin@GNU-Linux.cmake diff --git a/cmake/opentrack-load-user-settings.cmake b/cmake/opentrack-load-user-settings.cmake index 1baf3702..e84384d3 100644 --- a/cmake/opentrack-load-user-settings.cmake +++ b/cmake/opentrack-load-user-settings.cmake @@ -26,8 +26,7 @@ else() set(__sdk_host_os "") endif() -set(__sdk_paths_basename "sdk-paths-${__sdk_username}@${CMAKE_CXX_COMPILER_ID}-${__sdk_host_os}${__sdk_target_os}.cmake") -set(__sdk_paths_filename "${CMAKE_SOURCE_DIR}/${__sdk_paths_basename}") +set(__sdk_paths_filename "${CMAKE_CURRENT_SOURCE_DIR}/${__sdk_paths_basename}") if(EXISTS "${__sdk_paths_filename}") message(STATUS "Loading user settings '${__sdk_paths_basename}'") diff --git a/sdk-paths-runner@GNU-Linux.cmake b/sdk-paths-runner@GNU-Linux.cmake new file mode 100644 index 00000000..df5c6f35 --- /dev/null +++ b/sdk-paths-runner@GNU-Linux.cmake @@ -0,0 +1,2 @@ +set(SDK_WINE ON CACHE BOOL "" FORCE) +set(ENV{PATH} "/usr/lib/wine:$ENV{PATH}") diff --git a/sdk-paths-runneradmin@GNU-Linux.cmake b/sdk-paths-runneradmin@GNU-Linux.cmake deleted file mode 100644 index df5c6f35..00000000 --- a/sdk-paths-runneradmin@GNU-Linux.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(SDK_WINE ON CACHE BOOL "" FORCE) -set(ENV{PATH} "/usr/lib/wine:$ENV{PATH}") -- cgit v1.2.3 From 1d21ed45e5d4e9382393ffdf8f6b6373b3a45f88 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 23:05:40 +0100 Subject: ci: again --- cmake/opentrack-load-user-settings.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/opentrack-load-user-settings.cmake b/cmake/opentrack-load-user-settings.cmake index e84384d3..fdb63936 100644 --- a/cmake/opentrack-load-user-settings.cmake +++ b/cmake/opentrack-load-user-settings.cmake @@ -26,11 +26,11 @@ else() set(__sdk_host_os "") endif() -set(__sdk_paths_filename "${CMAKE_CURRENT_SOURCE_DIR}/${__sdk_paths_basename}") +set(__sdk_paths_filename "${CMAKE_CURRENT_SOURCE_DIR}/sdk-paths-${__sdk_username}@${CMAKE_CXX_COMPILER_ID}-${__sdk_host_os}${__sdk_target_os}.cmake") if(EXISTS "${__sdk_paths_filename}") - message(STATUS "Loading user settings '${__sdk_paths_basename}'") + message(STATUS "Loading user settings '${__sdk_paths_filename}'") include("${__sdk_paths_filename}") else() - message(STATUS "User settings file '${__sdk_paths_basename}' doesn't exist") + message(STATUS "User settings file '${__sdk_paths_filename}' doesn't exist") endif() -- cgit v1.2.3 From 526e0fc9205b4bddcc93ddbe95f274d1c051ca7d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 23:12:30 +0100 Subject: ci: almost there --- proto-wine/CMakeLists.txt | 6 +++++- sdk-paths-runner@GNU-Linux.cmake | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/proto-wine/CMakeLists.txt b/proto-wine/CMakeLists.txt index 0beb50e1..1bb47b33 100644 --- a/proto-wine/CMakeLists.txt +++ b/proto-wine/CMakeLists.txt @@ -17,10 +17,14 @@ if(NOT WIN32) endif() file(GLOB wine-deps "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx") #install(FILES ${wine-deps} DESTINATION "${opentrack-src}/proto-wine") + set(winegxx-multilib "-m32") + if (OPENTRACK_WINE_ARCH NOT STREQUAL "") + set(winegxx-multilib "${OPENTRACK_WINE_ARCH}") + endif() add_custom_command( OUTPUT opentrack-wrapper-wine.exe.so DEPENDS ${wine-deps} - COMMAND wineg++ -mconsole -g -DNOMINMAX -O2 -m32 -std=c++17 -fPIC -o + COMMAND wineg++ -mconsole -g -DNOMINMAX -O2 ${winegxx-multilib} -std=c++17 -fPIC -o opentrack-wrapper-wine.exe -I "${CMAKE_SOURCE_DIR}" -I "${CMAKE_BINARY_DIR}" ${wine-deps} -Wall -Wextra -Wpedantic ${my-rt}) diff --git a/sdk-paths-runner@GNU-Linux.cmake b/sdk-paths-runner@GNU-Linux.cmake index df5c6f35..03c87ce4 100644 --- a/sdk-paths-runner@GNU-Linux.cmake +++ b/sdk-paths-runner@GNU-Linux.cmake @@ -1,2 +1,3 @@ set(SDK_WINE ON CACHE BOOL "" FORCE) +set(OPENTRACK_WINE_ARCH -m64 CACHE STRING "" FORCE) set(ENV{PATH} "/usr/lib/wine:$ENV{PATH}") -- cgit v1.2.3 From cf1d653a6b90bd90b855c23890f327b778ef4ab8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 23:15:34 +0100 Subject: ci: maybe this time? --- proto-wine/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-wine/CMakeLists.txt b/proto-wine/CMakeLists.txt index 1bb47b33..ff4932cc 100644 --- a/proto-wine/CMakeLists.txt +++ b/proto-wine/CMakeLists.txt @@ -18,7 +18,7 @@ if(NOT WIN32) file(GLOB wine-deps "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx") #install(FILES ${wine-deps} DESTINATION "${opentrack-src}/proto-wine") set(winegxx-multilib "-m32") - if (OPENTRACK_WINE_ARCH NOT STREQUAL "") + if (NOT OPENTRACK_WINE_ARCH STREQUAL "") set(winegxx-multilib "${OPENTRACK_WINE_ARCH}") endif() add_custom_command( -- cgit v1.2.3 From 6656b9f5b99733e88c776579dcaa07877d816a79 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Mar 2023 20:14:38 +0100 Subject: cmake: fix onnx broken build on 32-bit Linux --- tracker-neuralnet/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tracker-neuralnet/CMakeLists.txt b/tracker-neuralnet/CMakeLists.txt index f414c920..4689dba1 100644 --- a/tracker-neuralnet/CMakeLists.txt +++ b/tracker-neuralnet/CMakeLists.txt @@ -1,4 +1,9 @@ include(opentrack-opencv) +set(host-spec "${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_SIZEOF_VOID_P}") +if(host-spec MATCHES "^Linux i[3-6]86 4$") + return() +endif() + find_package(OpenCV QUIET) find_package(OpenMP QUIET) # Used to control number of onnx threads. find_package(ONNXRuntime QUIET) -- cgit v1.2.3 From 1eb2ed6e95332bc6568d796226986e78a02d4785 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Mar 2023 22:44:23 +0100 Subject: options/tie: fix combobox with single element on reload This was breaking the camera list with only one camera present. --- options/tie.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/options/tie.cpp b/options/tie.cpp index c2976217..adf26b53 100644 --- a/options/tie.cpp +++ b/options/tie.cpp @@ -28,8 +28,12 @@ void tie_setting(value& v, QComboBox* cb) { cb->setCurrentText(v); v = cb->currentText(); - value_::connect(cb, SIGNAL(currentTextChanged(QString)), &v, SLOT(setValue(const QString&)), v.DIRECT_CONNTYPE); - value_::connect(&v, SIGNAL(valueChanged(const QString&)), cb, SLOT(setCurrentText(const QString&)), v.SAFE_CONNTYPE); + auto set_current_text = [cb, &v](const QString& str) { + cb->setCurrentText(str); + v = cb->currentText(); + }; + value_::connect(cb, &QComboBox::currentTextChanged, &v, v.value_changed(), v.DIRECT_CONNTYPE); + value_::connect(&v, v.value_changed(), cb, set_current_text, v.SAFE_CONNTYPE); } void tie_setting(value& v, QComboBox* cb) -- cgit v1.2.3 From 6274ec1b5f63087bb3ca41390ed0149ea3d6ae8c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Mar 2023 22:46:10 +0100 Subject: options/value: log more with OTR_TRACE_NOTIFY --- options/base-value.cpp | 2 +- options/value.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/options/base-value.cpp b/options/base-value.cpp index 9ccbbdf8..950629d0 100644 --- a/options/base-value.cpp +++ b/options/base-value.cpp @@ -29,5 +29,5 @@ value_::~value_() void value_::maybe_trace(const char* str) const { if (TRACE_NOTIFY) - qDebug().noquote() << str << QThread::currentThreadId() << b->name() << self_name; + qDebug().noquote() << str << QThread::currentThreadId() << b->name() << self_name << get_variant(); } diff --git a/options/value.hpp b/options/value.hpp index dacd0ea9..9a7487b8 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -137,6 +137,7 @@ public: return *this; store_variant(traits::qvariant_from_value(traits::pass_value(datum))); + maybe_trace("set-value"); return *this; } -- cgit v1.2.3 From 93d93a7bf5c5804922b15777109c12503149eb4a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 6 Feb 2023 06:31:11 +0100 Subject: tracker/trackhat: rename module friendly name Let's avoid confusing TrackHat PS3 Eye and v2 sensor users. --- tracker-trackhat/camera.cpp | 2 +- tracker-trackhat/metadata.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tracker-trackhat/camera.cpp b/tracker-trackhat/camera.cpp index 74e35423..d7079a96 100644 --- a/tracker-trackhat/camera.cpp +++ b/tracker-trackhat/camera.cpp @@ -39,7 +39,7 @@ pt_camera_info trackhat_camera::get_desired() const QString trackhat_camera::get_desired_name() const { - return QStringLiteral("TrackHat sensor"); + return QStringLiteral("TrackHat sensor v1"); } QString trackhat_camera::get_active_name() const diff --git a/tracker-trackhat/metadata.hpp b/tracker-trackhat/metadata.hpp index c0f7567c..f1355064 100644 --- a/tracker-trackhat/metadata.hpp +++ b/tracker-trackhat/metadata.hpp @@ -15,7 +15,7 @@ class trackhat_module final : public Metadata Q_OBJECT public: - QString name() override { return tr("TrackHat Point Tracker"); } + QString name() override { return tr("TrackHat v1 Sensor"); } QIcon icon() override { return QIcon(":/images/trackhat-64x64.png"); } static const QString module_name; }; -- cgit v1.2.3 From 28f193fff2b96bef5a7f36f60718475da82c4e9e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 23 Jan 2023 13:59:51 +0100 Subject: cmake: oops, fix qt library copy logic --- cmake/opentrack-qt.cmake | 6 ++++-- tracker-hatire/CMakeLists.txt | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index 41bd6291..800e9096 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -4,7 +4,7 @@ if(WIN32) endif() set(qt-required-components Core Network Widgets LinguistTools Gui) set(qt-optional-components SerialPort) -set(qt-imported-targets Qt5::Core Qt5::Gui Qt5::Network Qt5::SerialPort Qt5::Widgets) +set(qt-imported-targets Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets) if(APPLE) list(APPEND qt-required-components "DBus") list(APPEND qt-optional-components "Multimedia") @@ -31,7 +31,9 @@ function(otr_install_qt_libs) endif() endfunction() -otr_install_qt_libs() +if(WIN32 OR APPLE) + otr_install_qt_libs() +endif() function(otr_qt n) if(".${${n}-cc}${${n}-cxx}${${n}-hh}" STREQUAL ".") diff --git a/tracker-hatire/CMakeLists.txt b/tracker-hatire/CMakeLists.txt index a73a471c..01dd52b9 100644 --- a/tracker-hatire/CMakeLists.txt +++ b/tracker-hatire/CMakeLists.txt @@ -2,4 +2,7 @@ if(Qt5SerialPort_FOUND) otr_module(tracker-hatire) target_link_libraries(${self} ${Qt5SerialPort_LIBRARIES}) target_include_directories(${self} SYSTEM PUBLIC ${Qt5SerialPort_INCLUDE_DIRS}) + if (WIN32 OR APPLE) + otr_install_lib(Qt5::SerialPort .) + endif() endif() -- cgit v1.2.3 From 4704f0f2ecd68fd0ec71f6a08f5a76d173ee43c7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 20 Jan 2023 05:51:56 +0100 Subject: cmake: recompile .rc on .ico change --- opentrack/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opentrack/CMakeLists.txt b/opentrack/CMakeLists.txt index 7a83beb6..9bf5cb9b 100644 --- a/opentrack/CMakeLists.txt +++ b/opentrack/CMakeLists.txt @@ -11,4 +11,6 @@ set_target_properties(opentrack-executable PROPERTIES PREFIX "" ) +set_source_files_properties(resources.rc OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/opentrack.ico") + target_link_libraries(${self} opentrack-user-interface opentrack-version) -- cgit v1.2.3 From 58f2a78fa1563f8b05b4895809a99cb3208e30e6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 20 Jan 2023 05:51:10 +0100 Subject: video/widget: fix size not set --- video/video-widget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/video/video-widget.cpp b/video/video-widget.cpp index c72221b0..3018a3c4 100644 --- a/video/video-widget.cpp +++ b/video/video-widget.cpp @@ -17,6 +17,10 @@ void video_widget::init_image_nolock() video_widget::video_widget(QWidget* parent) : QWidget(parent) { + if (parent) + setFixedSize(parent->size()); + else + setFixedSize(320, 240); init_image_nolock(); connect(&timer, &QTimer::timeout, this, &video_widget::draw_image, Qt::DirectConnection); timer.start(15); @@ -84,4 +88,3 @@ void video_widget::set_fresh(bool x) { fresh_.store(x, std::memory_order_release); } - -- cgit v1.2.3 From bd90aaa53751610b5b49ab9042b4612af2816f88 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 4 Jan 2023 13:08:06 +0100 Subject: tracker/nn: make dialog embeddable --- tracker-neuralnet/ftnoir_tracker_neuralnet.cpp | 20 +++++++++++++++++++- tracker-neuralnet/ftnoir_tracker_neuralnet.h | 5 +++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp index b56b4e96..59e17063 100644 --- a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp +++ b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp @@ -747,10 +747,19 @@ NeuralNetDialog::NeuralNetDialog() : tracker_status_poll_timer_.start(); } +void NeuralNetDialog::save() +{ + settings_.b->save(); +} + +void NeuralNetDialog::reload() +{ + settings_.b->reload(); +} void NeuralNetDialog::doOK() { - settings_.b->save(); + save(); close(); } @@ -793,6 +802,15 @@ void NeuralNetDialog::unregister_tracker() ui_.tcalib_button->setEnabled(false); } +bool NeuralNetDialog::embeddable() noexcept +{ + return true; +} + +void NeuralNetDialog::set_buttons_visible(bool x) +{ + ui_.buttonBox->setVisible(x); +} void NeuralNetDialog::status_poll() { diff --git a/tracker-neuralnet/ftnoir_tracker_neuralnet.h b/tracker-neuralnet/ftnoir_tracker_neuralnet.h index 9e0374da..3548335e 100644 --- a/tracker-neuralnet/ftnoir_tracker_neuralnet.h +++ b/tracker-neuralnet/ftnoir_tracker_neuralnet.h @@ -166,6 +166,9 @@ public: NeuralNetDialog(); void register_tracker(ITracker * x) override; void unregister_tracker() override; + + bool embeddable() noexcept override; + void set_buttons_visible(bool x) override; private: void make_fps_combobox(); void make_resolution_combobox(); @@ -180,6 +183,8 @@ private: NeuralNetTracker* tracker_ = nullptr; private Q_SLOTS: + void save() override; + void reload() override; void doOK(); void doCancel(); void camera_settings(); -- cgit v1.2.3 From 00b01a219f694ab8237e6e7be5776ff375a5c9d4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 4 Jan 2023 13:06:53 +0100 Subject: opentrack: add UI_NO_VIDEO_FRAME --- opentrack/defs.hpp | 2 ++ opentrack/main-window.cpp | 19 +++++++++++++++++-- opentrack/main-window.hpp | 6 ++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/opentrack/defs.hpp b/opentrack/defs.hpp index e3826474..b2f0c467 100644 --- a/opentrack/defs.hpp +++ b/opentrack/defs.hpp @@ -11,4 +11,6 @@ //#define UI_NO_RAW_DATA //#define UI_NO_GAME_DATA +//#define UI_NO_VIDEO_FEED + //define UI_ACCELA_OLD_STAIRCASE diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index deccbc5a..71ab96f5 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -67,6 +67,10 @@ main_window::main_window() : State(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH) connect(&*s.b, &options::bundle_::saving, this, &main_window::register_shortcuts); ui.btnStartTracker->setFocus(); +#ifdef UI_NO_VIDEO_FEED + fake_video_frame.resize(640, 480); + fake_video_frame_parent.setVisible(false); +#endif } void main_window::init_shortcuts() @@ -303,7 +307,11 @@ bool main_window::profile_name_from_dialog(QString& ret) main_window::~main_window() { // stupid ps3 eye has LED issues +#ifndef UI_NO_VIDEO_FEED if (work && ui.video_frame->layout()) +#else + if (work) +#endif { hide(); stop_tracker_(); @@ -411,6 +419,7 @@ void main_window::update_button_state(bool running, bool inertialp) ui.iconcomboTrackerSource->setEnabled(not_running); #endif ui.profile_button->setEnabled(not_running); +#ifndef UI_NO_VIDEO_FEED ui.video_frame_label->setVisible(not_running || inertialp); if(not_running) { @@ -419,6 +428,7 @@ void main_window::update_button_state(bool running, bool inertialp) else { ui.video_frame_label->setPixmap(QPixmap(":/images/no-feed.png")); } +#endif } void main_window::start_tracker_() @@ -426,7 +436,12 @@ void main_window::start_tracker_() if (work) return; - work = std::make_shared(pose, ui.video_frame, current_tracker(), current_protocol(), current_filter()); +#ifndef UI_NO_VIDEO_FEED + auto* frame = ui.video_frame; +#else + auto* frame = &fake_video_frame; +#endif + work = std::make_shared(pose, frame, current_tracker(), current_protocol(), current_filter()); if (!work->is_ok()) { @@ -460,7 +475,7 @@ void main_window::start_tracker_() // NB check valid since SelectedLibraries ctor called // trackers take care of layout state updates - const bool is_inertial = ui.video_frame->layout() == nullptr; + const bool is_inertial = frame->layout() == nullptr; update_button_state(true, is_inertial); ui.btnStopTracker->setFocus(); diff --git a/opentrack/main-window.hpp b/opentrack/main-window.hpp index ddb6b725..1dcbd0eb 100644 --- a/opentrack/main-window.hpp +++ b/opentrack/main-window.hpp @@ -8,6 +8,7 @@ #pragma once +#include "opentrack/defs.hpp" #include "api/plugin-support.hpp" #include "gui/mapping-dialog.hpp" #include "gui/options-dialog.hpp" @@ -50,6 +51,11 @@ class main_window final : public QMainWindow, private State Shortcuts global_shortcuts; QShortcut kbd_quit { QKeySequence("Ctrl+Q"), this }; +#ifdef UI_NO_VIDEO_FEED + QWidget fake_video_frame_parent; + QFrame fake_video_frame{&fake_video_frame_parent}; +#endif + std::unique_ptr options_widget; std::unique_ptr mapping_widget; -- cgit v1.2.3 From 2f7f6e7dc580bf313b7f70143241bbd14d633cf7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 4 Jan 2023 13:02:47 +0100 Subject: cmake/msvc: actually disable it Incremental LTO broke Wii again. --- cmake/msvc.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index ee43968f..12470eef 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -154,11 +154,11 @@ set(_CXXFLAGS_RELEASE "${_CFLAGS_RELEASE}") set(_CXXFLAGS_DEBUG "${_CFLAGS_DEBUG}") set(_LDFLAGS "-WX") -set(_LDFLAGS_RELEASE "-OPT:REF,ICF=10 -LTCG:INCREMENTAL -DEBUG:FULL") +set(_LDFLAGS_RELEASE "-OPT:REF,ICF=10 -LTCG -DEBUG:FULL") set(_LDFLAGS_DEBUG "-DEBUG:FULL") set(_LDFLAGS_STATIC "-WX") -set(_LDFLAGS_STATIC_RELEASE "-LTCG:INCREMENTAL") +set(_LDFLAGS_STATIC_RELEASE "-LTCG") set(_LDFLAGS_STATIC_DEBUG "") set(CMAKE_BUILD_TYPE_INIT "RELEASE" CACHE INTERNAL "") -- cgit v1.2.3 From 4c11e0be17ff1a96630ec2d787cc7f6bed56abc7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Mar 2023 19:13:27 +0100 Subject: opentrack: only run pose display at 30 Hz Running it at 60 Hz was using too much CPU time. --- opentrack/main-window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index 71ab96f5..59a01e00 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -471,7 +471,7 @@ void main_window::start_tracker_() options_widget->register_filter(&*work->libs.pFilter); } - pose_update_timer.start(15); + pose_update_timer.start(1000/30); // NB check valid since SelectedLibraries ctor called // trackers take care of layout state updates -- cgit v1.2.3 From 5ae2ca85c41757dd72bd8651cfddfada517b30e3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Mar 2023 23:41:49 +0100 Subject: cmake: fix -isystem in include_directories() --- cmake/opentrack-qt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index 800e9096..1735e836 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -51,7 +51,7 @@ function(otr_qt n) endfunction() function(otr_qt2 n) - target_include_directories("${n}" PRIVATE SYSTEM + target_include_directories("${n}" SYSTEM PRIVATE ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ) target_compile_definitions("${n}" PRIVATE -- cgit v1.2.3 From e8c0b30ff2db91c60b26b90054c16b22dca28956 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 1 Mar 2023 23:50:31 +0100 Subject: fix some GCC warnings --- api/plugin-api.cpp | 6 +++--- gui/options-dialog.cpp | 2 +- opentrack/main-window.cpp | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api/plugin-api.cpp b/api/plugin-api.cpp index 6a43b55d..4d8d90e9 100644 --- a/api/plugin-api.cpp +++ b/api/plugin-api.cpp @@ -21,7 +21,7 @@ void BaseDialog::done(int) bool BaseDialog::embeddable() noexcept { return false; } void BaseDialog::save() {} void BaseDialog::reload() {} -void BaseDialog::set_buttons_visible(bool x) {} +void BaseDialog::set_buttons_visible(bool) {} } // ns plugin_api::detail @@ -36,13 +36,13 @@ IFilter::IFilter() = default; IFilter::~IFilter() = default; IFilterDialog::IFilterDialog() = default; IFilterDialog::~IFilterDialog() = default; -void IFilterDialog::register_filter(IFilter* filter) {} +void IFilterDialog::register_filter(IFilter*) {} void IFilterDialog::unregister_filter() {} IProtocol::IProtocol() = default; IProtocol::~IProtocol() = default; IProtocolDialog::IProtocolDialog() = default; IProtocolDialog::~IProtocolDialog() = default; -void IProtocolDialog::register_protocol(IProtocol* protocol){} +void IProtocolDialog::register_protocol(IProtocol*){} void IProtocolDialog::unregister_protocol() {} ITracker::ITracker() = default; ITracker::~ITracker() = default; diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index ac4117bc..9cd416ee 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -172,7 +172,7 @@ options_dialog::options_dialog(std::unique_ptr& tracker_dialog_, val.label, [=](const QString&) { val.label->setText(kopts_to_string(val.opt)); }); { - connect(val.button, &QPushButton::clicked, this, [=] { bind_key(val.opt, val.label); }); + connect(val.button, &QPushButton::clicked, this, [=, this] { bind_key(val.opt, val.label); }); } } diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index 59a01e00..f449845b 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -683,7 +683,6 @@ static void show_module_settings(std::shared_ptr instance, void(Dialog::*register_fun)(Instance*), void(options_dialog::*switch_tab_fun)()) { - using BaseDialog = plugin_api::detail::BaseDialog; if (!lib || !lib->Dialog) return; -- cgit v1.2.3 From c8cccf1a21b600efd89258f48ef6dacaf187e96b Mon Sep 17 00:00:00 2001 From: Davide Mameli Date: Tue, 7 Mar 2023 12:51:23 +0100 Subject: Initial commit --- tracker-eyeware-beam/CMakeLists.txt | 16 +++++ tracker-eyeware-beam/eyeware_beam.cpp | 111 +++++++++++++++++++++++++++++ tracker-eyeware-beam/eyeware_beam.h | 74 +++++++++++++++++++ tracker-eyeware-beam/eyeware_beam.qrc | 5 ++ tracker-eyeware-beam/eyeware_beam.ui | 90 +++++++++++++++++++++++ tracker-eyeware-beam/eyeware_beam_logo.png | Bin 0 -> 2032 bytes tracker-eyeware-beam/lang/nl_NL.ts | 20 ++++++ tracker-eyeware-beam/lang/ru_RU.ts | 20 ++++++ tracker-eyeware-beam/lang/stub.ts | 20 ++++++ tracker-eyeware-beam/lang/zh_CN.ts | 20 ++++++ 10 files changed, 376 insertions(+) create mode 100644 tracker-eyeware-beam/CMakeLists.txt create mode 100644 tracker-eyeware-beam/eyeware_beam.cpp create mode 100644 tracker-eyeware-beam/eyeware_beam.h create mode 100644 tracker-eyeware-beam/eyeware_beam.qrc create mode 100644 tracker-eyeware-beam/eyeware_beam.ui create mode 100644 tracker-eyeware-beam/eyeware_beam_logo.png create mode 100644 tracker-eyeware-beam/lang/nl_NL.ts create mode 100644 tracker-eyeware-beam/lang/ru_RU.ts create mode 100644 tracker-eyeware-beam/lang/stub.ts create mode 100644 tracker-eyeware-beam/lang/zh_CN.ts diff --git a/tracker-eyeware-beam/CMakeLists.txt b/tracker-eyeware-beam/CMakeLists.txt new file mode 100644 index 00000000..b9e85f0d --- /dev/null +++ b/tracker-eyeware-beam/CMakeLists.txt @@ -0,0 +1,16 @@ +set(SDK_EYEWARE_BEAM "" CACHE PATH "Eyeware Beam SDK path") +if(WIN32 AND SDK_EYEWARE_BEAM) + otr_module(tracker-eyeware-beam) + + target_include_directories(${self} SYSTEM PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/include") + target_link_directories(${self} SYSTEM PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/lib") + set(dll "${SDK_EYEWARE_BEAM}/API/cpp/lib/tracker_client.dll" "${SDK_EYEWARE_BEAM}/API/cpp/lib/libsodium.dll") + set(lib tracker_client) + + message(${self}) + message(${dll}) + message(${lib}) + + target_link_libraries(${self} ${lib}) + install(FILES ${dll} DESTINATION ${opentrack-libexec}) +endif() diff --git a/tracker-eyeware-beam/eyeware_beam.cpp b/tracker-eyeware-beam/eyeware_beam.cpp new file mode 100644 index 00000000..6762b1bf --- /dev/null +++ b/tracker-eyeware-beam/eyeware_beam.cpp @@ -0,0 +1,111 @@ +/* Copyright (c) 2023 Eyeware Tech SA https://www.eyeware.tech + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "eyeware_beam.h" + +#include + +eyeware_beam_tracker::eyeware_beam_tracker() +{ +} + +eyeware_beam_tracker::~eyeware_beam_tracker() +{ + QMutexLocker lck(&mtx); + tracker_client.reset(nullptr); +} + +module_status eyeware_beam_tracker::start_tracker(QFrame* videoframe) +{ + QMutexLocker lck(&mtx); + try + { + tracker_client = std::make_unique(); + } + catch (...) + { + return error("Eyeware Beam initialization has failed"); + } + + return status_ok(); +} + +void eyeware_beam_tracker::extract_translation(const eyeware::Vector3D& t, + double& translation_x_cm, + double& translation_y_cm, + double& translation_z_cm) +{ + translation_x_cm = +t.x * m_to_cm; + translation_y_cm = -t.y * m_to_cm; + translation_z_cm = +t.z * m_to_cm; +} + +void eyeware_beam_tracker::extract_rotation_angles(const eyeware::Matrix3x3& R, + double& pitch_deg, + double& roll_deg, + double& yaw_deg) +{ + double r00 = static_cast(R[0][0]); + double r01 = static_cast(R[0][1]); + double r02 = static_cast(R[0][2]); + double r10 = static_cast(R[1][0]); + double r11 = static_cast(R[1][1]); + double r12 = static_cast(R[1][2]); + double r20 = static_cast(R[2][0]); + double r21 = static_cast(R[2][1]); + double r22 = static_cast(R[2][2]); + + double dy = std::sqrt(r00 * r00 + r10 * r10); + last_yaw_deg = -std::atan2(-r20, dy) * rad_to_deg; + last_roll_deg = 0.0; + if (dy > epsilon) + { + last_pitch_deg = -std::atan2(r21, r22) * rad_to_deg; + last_roll_deg = +std::atan2(r10, r00) * rad_to_deg; + } + else + { + last_pitch_deg = -std::atan2(-r12, r11) * rad_to_deg; + } +} + +void eyeware_beam_tracker::data(double *data) +{ + QMutexLocker lck(&mtx); + + if (tracker_client && tracker_client->connected()) + { + eyeware::HeadPoseInfo head_pose_info = tracker_client->get_head_pose_info(); + if (!head_pose_info.is_lost) + { + extract_translation(head_pose_info.transform.translation, last_translation_x_cm, + last_translation_y_cm, last_translation_z_cm); + extract_rotation_angles(head_pose_info.transform.rotation, last_pitch_deg, last_roll_deg, last_yaw_deg); + } + } + + data[TX] = last_translation_x_cm; + data[TY] = last_translation_y_cm; + data[TZ] = last_translation_z_cm; + data[Yaw] = last_yaw_deg; + data[Pitch] = last_pitch_deg; + data[Roll] = last_roll_deg; +} + +eyeware_beam_dialog::eyeware_beam_dialog() +{ + ui.setupUi(this); + + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); +} + +void eyeware_beam_dialog::doOK() +{ + close(); +} + +OPENTRACK_DECLARE_TRACKER(eyeware_beam_tracker, eyeware_beam_dialog, eyeware_beam_metadata) diff --git a/tracker-eyeware-beam/eyeware_beam.h b/tracker-eyeware-beam/eyeware_beam.h new file mode 100644 index 00000000..b30703bc --- /dev/null +++ b/tracker-eyeware-beam/eyeware_beam.h @@ -0,0 +1,74 @@ +/* Copyright (c) 2023 Eyeware Tech SA https://www.eyeware.tech + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#pragma once + +#include "api/plugin-api.hpp" + +#include "ui_eyeware_beam.h" + +#include "eyeware/tracker_client.h" + +#include +#include + +class eyeware_beam_tracker : public QObject, public ITracker +{ + Q_OBJECT + +public: + eyeware_beam_tracker(); + ~eyeware_beam_tracker() override; + module_status start_tracker(QFrame* frame) override; + void data(double *data) override; + +private: + void extract_translation(const eyeware::Vector3D& t, + double& translation_x_cm, + double& translation_y_cm, + double& translation_z_cm); + void extract_rotation_angles(const eyeware::Matrix3x3& R, double& pitch_deg, double& roll_deg, double& yaw_deg); + + std::unique_ptr tracker_client = nullptr; + + QMutex mtx; + + double last_pitch_deg = 0.0; + double last_roll_deg = 0.0; + double last_yaw_deg = 0.0; + double last_translation_x_cm = 0.0; + double last_translation_y_cm = 0.0; + double last_translation_z_cm = 0.0; + + const double rad_to_deg = 180.0 / M_PI; + const double m_to_cm = 100.0; + const double epsilon = 0.000001; +}; + +class eyeware_beam_dialog : public ITrackerDialog +{ + Q_OBJECT + +public: + eyeware_beam_dialog(); + void register_tracker(ITracker * x) override { tracker = static_cast(x); } + void unregister_tracker() override { tracker = nullptr; } + +private: + Ui::eyeware_beam_ui ui; + eyeware_beam_tracker* tracker = nullptr; + +private Q_SLOTS: + void doOK(); +}; + +class eyeware_beam_metadata : public Metadata +{ + Q_OBJECT + QString name() override { return QString("Eyeware Beam"); } + QIcon icon() override { return QIcon(":/images/eyeware_beam_logo.png"); } +}; diff --git a/tracker-eyeware-beam/eyeware_beam.qrc b/tracker-eyeware-beam/eyeware_beam.qrc new file mode 100644 index 00000000..ae20865e --- /dev/null +++ b/tracker-eyeware-beam/eyeware_beam.qrc @@ -0,0 +1,5 @@ + + + eyeware_beam_logo.png + + diff --git a/tracker-eyeware-beam/eyeware_beam.ui b/tracker-eyeware-beam/eyeware_beam.ui new file mode 100644 index 00000000..475db6a0 --- /dev/null +++ b/tracker-eyeware-beam/eyeware_beam.ui @@ -0,0 +1,90 @@ + + + eyeware_beam_ui + + + Qt::NonModal + + + + 0 + 0 + 433 + 180 + + + + + 0 + 0 + + + + Eyeware Beam + + + + :/images/eyeware_beam_logo.png:/images/eyeware_beam_logo.png + + + Qt::LeftToRight + + + false + + + + + + QFrame::Raised + + + + + + + 0 + 0 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Please make sure the Eyeware Beam application is running and tracking is active.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">To download, visit <a href="https://beam.eyeware.tech/opentrack"><span style=" text-decoration: underline; color:#0000ff;">https://beam.eyeware.tech/opentrack</span></a>.</p></body></html> + + + true + + + + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Ok + + + + + + + + + + + startEngineClicked() + stopEngineClicked() + cameraSettingsClicked() + + diff --git a/tracker-eyeware-beam/eyeware_beam_logo.png b/tracker-eyeware-beam/eyeware_beam_logo.png new file mode 100644 index 00000000..6a611cac Binary files /dev/null and b/tracker-eyeware-beam/eyeware_beam_logo.png differ diff --git a/tracker-eyeware-beam/lang/nl_NL.ts b/tracker-eyeware-beam/lang/nl_NL.ts new file mode 100644 index 00000000..d70f58ed --- /dev/null +++ b/tracker-eyeware-beam/lang/nl_NL.ts @@ -0,0 +1,20 @@ + + + + + eyeware_beam_ui + + Eyeware Beam + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Please make sure the Eyeware Beam application is running and tracking is active.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">To download, visit <a href="https://beam.eyeware.tech/opentrack"><span style=" text-decoration: underline; color:#0000ff;">https://beam.eyeware.tech/opentrack</span></a>.</p></body></html> + + + + diff --git a/tracker-eyeware-beam/lang/ru_RU.ts b/tracker-eyeware-beam/lang/ru_RU.ts new file mode 100644 index 00000000..0bff47ae --- /dev/null +++ b/tracker-eyeware-beam/lang/ru_RU.ts @@ -0,0 +1,20 @@ + + + + + eyeware_beam_ui + + Eyeware Beam + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Please make sure the Eyeware Beam application is running and tracking is active.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">To download, visit <a href="https://beam.eyeware.tech/opentrack"><span style=" text-decoration: underline; color:#0000ff;">https://beam.eyeware.tech/opentrack</span></a>.</p></body></html> + + + + diff --git a/tracker-eyeware-beam/lang/stub.ts b/tracker-eyeware-beam/lang/stub.ts new file mode 100644 index 00000000..c64ff83e --- /dev/null +++ b/tracker-eyeware-beam/lang/stub.ts @@ -0,0 +1,20 @@ + + + + + eyeware_beam_ui + + Eyeware Beam + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Please make sure the Eyeware Beam application is running and tracking is active.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">To download, visit <a href="https://beam.eyeware.tech/opentrack"><span style=" text-decoration: underline; color:#0000ff;">https://beam.eyeware.tech/opentrack</span></a>.</p></body></html> + + + + diff --git a/tracker-eyeware-beam/lang/zh_CN.ts b/tracker-eyeware-beam/lang/zh_CN.ts new file mode 100644 index 00000000..aed44317 --- /dev/null +++ b/tracker-eyeware-beam/lang/zh_CN.ts @@ -0,0 +1,20 @@ + + + + + eyeware_beam_ui + + Eyeware Beam + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Please make sure the Eyeware Beam application is running and tracking is active.</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">To download, visit <a href="https://beam.eyeware.tech/opentrack"><span style=" text-decoration: underline; color:#0000ff;">https://beam.eyeware.tech/opentrack</span></a>.</p></body></html> + + + + -- cgit v1.2.3 From dc4147f0d681ea2b6c22570fe968936604d6c3ba Mon Sep 17 00:00:00 2001 From: Davide Mameli Date: Tue, 7 Mar 2023 17:06:42 +0100 Subject: Provide links to the Eyeware Beam SDK --- tracker-eyeware-beam/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tracker-eyeware-beam/CMakeLists.txt b/tracker-eyeware-beam/CMakeLists.txt index b9e85f0d..b9749b19 100644 --- a/tracker-eyeware-beam/CMakeLists.txt +++ b/tracker-eyeware-beam/CMakeLists.txt @@ -1,3 +1,5 @@ +# The Eyeware Beam SDK can be found at https://beam.eyeware.tech/developers/ +# The latest version can be downloaded at https://eyewarecistorage.blob.core.windows.net/beam-sdk/BeamSDK-Windows64-1.1.0.zip set(SDK_EYEWARE_BEAM "" CACHE PATH "Eyeware Beam SDK path") if(WIN32 AND SDK_EYEWARE_BEAM) otr_module(tracker-eyeware-beam) -- cgit v1.2.3 From 0e98b6654e2ee782803c8818400a478e0346036d Mon Sep 17 00:00:00 2001 From: eyedav <88885346+eyedav@users.noreply.github.com> Date: Wed, 15 Mar 2023 17:13:08 +0100 Subject: Get SDK_EYEWARE_BEAM from opentrack-depends (Windows builds only) --- sdk-paths-sthalik@Clang-windows.cmake | 2 ++ sdk-paths-sthalik@GNU-windows.cmake | 2 ++ sdk-paths-sthalik@MSVC-windows.cmake | 1 + 3 files changed, 5 insertions(+) diff --git a/sdk-paths-sthalik@Clang-windows.cmake b/sdk-paths-sthalik@Clang-windows.cmake index 895d68b2..25fec0a6 100644 --- a/sdk-paths-sthalik@Clang-windows.cmake +++ b/sdk-paths-sthalik@Clang-windows.cmake @@ -31,6 +31,8 @@ setq(SDK_VJOYSTICK "vjoystick") setq(SDK_REALSENSE "RSSDK-R2") +setq(SDK_EYEWARE_BEAM "eyeware-beam-sdk") + # WARNING: this is utter experimental nonsense set(_cxxflags -Weverything diff --git a/sdk-paths-sthalik@GNU-windows.cmake b/sdk-paths-sthalik@GNU-windows.cmake index b9617719..fe496ae8 100644 --- a/sdk-paths-sthalik@GNU-windows.cmake +++ b/sdk-paths-sthalik@GNU-windows.cmake @@ -31,6 +31,8 @@ setq(SDK_VJOYSTICK "vjoystick") setq(SDK_REALSENSE "RSSDK-R2") +setq(SDK_EYEWARE_BEAM "eyeware-beam-sdk") + set(base-flags "-Wall -Wextra -Wpedantic") set(CMAKE_C_FLAGS "-std=c11 ${base-flags} -ggdb ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-std=c++17 ${base-flags} -ggdb ${CMAKE_CXX_FLAGS}") diff --git a/sdk-paths-sthalik@MSVC-windows.cmake b/sdk-paths-sthalik@MSVC-windows.cmake index 7df31152..c6a93f69 100644 --- a/sdk-paths-sthalik@MSVC-windows.cmake +++ b/sdk-paths-sthalik@MSVC-windows.cmake @@ -24,6 +24,7 @@ setq(EIGEN3_INCLUDE_DIR "eigen") setq(OpenCV_DIR "opencv/build/install") setq(SDL2_DIR "SDL2-win32") setq(SDK_ARUCO_LIBPATH "aruco/build/src/aruco.lib") +setq(SDK_EYEWARE_BEAM "eyeware-beam-sdk") setq(SDK_FSUIPC "fsuipc") setq(SDK_HYDRA "SixenseSDK") setq(SDK_KINECT20 "Kinect-v2.0") -- cgit v1.2.3 From 8b7d94cf493ef14134422b768a9ecc5ec7f99cab Mon Sep 17 00:00:00 2001 From: eyedav <88885346+eyedav@users.noreply.github.com> Date: Fri, 17 Mar 2023 18:14:29 +0100 Subject: Apply suggestions from code review Co-authored-by: Stanislaw Halik --- tracker-eyeware-beam/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tracker-eyeware-beam/CMakeLists.txt b/tracker-eyeware-beam/CMakeLists.txt index b9749b19..3a75f61a 100644 --- a/tracker-eyeware-beam/CMakeLists.txt +++ b/tracker-eyeware-beam/CMakeLists.txt @@ -2,6 +2,9 @@ # The latest version can be downloaded at https://eyewarecistorage.blob.core.windows.net/beam-sdk/BeamSDK-Windows64-1.1.0.zip set(SDK_EYEWARE_BEAM "" CACHE PATH "Eyeware Beam SDK path") if(WIN32 AND SDK_EYEWARE_BEAM) + if(MSVC) + add_compile_options(-EHsc) + endif() otr_module(tracker-eyeware-beam) target_include_directories(${self} SYSTEM PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/include") @@ -9,9 +12,9 @@ if(WIN32 AND SDK_EYEWARE_BEAM) set(dll "${SDK_EYEWARE_BEAM}/API/cpp/lib/tracker_client.dll" "${SDK_EYEWARE_BEAM}/API/cpp/lib/libsodium.dll") set(lib tracker_client) - message(${self}) - message(${dll}) - message(${lib}) + #message(${self}) + #message(${dll}) + #message(${lib}) target_link_libraries(${self} ${lib}) install(FILES ${dll} DESTINATION ${opentrack-libexec}) -- cgit v1.2.3 From 714cb7cebc3824feb70828dada552ca7e0e0703d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 17 Mar 2023 21:39:37 +0100 Subject: clang-tidy: update --- .clang-tidy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index 28fe3584..a98ed056 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -19,6 +19,8 @@ clang-analyzer-core.CallAndMessage, clang-analyzer-deadcode.DeadStores, -clang-diagnostic-nonportable-include-path, -cppcoreguidelines-avoid-c-arrays, +-cppcoreguidelines-avoid-capture-default-when-capturing-this, +-cppcoreguidelines-avoid-do-while, -cppcoreguidelines-avoid-goto, -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-c-copy-assignment-signature, -- cgit v1.2.3 From 3734494677c4f9aba863ffebfecb28755c6e0493 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 17 Mar 2023 21:40:56 +0100 Subject: tracker/trackhat: update i18n --- tracker-trackhat/lang/nl_NL.ts | 2 +- tracker-trackhat/lang/ru_RU.ts | 2 +- tracker-trackhat/lang/stub.ts | 2 +- tracker-trackhat/lang/zh_CN.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tracker-trackhat/lang/nl_NL.ts b/tracker-trackhat/lang/nl_NL.ts index 9cc67677..ebc53a27 100644 --- a/tracker-trackhat/lang/nl_NL.ts +++ b/tracker-trackhat/lang/nl_NL.ts @@ -147,7 +147,7 @@ trackhat_module - TrackHat Point Tracker + TrackHat v1 Sensor diff --git a/tracker-trackhat/lang/ru_RU.ts b/tracker-trackhat/lang/ru_RU.ts index 844c5519..49d247be 100644 --- a/tracker-trackhat/lang/ru_RU.ts +++ b/tracker-trackhat/lang/ru_RU.ts @@ -147,7 +147,7 @@ trackhat_module - TrackHat Point Tracker + TrackHat v1 Sensor diff --git a/tracker-trackhat/lang/stub.ts b/tracker-trackhat/lang/stub.ts index 127d0691..adb23557 100644 --- a/tracker-trackhat/lang/stub.ts +++ b/tracker-trackhat/lang/stub.ts @@ -147,7 +147,7 @@ trackhat_module - TrackHat Point Tracker + TrackHat v1 Sensor diff --git a/tracker-trackhat/lang/zh_CN.ts b/tracker-trackhat/lang/zh_CN.ts index 179d4261..5837eeb1 100644 --- a/tracker-trackhat/lang/zh_CN.ts +++ b/tracker-trackhat/lang/zh_CN.ts @@ -147,7 +147,7 @@ trackhat_module - TrackHat Point Tracker + TrackHat v1 Sensor -- cgit v1.2.3 From b35641308049d7484296cebc68ec7882d966c6e8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 17 Mar 2023 21:41:46 +0100 Subject: tracker/beam: trivial build fixes only Issue: #1625 --- sdk-paths-sthalik@Clang-windows.cmake | 2 -- sdk-paths-sthalik@GNU-windows.cmake | 2 -- sdk-paths-sthalik@MSVC-windows.cmake | 4 ++-- tracker-eyeware-beam/CMakeLists.txt | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sdk-paths-sthalik@Clang-windows.cmake b/sdk-paths-sthalik@Clang-windows.cmake index 25fec0a6..895d68b2 100644 --- a/sdk-paths-sthalik@Clang-windows.cmake +++ b/sdk-paths-sthalik@Clang-windows.cmake @@ -31,8 +31,6 @@ setq(SDK_VJOYSTICK "vjoystick") setq(SDK_REALSENSE "RSSDK-R2") -setq(SDK_EYEWARE_BEAM "eyeware-beam-sdk") - # WARNING: this is utter experimental nonsense set(_cxxflags -Weverything diff --git a/sdk-paths-sthalik@GNU-windows.cmake b/sdk-paths-sthalik@GNU-windows.cmake index fe496ae8..b9617719 100644 --- a/sdk-paths-sthalik@GNU-windows.cmake +++ b/sdk-paths-sthalik@GNU-windows.cmake @@ -31,8 +31,6 @@ setq(SDK_VJOYSTICK "vjoystick") setq(SDK_REALSENSE "RSSDK-R2") -setq(SDK_EYEWARE_BEAM "eyeware-beam-sdk") - set(base-flags "-Wall -Wextra -Wpedantic") set(CMAKE_C_FLAGS "-std=c11 ${base-flags} -ggdb ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-std=c++17 ${base-flags} -ggdb ${CMAKE_CXX_FLAGS}") diff --git a/sdk-paths-sthalik@MSVC-windows.cmake b/sdk-paths-sthalik@MSVC-windows.cmake index c6a93f69..be85db85 100644 --- a/sdk-paths-sthalik@MSVC-windows.cmake +++ b/sdk-paths-sthalik@MSVC-windows.cmake @@ -24,7 +24,7 @@ setq(EIGEN3_INCLUDE_DIR "eigen") setq(OpenCV_DIR "opencv/build/install") setq(SDL2_DIR "SDL2-win32") setq(SDK_ARUCO_LIBPATH "aruco/build/src/aruco.lib") -setq(SDK_EYEWARE_BEAM "eyeware-beam-sdk") +setq(SDK_EYEWARE_BEAM "BeamSDK-Windows64-1.1.0") setq(SDK_FSUIPC "fsuipc") setq(SDK_HYDRA "SixenseSDK") setq(SDK_KINECT20 "Kinect-v2.0") @@ -35,7 +35,7 @@ setq(SDK_RIFT_140 "ovr_sdk_win_23.0.0/LibOVR") setq(SDK_VALVE_STEAMVR "steamvr") setq(SDK_VJOYSTICK "vjoystick") setq(ONNXRuntime_DIR "onnxruntime-1.12.1") -setq(SDK_TRACKHAT_SENSOR "../trackhat/trackhat-c-library-driver/build/install") +setq(SDK_TRACKHAT_SENSOR "trackhat-c-library-driver/build/install") set(CMAKE_ASM_NASM_COMPILER nasm.exe CACHE FILEPATH "" FORCE) diff --git a/tracker-eyeware-beam/CMakeLists.txt b/tracker-eyeware-beam/CMakeLists.txt index 3a75f61a..73ea231a 100644 --- a/tracker-eyeware-beam/CMakeLists.txt +++ b/tracker-eyeware-beam/CMakeLists.txt @@ -8,9 +8,9 @@ if(WIN32 AND SDK_EYEWARE_BEAM) otr_module(tracker-eyeware-beam) target_include_directories(${self} SYSTEM PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/include") - target_link_directories(${self} SYSTEM PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/lib") + target_link_directories(${self} PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/lib") set(dll "${SDK_EYEWARE_BEAM}/API/cpp/lib/tracker_client.dll" "${SDK_EYEWARE_BEAM}/API/cpp/lib/libsodium.dll") - set(lib tracker_client) + set(lib tracker_client.lib) #message(${self}) #message(${dll}) -- cgit v1.2.3 From 7519fe5fa5925da20ad7fe435b686f8c41adcfd7 Mon Sep 17 00:00:00 2001 From: eyedav <88885346+eyedav@users.noreply.github.com> Date: Mon, 20 Mar 2023 17:03:45 +0100 Subject: Eyeware Beam using the C API --- tracker-eyeware-beam/eyeware_beam.cpp | 13 +++++++++---- tracker-eyeware-beam/eyeware_beam.h | 6 +----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tracker-eyeware-beam/eyeware_beam.cpp b/tracker-eyeware-beam/eyeware_beam.cpp index 6762b1bf..f48b5d4d 100644 --- a/tracker-eyeware-beam/eyeware_beam.cpp +++ b/tracker-eyeware-beam/eyeware_beam.cpp @@ -9,6 +9,10 @@ #include +static constexpr double rad_to_deg = 180.0 / M_PI; +static constexpr double m_to_cm = 100.0; +static constexpr double epsilon = 0.000001; + eyeware_beam_tracker::eyeware_beam_tracker() { } @@ -16,7 +20,8 @@ eyeware_beam_tracker::eyeware_beam_tracker() eyeware_beam_tracker::~eyeware_beam_tracker() { QMutexLocker lck(&mtx); - tracker_client.reset(nullptr); + release_tracker_instance(tracker_client); + tracker_client = nullptr; } module_status eyeware_beam_tracker::start_tracker(QFrame* videoframe) @@ -24,7 +29,7 @@ module_status eyeware_beam_tracker::start_tracker(QFrame* videoframe) QMutexLocker lck(&mtx); try { - tracker_client = std::make_unique(); + tracker_client = create_tracker_instance("127.0.0.1", 12010); } catch (...) { @@ -77,9 +82,9 @@ void eyeware_beam_tracker::data(double *data) { QMutexLocker lck(&mtx); - if (tracker_client && tracker_client->connected()) + if (connected(tracker_client)) { - eyeware::HeadPoseInfo head_pose_info = tracker_client->get_head_pose_info(); + eyeware::HeadPoseInfo head_pose_info = get_head_pose_info(tracker_client); if (!head_pose_info.is_lost) { extract_translation(head_pose_info.transform.translation, last_translation_x_cm, diff --git a/tracker-eyeware-beam/eyeware_beam.h b/tracker-eyeware-beam/eyeware_beam.h index b30703bc..9ebf1f3c 100644 --- a/tracker-eyeware-beam/eyeware_beam.h +++ b/tracker-eyeware-beam/eyeware_beam.h @@ -33,7 +33,7 @@ private: double& translation_z_cm); void extract_rotation_angles(const eyeware::Matrix3x3& R, double& pitch_deg, double& roll_deg, double& yaw_deg); - std::unique_ptr tracker_client = nullptr; + eyeware::TrackerClient* tracker_client = nullptr; QMutex mtx; @@ -43,10 +43,6 @@ private: double last_translation_x_cm = 0.0; double last_translation_y_cm = 0.0; double last_translation_z_cm = 0.0; - - const double rad_to_deg = 180.0 / M_PI; - const double m_to_cm = 100.0; - const double epsilon = 0.000001; }; class eyeware_beam_dialog : public ITrackerDialog -- cgit v1.2.3 From 6cae7618972a7e7f553693875c7b78e023ad7182 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Mar 2023 20:17:16 +0100 Subject: cmake: reformat status message block --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c6613bd..bb1cfff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,24 +110,24 @@ otr_merge_translations() include(opentrack-install) string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) -message(STATUS "-- Compile flags:") +message("Compile flags:") #foreach(j C CXX) foreach(j CXX) foreach(i "" "_${CMAKE_BUILD_TYPE}") - message(STATUS " ${j}${i}: ${CMAKE_${j}_FLAGS${i}}") + message(" ${j}${i}: ${CMAKE_${j}_FLAGS${i}}") endforeach() endforeach() -message(STATUS "-- Link flags:") +message("Link flags:") foreach(j "" "_${CMAKE_BUILD_TYPE}") #foreach(i EXE SHARED) foreach(i SHARED) - message(STATUS " LINK_${i}${j}: ${CMAKE_${i}_LINKER_FLAGS${j}}") + message(" LINK_${i}${j}: ${CMAKE_${i}_LINKER_FLAGS${j}}") endforeach() endforeach() -message(STATUS "-- Static archive flags:") +message("Static archive flags:") foreach(k "" "_${CMAKE_BUILD_TYPE}") - message(STATUS " STATIC${k}: ${CMAKE_STATIC_LINKER_FLAGS${k}}") + message(" STATIC${k}: ${CMAKE_STATIC_LINKER_FLAGS${k}}") endforeach() -message(STATUS "--") +message("--") -- cgit v1.2.3 From d6f88a728bf1e5a2d8a35bfb3f67a35691358983 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Mar 2023 20:17:38 +0100 Subject: cmake: update msvc toolchain file --- cmake/msvc.cmake | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index 12470eef..e7e3c329 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -111,24 +111,33 @@ set(opentrack-simd "SSE2") if(CMAKE_PROJECT_NAME STREQUAL "onnxruntime") set(opentrack-simd "AVX") + if(opentrack-no-static-crt) + sets(BOOL + ONNX_USE_MSVC_STATIC_RUNTIME OFF + protobuf_MSVC_STATIC_RUNTIME OFF + ) + else() + sets(BOOL + ONNX_USE_MSVC_STATIC_RUNTIME ON + protobuf_MSVC_STATIC_RUNTIME ON + ) + endif() sets(BOOL - onnxruntime_USE_AVX ON - onnxruntime_USE_AVX2 OFF - onnxruntime_USE_AVX512 OFF - ONNX_USE_MSVC_STATIC_RUNTIME ON - protobuf_MSVC_STATIC_RUNTIME ON - onnxruntime_BUILD_BENCHMARKS OFF - onnxruntime_BUILD_FOR_NATIVE_MACHINE OFF - onnxruntime_BUILD_SHARED_LIB ON - onnxruntime_BUILD_UNIT_TESTS OFF - protobuf_BUILD_EXAMPLES OFF - protobuf_BUILD_SHARED_LIBS OFF - ONNX_BUILD_BENCHMARKS OFF - ONNX_BUILD_TESTS OFF - ONNX_DISABLE_EXCEPTIONS OFF # important! - ONNX_GEN_PB_TYPE_STUBS OFF - onnxruntime_DISABLE_CONTRIB_OPS ON - BUILD_TESTING OFF + onnxruntime_USE_AVX ON + onnxruntime_USE_AVX2 OFF + onnxruntime_USE_AVX512 OFF + onnxruntime_BUILD_BENCHMARKS OFF + onnxruntime_BUILD_FOR_NATIVE_MACHINE OFF + onnxruntime_BUILD_SHARED_LIB ON + onnxruntime_BUILD_UNIT_TESTS OFF + protobuf_BUILD_EXAMPLES OFF + protobuf_BUILD_SHARED_LIBS OFF + ONNX_BUILD_BENCHMARKS OFF + ONNX_BUILD_TESTS OFF + ONNX_DISABLE_EXCEPTIONS OFF # important! + ONNX_GEN_PB_TYPE_STUBS OFF + onnxruntime_DISABLE_CONTRIB_OPS ON + BUILD_TESTING OFF ) elseif(opentrack-64bit) set(opentrack-simd "AVX") -- cgit v1.2.3 From c0d8a8e270d27a2859ce306c2d43f16cba720b0f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Mar 2023 20:18:10 +0100 Subject: cmake: remove unused cache variable --- cmake/opentrack-platform.cmake | 2 -- sdk-paths-sthalik@MSVC-windows.cmake | 1 - 2 files changed, 3 deletions(-) diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index fd82c1b5..7aceb17a 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -34,8 +34,6 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "" FORCE) include_directories("${CMAKE_SOURCE_DIR}") -set(opentrack_maintainer-mode FALSE CACHE INTERNAL "Select if developing core code (not modules)") - set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) set(CMAKE_CXX_STANDARD 20) diff --git a/sdk-paths-sthalik@MSVC-windows.cmake b/sdk-paths-sthalik@MSVC-windows.cmake index be85db85..8fd1b239 100644 --- a/sdk-paths-sthalik@MSVC-windows.cmake +++ b/sdk-paths-sthalik@MSVC-windows.cmake @@ -18,7 +18,6 @@ function(setq name value) endfunction() set(opentrack_install-debug-info TRUE CACHE INTERNAL "" FORCE) -set(opentrack_maintainer-mode TRUE CACHE INTERNAL "" FORCE) setq(EIGEN3_INCLUDE_DIR "eigen") setq(OpenCV_DIR "opencv/build/install") -- cgit v1.2.3 From 5eab4fb1d326cc2036f4d4809bba6193b55f124f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Mar 2023 20:18:20 +0100 Subject: clang-tidy: update --- .clang-tidy | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-tidy b/.clang-tidy index a98ed056..a29d0ffd 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -63,6 +63,7 @@ clang-analyzer-deadcode.DeadStores, -hicpp-use-override, -hicpp-vararg, -misc-non-private-member-variables-in-classes, +-misc-use-anonymous-namespace, -modernize-avoid-c-arrays, -modernize-loop-convert, -modernize-pass-by-value, -- cgit v1.2.3 From 8403a2d052ef4230f903d2de12cb886300ce677e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Mar 2023 20:18:34 +0100 Subject: cmake: add 64-bit sdk's to my userconfig --- sdk-paths-sthalik@MSVC-windows.cmake | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/sdk-paths-sthalik@MSVC-windows.cmake b/sdk-paths-sthalik@MSVC-windows.cmake index 8fd1b239..8f185695 100644 --- a/sdk-paths-sthalik@MSVC-windows.cmake +++ b/sdk-paths-sthalik@MSVC-windows.cmake @@ -20,25 +20,36 @@ endfunction() set(opentrack_install-debug-info TRUE CACHE INTERNAL "" FORCE) setq(EIGEN3_INCLUDE_DIR "eigen") -setq(OpenCV_DIR "opencv/build/install") -setq(SDL2_DIR "SDL2-win32") -setq(SDK_ARUCO_LIBPATH "aruco/build/src/aruco.lib") -setq(SDK_EYEWARE_BEAM "BeamSDK-Windows64-1.1.0") -setq(SDK_FSUIPC "fsuipc") -setq(SDK_HYDRA "SixenseSDK") +setq(SDK_RIFT_140 "ovr_sdk_win_23.0.0/LibOVR") setq(SDK_KINECT20 "Kinect-v2.0") -setq(SDK_LIBUSB "libusb-msvc-x86") +setq(SDK_VJOYSTICK "vjoystick") setq(SDK_PS3EYEDRIVER "PS3EYEDriver") setq(SDK_REALSENSE "RSSDK-R2") -setq(SDK_RIFT_140 "ovr_sdk_win_23.0.0/LibOVR") setq(SDK_VALVE_STEAMVR "steamvr") -setq(SDK_VJOYSTICK "vjoystick") +setq(SDK_FSUIPC "fsuipc") +setq(SDK_HYDRA "SixenseSDK") +if(CMAKE_SIZEOF_VOID_P EQUAL 8) +setq(Qt5_DIR "../qt-5.15-kde-amd64/lib/cmake/Qt5") +setq(OpenCV_DIR "opencv/build-amd64/install") +setq(SDK_ARUCO_LIBPATH "aruco/build-amd64/src/aruco.lib") +setq(SDK_LIBUSB "libusb-msvc-amd64") +setq(ONNXRuntime_DIR "onnxruntime-1.12.1-amd64") +setq(SDK_TRACKHAT_SENSOR "trackhat-c-library-driver/build-amd64/install") +setq(SDK_EYEWARE_BEAM "BeamSDK-Windows64-1.1.0") +elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) +setq(Qt5_DIR "../qt-5.15-kde/lib/cmake/Qt5") +setq(OpenCV_DIR "opencv/build/install") +setq(SDK_ARUCO_LIBPATH "aruco/build/src/aruco.lib") +setq(SDK_LIBUSB "libusb-msvc-x86") setq(ONNXRuntime_DIR "onnxruntime-1.12.1") setq(SDK_TRACKHAT_SENSOR "trackhat-c-library-driver/build/install") +set(SDK_EYEWARE_BEAM "" CACHE PATH "" FORCE) +else() + message(FATAL_ERROR "unknown word size ${CMAKE_SIZEOF_VOID_P}b") +endif() set(CMAKE_ASM_NASM_COMPILER nasm.exe CACHE FILEPATH "" FORCE) -setq(Qt5_DIR "../qt-5.15-kde/lib/cmake/Qt5") set(Qt5Core_DIR "${Qt5_DIR}Core" CACHE PATH "" FORCE) set(Qt5Gui_DIR "${Qt5_DIR}Gui" CACHE PATH "" FORCE) -- cgit v1.2.3 From 4cd4909935e909cd6ebffd347de78136bc3a131e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Mar 2023 10:22:16 +0000 Subject: Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1e485459..96cc68ed 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Don't be afraid to submit an **issue/feature request** if you have any problems! - BBC micro:bit, LEGO, sensortag support via Smalltalk[(1)](https://en.wikipedia.org/wiki/Smalltalk)[(2)](https://en.wikipedia.org/wiki/Alan_Kay) [S2Bot](http://www.picaxe.com/Teaching/Other-Software/Scratch-Helper-Apps/) - Wiimote (Windows) +- Eyeware Beam[[1](https://beam.eyeware.tech/)] ## Output protocols @@ -69,6 +70,7 @@ Don't be afraid to submit an **issue/feature request** if you have any problems! - Wei Shuai (Wiimote tracker) - Stéphane Lenclud (Kinect Face Tracker, Easy Tracker) - GO63-samara (Hamilton Filter, Pose-widget improvement) +- Davide Mameli (Eyeware Beam tracker) ## Thanks -- cgit v1.2.3 From 768d1065d6d57145db32ae6daf916340f1ef6a1b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Mar 2023 10:29:49 +0000 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96cc68ed..0ed51166 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Intro -[](https://ci.appveyor.com/project/sthalik/opentrack/branch/unstable) +[](https://github.com/opentrack/opentrack/actions/workflows/cmake.yml) opentrack project home is located at <>. -- cgit v1.2.3 From a3bc7974742d7b13428b782c068d53fe024fbdf1 Mon Sep 17 00:00:00 2001 From: eyedav <88885346+eyedav@users.noreply.github.com> Date: Thu, 30 Mar 2023 19:59:26 +0200 Subject: Tracker Eyeware Beam x86 and x64 builds --- tracker-eyeware-beam/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tracker-eyeware-beam/CMakeLists.txt b/tracker-eyeware-beam/CMakeLists.txt index 73ea231a..e041c131 100644 --- a/tracker-eyeware-beam/CMakeLists.txt +++ b/tracker-eyeware-beam/CMakeLists.txt @@ -7,9 +7,15 @@ if(WIN32 AND SDK_EYEWARE_BEAM) endif() otr_module(tracker-eyeware-beam) + if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") + set(arch "x86") + else() + set(arch "x64") + endif() + target_include_directories(${self} SYSTEM PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/include") - target_link_directories(${self} PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/lib") - set(dll "${SDK_EYEWARE_BEAM}/API/cpp/lib/tracker_client.dll" "${SDK_EYEWARE_BEAM}/API/cpp/lib/libsodium.dll") + target_link_directories(${self} PRIVATE "${SDK_EYEWARE_BEAM}/API/cpp/lib/${arch}") + set(dll "${SDK_EYEWARE_BEAM}/API/cpp/lib/${arch}/tracker_client.dll") set(lib tracker_client.lib) #message(${self}) -- cgit v1.2.3 From fc135349a356ee50703361cacb83ea4a83c71936 Mon Sep 17 00:00:00 2001 From: Zhao Zhixu Date: Fri, 7 Apr 2023 21:30:37 +0800 Subject: tracker/neuralnet: Add support for building on Linux. (#1638) --- tracker-neuralnet/CMakeLists.txt | 6 ++++-- tracker-neuralnet/model_adapters.cpp | 42 ++++++++++++++++++++++++++++-------- tracker-neuralnet/model_adapters.h | 13 +++++++---- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/tracker-neuralnet/CMakeLists.txt b/tracker-neuralnet/CMakeLists.txt index 4689dba1..9298cd1f 100644 --- a/tracker-neuralnet/CMakeLists.txt +++ b/tracker-neuralnet/CMakeLists.txt @@ -16,15 +16,17 @@ if(OpenCV_FOUND AND ONNXRuntime_FOUND AND OpenMP_FOUND) otr_module(tracker-neuralnet) - target_link_libraries(${self} + target_link_libraries(${self} opentrack-cv onnxruntime::onnxruntime opencv_calib3d opencv_imgproc opencv_imgcodecs opencv_core - OpenMP::OpenMP_C + OpenMP::OpenMP_CXX ) + # OpenMP::OpenMP_CXX doesn't set up the -fopenmp linking option, so set it up ourselves. + target_link_options(${self} PUBLIC ${OpenMP_CXX_FLAGS}) install( FILES "models/head-localizer.onnx" diff --git a/tracker-neuralnet/model_adapters.cpp b/tracker-neuralnet/model_adapters.cpp index af599321..a8e55b2a 100644 --- a/tracker-neuralnet/model_adapters.cpp +++ b/tracker-neuralnet/model_adapters.cpp @@ -7,7 +7,7 @@ #include #include - +#include namespace neuralnet_tracker_ns { @@ -165,6 +165,24 @@ double Localizer::last_inference_time_millis() const } +std::string PoseEstimator::get_network_input_name(size_t i) const +{ +#if ORT_API_VERSION >= 12 + return std::string(&*session_.GetInputNameAllocated(i, allocator_)); +#else + return std::string(session_.GetInputName(i, allocator_)); +#endif +} + +std::string PoseEstimator::get_network_output_name(size_t i) const +{ +#if ORT_API_VERSION >= 12 + return std::string(&*session_.GetOutputNameAllocated(i, allocator_)); +#else + return std::string(session_.GetOutputName(i, allocator_)); +#endif +} + PoseEstimator::PoseEstimator(Ort::MemoryInfo &allocator_info, Ort::Session &&session) : model_version_{session.GetModelMetadata().GetVersion()} , session_{std::move(session)} @@ -215,14 +233,16 @@ PoseEstimator::PoseEstimator(Ort::MemoryInfo &allocator_info, Ort::Session &&ses qDebug() << "Pose model inputs (" << session_.GetInputCount() << ")"; qDebug() << "Pose model outputs (" << session_.GetOutputCount() << "):"; + output_names_.resize(session_.GetOutputCount()); + output_c_names_.resize(session_.GetOutputCount()); for (size_t i=0; i PoseEstimator::run( { session_.Run( Ort::RunOptions{ nullptr }, - input_names_.data(), + input_c_names_.data(), input_val_.data(), input_val_.size(), - output_names_.data(), - output_val_.data(), + output_c_names_.data(), + output_val_.data(), output_val_.size()); } catch (const Ort::Exception &e) @@ -430,4 +454,4 @@ double PoseEstimator::last_inference_time_millis() const -} // namespace neuralnet_tracker_ns \ No newline at end of file +} // namespace neuralnet_tracker_ns diff --git a/tracker-neuralnet/model_adapters.h b/tracker-neuralnet/model_adapters.h index 3fbfb861..820330cf 100644 --- a/tracker-neuralnet/model_adapters.h +++ b/tracker-neuralnet/model_adapters.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -21,7 +22,7 @@ class Localizer public: Localizer(Ort::MemoryInfo &allocator_info, Ort::Session &&session); - + // Returns bounding wrt image coordinate of the input image // The preceeding float is the score for being a face normalized to [0,1]. std::pair run( @@ -68,13 +69,16 @@ class PoseEstimator bool has_uncertainty() const { return has_uncertainty_; } private: + std::string get_network_input_name(size_t i) const; + std::string get_network_output_name(size_t i) const; int64_t model_version_ = 0; // Queried meta data from the ONNX file Ort::Session session_{nullptr}; // ONNX's runtime context for running the model Ort::Allocator allocator_; // Memory allocator for tensors // Inputs cv::Mat scaled_frame_{}, input_mat_{}; // Input. One is the original crop, the other is rescaled (?) std::vector input_val_; // Tensors to put into the model - std::vector input_names_; // Refers to the names in the onnx model. + std::vector input_names_; // Refers to the names in the onnx model. + std::vector input_c_names_; // Refers to the C names in the onnx model. // Outputs cv::Vec output_coord_{}; // 2d Coordinate and head size output. cv::Vec output_quat_{}; // Quaternion output @@ -83,7 +87,8 @@ class PoseEstimator cv::Vec output_eyes_{}; cv::Vec output_coord_scales_{}; std::vector output_val_; // Tensors to put the model outputs in. - std::vector output_names_; // Refers to the names in the onnx model. + std::vector output_names_; // Refers to the names in the onnx model. + std::vector output_c_names_; // Refers to the C names in the onnx model. // More bookkeeping size_t num_recurrent_states_ = 0; double last_inference_time_ = 0; @@ -99,4 +104,4 @@ int find_input_intensity_quantile(const cv::Mat& frame, float percentage); void normalize_brightness(const cv::Mat& frame, cv::Mat& out); -} // namespace neuralnet_tracker_ns \ No newline at end of file +} // namespace neuralnet_tracker_ns -- cgit v1.2.3 From 0395ef625920f036a7d869e44fb32765ed38222e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Apr 2023 15:31:49 +0200 Subject: tracker/nn: don't include PR: #1638 --- tracker-neuralnet/model_adapters.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tracker-neuralnet/model_adapters.cpp b/tracker-neuralnet/model_adapters.cpp index a8e55b2a..a8580a89 100644 --- a/tracker-neuralnet/model_adapters.cpp +++ b/tracker-neuralnet/model_adapters.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace neuralnet_tracker_ns { -- cgit v1.2.3 From 632098de893096427ce3171603e76968cfb804f6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 13 Apr 2023 19:12:08 +0200 Subject: cmake: fix evil typo in toolchain file --- cmake/msvc.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index e7e3c329..b1f475bf 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -37,7 +37,7 @@ add_definitions(-D_HAS_EXCEPTIONS=0) if(DEFINED CMAKE_TOOLCHAIN_FILE) # ignore cmake warning: Manually-specified variable not used by the project - set(CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}}") + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}") endif() include("${CMAKE_CURRENT_LIST_DIR}/opentrack-policy.cmake" NO_POLICY_SCOPE) -- cgit v1.2.3 From aa3c59a0fe8990dc812265bfb7be853307c0c1a2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Mar 2023 16:42:17 +0100 Subject: cmake: update for proto/osc --- cmake/msvc.cmake | 4 ++++ sdk-paths-sthalik@MSVC-windows.cmake | 2 ++ 2 files changed, 6 insertions(+) diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index b1f475bf..cf3bb0cb 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -106,6 +106,10 @@ if(CMAKE_PROJECT_NAME STREQUAL "OpenCV") set(BUILD_opencv_gapi OFF) endif() +if(CMAKE_PROJECT_NAME STREQUAL "TestOscpack") + add_compile_definitions(OSC_HOST_LITTLE_ENDIAN) +endif() + set(opentrack-simd "SSE2") if(CMAKE_PROJECT_NAME STREQUAL "onnxruntime") diff --git a/sdk-paths-sthalik@MSVC-windows.cmake b/sdk-paths-sthalik@MSVC-windows.cmake index 8f185695..c0d900ed 100644 --- a/sdk-paths-sthalik@MSVC-windows.cmake +++ b/sdk-paths-sthalik@MSVC-windows.cmake @@ -36,6 +36,7 @@ setq(SDK_LIBUSB "libusb-msvc-amd64") setq(ONNXRuntime_DIR "onnxruntime-1.12.1-amd64") setq(SDK_TRACKHAT_SENSOR "trackhat-c-library-driver/build-amd64/install") setq(SDK_EYEWARE_BEAM "BeamSDK-Windows64-1.1.0") +setq(SDK_OSCPACK "oscpack/build-amd64") elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) setq(Qt5_DIR "../qt-5.15-kde/lib/cmake/Qt5") setq(OpenCV_DIR "opencv/build/install") @@ -44,6 +45,7 @@ setq(SDK_LIBUSB "libusb-msvc-x86") setq(ONNXRuntime_DIR "onnxruntime-1.12.1") setq(SDK_TRACKHAT_SENSOR "trackhat-c-library-driver/build/install") set(SDK_EYEWARE_BEAM "" CACHE PATH "" FORCE) +setq(SDK_OSCPACK "oscpack/build") else() message(FATAL_ERROR "unknown word size ${CMAKE_SIZEOF_VOID_P}b") endif() -- cgit v1.2.3 From 7dac10fac50aa04ae538bc81b0bbe60f514a0024 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 13 Apr 2023 23:54:01 +0200 Subject: update my paths --- sdk-paths-sthalik@MSVC-windows.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk-paths-sthalik@MSVC-windows.cmake b/sdk-paths-sthalik@MSVC-windows.cmake index c0d900ed..340b78ad 100644 --- a/sdk-paths-sthalik@MSVC-windows.cmake +++ b/sdk-paths-sthalik@MSVC-windows.cmake @@ -28,23 +28,22 @@ setq(SDK_REALSENSE "RSSDK-R2") setq(SDK_VALVE_STEAMVR "steamvr") setq(SDK_FSUIPC "fsuipc") setq(SDK_HYDRA "SixenseSDK") +setq(SDK_EYEWARE_BEAM "eyeware-beam-sdk") if(CMAKE_SIZEOF_VOID_P EQUAL 8) setq(Qt5_DIR "../qt-5.15-kde-amd64/lib/cmake/Qt5") setq(OpenCV_DIR "opencv/build-amd64/install") setq(SDK_ARUCO_LIBPATH "aruco/build-amd64/src/aruco.lib") setq(SDK_LIBUSB "libusb-msvc-amd64") -setq(ONNXRuntime_DIR "onnxruntime-1.12.1-amd64") +setq(ONNXRuntime_DIR "onnxruntime-1.14.1-amd64") setq(SDK_TRACKHAT_SENSOR "trackhat-c-library-driver/build-amd64/install") -setq(SDK_EYEWARE_BEAM "BeamSDK-Windows64-1.1.0") setq(SDK_OSCPACK "oscpack/build-amd64") elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) setq(Qt5_DIR "../qt-5.15-kde/lib/cmake/Qt5") setq(OpenCV_DIR "opencv/build/install") setq(SDK_ARUCO_LIBPATH "aruco/build/src/aruco.lib") setq(SDK_LIBUSB "libusb-msvc-x86") -setq(ONNXRuntime_DIR "onnxruntime-1.12.1") +setq(ONNXRuntime_DIR "onnxruntime-1.14.1") setq(SDK_TRACKHAT_SENSOR "trackhat-c-library-driver/build/install") -set(SDK_EYEWARE_BEAM "" CACHE PATH "" FORCE) setq(SDK_OSCPACK "oscpack/build") else() message(FATAL_ERROR "unknown word size ${CMAKE_SIZEOF_VOID_P}b") -- cgit v1.2.3 From 94e7374bad0da0d9d132401bd57526b509497c7d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 13 Apr 2023 23:54:13 +0200 Subject: tracker/nn: fix build --- tracker-neuralnet/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tracker-neuralnet/CMakeLists.txt b/tracker-neuralnet/CMakeLists.txt index 9298cd1f..db568fae 100644 --- a/tracker-neuralnet/CMakeLists.txt +++ b/tracker-neuralnet/CMakeLists.txt @@ -25,8 +25,11 @@ if(OpenCV_FOUND AND ONNXRuntime_FOUND AND OpenMP_FOUND) opencv_core OpenMP::OpenMP_CXX ) + # OpenMP::OpenMP_CXX doesn't set up the -fopenmp linking option, so set it up ourselves. - target_link_options(${self} PUBLIC ${OpenMP_CXX_FLAGS}) + if(NOT MSVC) + target_link_options(${self} PUBLIC ${OpenMP_CXX_FLAGS}) + endif() install( FILES "models/head-localizer.onnx" -- cgit v1.2.3 From 051fb2f94f6364b80219a3c671bb953d2e54a140 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Mar 2023 17:33:41 +0100 Subject: proto/osc: add open sound control output method --- proto-osc/CMakeLists.txt | 15 +++++ proto-osc/dialog.cpp | 38 ++++++++++++ proto-osc/dialog.hpp | 29 ++++++++++ proto-osc/dialog.ui | 131 ++++++++++++++++++++++++++++++++++++++++++ proto-osc/images/osc-icon.png | Bin 0 -> 868 bytes proto-osc/lang/nl_NL.ts | 45 +++++++++++++++ proto-osc/lang/ru_RU.ts | 45 +++++++++++++++ proto-osc/lang/stub.ts | 45 +++++++++++++++ proto-osc/lang/zh_CN.ts | 45 +++++++++++++++ proto-osc/metadata.cpp | 8 +++ proto-osc/metadata.hpp | 10 ++++ proto-osc/osc-res.qrc | 5 ++ proto-osc/proto.cpp | 54 +++++++++++++++++ proto-osc/proto.hpp | 29 ++++++++++ proto-osc/settings.hpp | 14 +++++ 15 files changed, 513 insertions(+) create mode 100644 proto-osc/CMakeLists.txt create mode 100644 proto-osc/dialog.cpp create mode 100644 proto-osc/dialog.hpp create mode 100644 proto-osc/dialog.ui create mode 100644 proto-osc/images/osc-icon.png create mode 100644 proto-osc/lang/nl_NL.ts create mode 100644 proto-osc/lang/ru_RU.ts create mode 100644 proto-osc/lang/stub.ts create mode 100644 proto-osc/lang/zh_CN.ts create mode 100644 proto-osc/metadata.cpp create mode 100644 proto-osc/metadata.hpp create mode 100644 proto-osc/osc-res.qrc create mode 100644 proto-osc/proto.cpp create mode 100644 proto-osc/proto.hpp create mode 100644 proto-osc/settings.hpp diff --git a/proto-osc/CMakeLists.txt b/proto-osc/CMakeLists.txt new file mode 100644 index 00000000..eeaf206c --- /dev/null +++ b/proto-osc/CMakeLists.txt @@ -0,0 +1,15 @@ +set(SDK_OSCPACK "" CACHE PATH "oscpack build directory") +if(SDK_OSCPACK) + if(WIN32) + if(NOT EXISTS "${SDK_OSCPACK}/include/.") + message(FATAL_ERROR "SDK_OSCPACK should have 'include' subdirectory (or symlink) to src dir") + endif() + link_directories("${SDK_OSCPACK}") + include_directories("${SDK_OSCPACK}/include" "${SDK_OSCPACK}/include/oscpack") + else() + link_directories("${SDK_OSCPACK}/lib" "${SDK_OSCPACK}/lib32") + include_directories("${SDK_OSCPACK}/include/oscpack") + endif() + link_libraries(oscpack) + otr_module(proto-osc) +endif() diff --git a/proto-osc/dialog.cpp b/proto-osc/dialog.cpp new file mode 100644 index 00000000..54bf6885 --- /dev/null +++ b/proto-osc/dialog.cpp @@ -0,0 +1,38 @@ +#include "dialog.hpp" +#include +#include + +void osc_dialog::host_address_edited(const QString& str) +{ + bool bad = QHostAddress{str}.isNull(); + auto pal = pal_; + for (auto role : { QPalette::Highlight, QPalette::Window }) + if (bad) + pal.setColor(role, Qt::red); + ui.address->setPalette(pal); +} + +osc_dialog::osc_dialog() : + pal_{palette()} +{ + ui.setupUi( this ); + + tie_setting(s.address, ui.address); + tie_setting(s.port, ui.port); + connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &osc_dialog::doOK); + connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &osc_dialog::doCancel); + connect(ui.address, &QLineEdit::textChanged, this, &osc_dialog::host_address_edited); + host_address_edited(ui.address->text()); +} + +void osc_dialog::save() { s.b->save(); } +void osc_dialog::reload() { s.b->reload(); } + +void osc_dialog::doOK() { s.b->save(); close(); } +void osc_dialog::doCancel() { close(); } + +void osc_dialog::register_protocol(IProtocol*) {} +void osc_dialog::unregister_protocol() {} + +bool osc_dialog::embeddable() noexcept { return true; } +void osc_dialog::set_buttons_visible(bool x) noexcept { ui.buttonBox->setVisible(x); } diff --git a/proto-osc/dialog.hpp b/proto-osc/dialog.hpp new file mode 100644 index 00000000..29682843 --- /dev/null +++ b/proto-osc/dialog.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "settings.hpp" +#include "ui_dialog.h" +#include "api/plugin-api.hpp" + +class osc_dialog: public IProtocolDialog +{ + Q_OBJECT + +public: + osc_dialog(); + void register_protocol(IProtocol*) override; + void unregister_protocol() override; +private: + void set_buttons_visible(bool x) noexcept override; + bool embeddable() noexcept override; + void save() override; + void reload() override; + + Ui_OSC_Dialog ui; + osc_settings s; + const QPalette pal_; + +private slots: + void doOK(); + void doCancel(); + void host_address_edited(const QString& str); +}; diff --git a/proto-osc/dialog.ui b/proto-osc/dialog.ui new file mode 100644 index 00000000..5a078bbd --- /dev/null +++ b/proto-osc/dialog.ui @@ -0,0 +1,131 @@ + + + OSC_Dialog + + + Qt::NonModal + + + + 0 + 0 + 284 + 102 + + + + + 0 + 0 + + + + + 284 + 102 + + + + OSC protocol settings + + + + :/images/osc-icon.png:/images/osc-icon.png + + + Qt::LeftToRight + + + false + + + + + + + + Destination address + + + + + + + + 0 + 0 + + + + + + + 256 + + + + + + + Port + + + + + + + + 0 + 0 + + + + 65535 + + + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + + + 5 + + + 5 + + + true + + + true + + + false + + + + startEngineClicked() + stopEngineClicked() + cameraSettingsClicked() + + diff --git a/proto-osc/images/osc-icon.png b/proto-osc/images/osc-icon.png new file mode 100644 index 00000000..3ef546e9 Binary files /dev/null and b/proto-osc/images/osc-icon.png differ diff --git a/proto-osc/lang/nl_NL.ts b/proto-osc/lang/nl_NL.ts new file mode 100644 index 00000000..260b7adc --- /dev/null +++ b/proto-osc/lang/nl_NL.ts @@ -0,0 +1,45 @@ + + + + + OSC_Dialog + + OSC protocol settings + + + + Port + + + + Destination address + + + + + osc_metadata + + Open Sound Control + + + + + osc_proto + + Open Sound Control + + + + Error binding socket to INADDR_ANY + + + + %1: %2 + + + + Invalid destination address '%1' + + + + diff --git a/proto-osc/lang/ru_RU.ts b/proto-osc/lang/ru_RU.ts new file mode 100644 index 00000000..498d68d6 --- /dev/null +++ b/proto-osc/lang/ru_RU.ts @@ -0,0 +1,45 @@ + + + + + OSC_Dialog + + OSC protocol settings + + + + Port + + + + Destination address + + + + + osc_metadata + + Open Sound Control + + + + + osc_proto + + Open Sound Control + + + + Error binding socket to INADDR_ANY + + + + %1: %2 + + + + Invalid destination address '%1' + + + + diff --git a/proto-osc/lang/stub.ts b/proto-osc/lang/stub.ts new file mode 100644 index 00000000..20828cbd --- /dev/null +++ b/proto-osc/lang/stub.ts @@ -0,0 +1,45 @@ + + + + + OSC_Dialog + + OSC protocol settings + + + + Port + + + + Destination address + + + + + osc_metadata + + Open Sound Control + + + + + osc_proto + + Open Sound Control + + + + Error binding socket to INADDR_ANY + + + + %1: %2 + + + + Invalid destination address '%1' + + + + diff --git a/proto-osc/lang/zh_CN.ts b/proto-osc/lang/zh_CN.ts new file mode 100644 index 00000000..e0d49844 --- /dev/null +++ b/proto-osc/lang/zh_CN.ts @@ -0,0 +1,45 @@ + + + + + OSC_Dialog + + OSC protocol settings + + + + Port + + + + Destination address + + + + + osc_metadata + + Open Sound Control + + + + + osc_proto + + Open Sound Control + + + + Error binding socket to INADDR_ANY + + + + %1: %2 + + + + Invalid destination address '%1' + + + + diff --git a/proto-osc/metadata.cpp b/proto-osc/metadata.cpp new file mode 100644 index 00000000..9d69347d --- /dev/null +++ b/proto-osc/metadata.cpp @@ -0,0 +1,8 @@ +#include "metadata.hpp" +#include "proto.hpp" +#include "dialog.hpp" + +QString osc_metadata::name() { return tr("Open Sound Control"); } +QIcon osc_metadata::icon() { return QIcon(":/images/osc-icon.png"); } + +OPENTRACK_DECLARE_PROTOCOL(osc_proto, osc_dialog, osc_metadata) diff --git a/proto-osc/metadata.hpp b/proto-osc/metadata.hpp new file mode 100644 index 00000000..c0a947aa --- /dev/null +++ b/proto-osc/metadata.hpp @@ -0,0 +1,10 @@ +#pragma once +#include "api/plugin-api.hpp" + +class osc_metadata : public Metadata +{ + Q_OBJECT + + QString name() override; + QIcon icon() override; +}; diff --git a/proto-osc/osc-res.qrc b/proto-osc/osc-res.qrc new file mode 100644 index 00000000..ade4c629 --- /dev/null +++ b/proto-osc/osc-res.qrc @@ -0,0 +1,5 @@ + + + images/osc-icon.png + + diff --git a/proto-osc/proto.cpp b/proto-osc/proto.cpp new file mode 100644 index 00000000..2f90957c --- /dev/null +++ b/proto-osc/proto.cpp @@ -0,0 +1,54 @@ +#include "proto.hpp" +#include "ui_dialog.h" +#include "api/plugin-api.hpp" +#include +#include +#include "osc/OscOutboundPacketStream.h" + +osc_proto::osc_proto() +{ + auto reload_fn = [this] { + dest = QHostAddress{s.address }; + port = (unsigned short)s.port; + }; + connect(&*s.b, &bundle_::changed, this, reload_fn); + connect(&*s.b, &bundle_::reloading, this, reload_fn); +} + +void osc_proto::pose(const double* data, const double*) +{ + if (dest.isNull()) + return; + + static constexpr unsigned buffer_size = 1024; + char buffer[buffer_size] = {}; + osc::OutboundPacketStream p{buffer, buffer_size}; + auto q = QQuaternion::fromEulerAngles((float)data[Pitch], (float)data[Yaw], (float)-data[Roll]).normalized(); + p << osc::BeginMessage("/bridge/quat") << q.scalar() << q.x() << q.y() << q.z() << osc::EndMessage; + sock.writeDatagram(p.Data(), (int)p.Size(), dest, port); +} + +module_status osc_proto::initialize() +{ + QString error; + + dest = QHostAddress{s.address }; + port = (unsigned short)s.port; + + if (dest.isNull()) + { + error = tr("Invalid destination address '%1'").arg(s.address); + goto fail; + } + + if (!sock.bind()) + { + error = tr("Error binding socket to INADDR_ANY"); + goto fail; + } + + return status_ok(); + +fail: + return { tr("%1: %2").arg(error, sock.errorString()) }; +} diff --git a/proto-osc/proto.hpp b/proto-osc/proto.hpp new file mode 100644 index 00000000..53a5dee4 --- /dev/null +++ b/proto-osc/proto.hpp @@ -0,0 +1,29 @@ +#pragma once + +/* Copyright (c) 2023 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#include "settings.hpp" +#include "api/plugin-api.hpp" +#include +#include + +class osc_proto : public QObject, public IProtocol +{ + Q_OBJECT + + osc_settings s; + QUdpSocket sock; + QHostAddress dest; + unsigned short port = 0; + +public: + osc_proto(); + module_status initialize() override; + void pose(const double *headpose, const double*) override; + QString game_name() override { return tr("Open Sound Control"); } +}; diff --git a/proto-osc/settings.hpp b/proto-osc/settings.hpp new file mode 100644 index 00000000..edeb45c6 --- /dev/null +++ b/proto-osc/settings.hpp @@ -0,0 +1,14 @@ +#pragma once +#include +#include "options/options.hpp" + +using namespace options; + +struct osc_settings : opts +{ + value address; + value port; + osc_settings() : opts("proto-osc"), address{b, "address", "127.0.0.1"}, + port(b, "port", 53101) + {} +}; -- cgit v1.2.3