diff options
-rw-r--r-- | .github/workflows/build-windows.bat | 4 | ||||
-rw-r--r-- | filter-accela/ftnoir_filter_accela.cpp | 16 | ||||
-rw-r--r-- | opentrack/defs.hpp | 1 | ||||
-rw-r--r-- | sdk-paths-sthalik@MSVC-windows.cmake | 2 | ||||
-rw-r--r-- | tracker-aruco/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tracker-aruco/aruco-trackercontrols.ui | 88 | ||||
-rw-r--r-- | tracker-aruco/ftnoir_tracker_aruco.cpp | 3 | ||||
-rw-r--r-- | tracker-aruco/ftnoir_tracker_aruco.h | 1 | ||||
-rw-r--r-- | tracker-aruco/lang/nl_NL.ts | 4 | ||||
-rw-r--r-- | tracker-aruco/lang/ru_RU.ts | 4 | ||||
-rw-r--r-- | tracker-aruco/lang/stub.ts | 4 | ||||
-rw-r--r-- | tracker-aruco/lang/zh_CN.ts | 4 |
12 files changed, 96 insertions, 39 deletions
diff --git a/.github/workflows/build-windows.bat b/.github/workflows/build-windows.bat index efdd4bb5..4571683e 100644 --- a/.github/workflows/build-windows.bat +++ b/.github/workflows/build-windows.bat @@ -1,3 +1,3 @@ -set path=C:\Program Files\PowerShell\7;D:\a\opentrack\opentrack\ninja-build;C:\Program Files (x86)\pipx_bin;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;%GITHUB_WORKSPACE%/ninja-build -"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat" >nul && %* +set path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;%GITHUB_WORKSPACE%/ninja-build +"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" >nul && %* exit /b %ERRORLEVEL% diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp index 0f31f6a6..d3464f7b 100644 --- a/filter-accela/ftnoir_filter_accela.cpp +++ b/filter-accela/ftnoir_filter_accela.cpp @@ -7,6 +7,7 @@ #include "ftnoir_filter_accela.h" #include "compat/math.hpp" #include "api/plugin-api.hpp" +#include "opentrack/defs.hpp" #include <algorithm> #include <QDebug> @@ -62,6 +63,14 @@ static void do_deltas(const double* deltas, double* output, F&& fun) } } +template<typename F> +[[maybe_unused]] +never_inline +static void do_delta(double delta, double* output, F&& fun) +{ + *output = fun(fabs(delta)) * signum(delta); +} + void accela::filter(const double* input, double *output) { static constexpr double full_turn = 360.0; @@ -111,9 +120,16 @@ void accela::filter(const double* input, double *output) deltas[i] = d / rot_thres; } +#ifdef UI_ACCELA_OLD_STAIRCASE + for (int i = Yaw; i <= Roll; i++) + do_delta(deltas[i], &output[i], [this](double x) { + return spline_rot.get_value_no_save(x); + }); +#else do_deltas(&deltas[Yaw], &output[Yaw], [this](double x) { return spline_rot.get_value_no_save(x); }); +#endif // pos diff --git a/opentrack/defs.hpp b/opentrack/defs.hpp index 01b6557f..e3826474 100644 --- a/opentrack/defs.hpp +++ b/opentrack/defs.hpp @@ -11,3 +11,4 @@ //#define UI_NO_RAW_DATA //#define UI_NO_GAME_DATA +//define UI_ACCELA_OLD_STAIRCASE diff --git a/sdk-paths-sthalik@MSVC-windows.cmake b/sdk-paths-sthalik@MSVC-windows.cmake index 4dddd2c4..db6e8b35 100644 --- a/sdk-paths-sthalik@MSVC-windows.cmake +++ b/sdk-paths-sthalik@MSVC-windows.cmake @@ -37,7 +37,7 @@ setq(ONNXRuntime_INCLUDE_DIR "onnxruntime-1.10.0//include") setq(ONNXRuntime_LIBRARY "onnxruntime-1.10.0/lib/onnxruntime.lib") setq(ONNXRuntime_RUNTIME "onnxruntime-1.10.0/lib/onnxruntime.dll") -setq(Qt5_DIR "../qt-5.15.2/lib/cmake/Qt5") +setq(Qt5_DIR "../qt-5.15.0kde0/lib/cmake/Qt5") set(Qt5Core_DIR "${Qt5_DIR}Core" CACHE PATH "" FORCE) set(Qt5Gui_DIR "${Qt5_DIR}Gui" CACHE PATH "" FORCE) diff --git a/tracker-aruco/CMakeLists.txt b/tracker-aruco/CMakeLists.txt index 92879196..c477ac1e 100644 --- a/tracker-aruco/CMakeLists.txt +++ b/tracker-aruco/CMakeLists.txt @@ -10,10 +10,10 @@ endfunction() include(opentrack-opencv) find_package(OpenCV QUIET) -if(OpenCV_FOUND AND TARGET opencv_calib3d AND TARGET opencv_features2d) +if(OpenCV_FOUND) set(opencv-modules core calib3d imgproc features2d flann) foreach(k ${opencv-modules}) - if(NOT TARGET "${k}") + if(NOT TARGET "opencv_${k}") return() endif() endforeach() diff --git a/tracker-aruco/aruco-trackercontrols.ui b/tracker-aruco/aruco-trackercontrols.ui index 4d40b6ef..0cd76b89 100644 --- a/tracker-aruco/aruco-trackercontrols.ui +++ b/tracker-aruco/aruco-trackercontrols.ui @@ -9,8 +9,8 @@ <rect> <x>0</x> <y>0</y> - <width>462</width> - <height>221</height> + <width>457</width> + <height>230</height> </rect> </property> <property name="windowTitle"> @@ -64,13 +64,17 @@ <item> <widget class="QFrame" name="frame"> <layout class="QGridLayout" name="gridLayout_4"> - <item row="2" column="1"> - <widget class="QComboBox" name="cameraName"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="4" column="0"> + <widget class="QLabel" name="label_11"> + <property name="text"> + <string>Resolution</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_10"> + <property name="text"> + <string>Camera name</string> </property> </widget> </item> @@ -93,7 +97,24 @@ </property> </widget> </item> - <item row="3" column="1"> + <item row="1" column="0"> + <widget class="QLabel" name="label_12"> + <property name="text"> + <string>Frames per second</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="cameraFPS"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + <item row="4" column="1"> <widget class="QComboBox" name="resolution"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> @@ -123,27 +144,6 @@ </item> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_12"> - <property name="text"> - <string>Frames per second</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_11"> - <property name="text"> - <string>Resolution</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_10"> - <property name="text"> - <string>Camera name</string> - </property> - </widget> - </item> <item row="0" column="0"> <widget class="QLabel" name="label_9"> <property name="text"> @@ -151,8 +151,8 @@ </property> </widget> </item> - <item row="1" column="1"> - <widget class="QComboBox" name="cameraFPS"> + <item row="2" column="1"> + <widget class="QComboBox" name="cameraName"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> @@ -161,7 +161,7 @@ </property> </widget> </item> - <item row="4" column="1"> + <item row="5" column="1"> <widget class="QPushButton" name="camera_settings"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> @@ -174,6 +174,26 @@ </property> </widget> </item> + <item row="3" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>MJPEG</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QCheckBox" name="use_mjpeg"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string/> + </property> + </widget> + </item> </layout> </widget> </item> diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp index 4e31d90d..1f39db32 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.cpp +++ b/tracker-aruco/ftnoir_tracker_aruco.cpp @@ -179,6 +179,8 @@ bool aruco_tracker::open_camera() if (fps) args.fps = fps; + args.use_mjpeg = s.use_mjpeg; + if (!camera->start(args)) { qDebug() << "aruco tracker: can't open camera"; @@ -526,6 +528,7 @@ aruco_dialog::aruco_dialog() : tie_setting(s.headpos_x, ui.cx); tie_setting(s.headpos_y, ui.cy); tie_setting(s.headpos_z, ui.cz); + tie_setting(s.use_mjpeg, ui.use_mjpeg); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); diff --git a/tracker-aruco/ftnoir_tracker_aruco.h b/tracker-aruco/ftnoir_tracker_aruco.h index 3c50ada0..839be6d5 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.h +++ b/tracker-aruco/ftnoir_tracker_aruco.h @@ -62,6 +62,7 @@ struct settings : opts { value<int> resolution { b, "force-resolution", 0 }; value<int> fov { b, "field-of-view", 56 }; value<aruco_fps> force_fps { b, "force-fps", fps_default }; + value<bool> use_mjpeg { b, "use-mjpeg", false }; settings(); }; diff --git a/tracker-aruco/lang/nl_NL.ts b/tracker-aruco/lang/nl_NL.ts index c9213ea0..1a510ac1 100644 --- a/tracker-aruco/lang/nl_NL.ts +++ b/tracker-aruco/lang/nl_NL.ts @@ -63,6 +63,10 @@ <source>1280x720</source> <translation>1280x720</translation> </message> + <message> + <source>MJPEG</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>aruco_dialog</name> diff --git a/tracker-aruco/lang/ru_RU.ts b/tracker-aruco/lang/ru_RU.ts index f78a7cae..3e0aa86a 100644 --- a/tracker-aruco/lang/ru_RU.ts +++ b/tracker-aruco/lang/ru_RU.ts @@ -63,6 +63,10 @@ <source>1280x720</source> <translation type="unfinished"></translation> </message> + <message> + <source>MJPEG</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>aruco_dialog</name> diff --git a/tracker-aruco/lang/stub.ts b/tracker-aruco/lang/stub.ts index 82ccd296..bbd78995 100644 --- a/tracker-aruco/lang/stub.ts +++ b/tracker-aruco/lang/stub.ts @@ -63,6 +63,10 @@ <source>1280x720</source> <translation type="unfinished"></translation> </message> + <message> + <source>MJPEG</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>aruco_dialog</name> diff --git a/tracker-aruco/lang/zh_CN.ts b/tracker-aruco/lang/zh_CN.ts index e060c387..88b1054c 100644 --- a/tracker-aruco/lang/zh_CN.ts +++ b/tracker-aruco/lang/zh_CN.ts @@ -63,6 +63,10 @@ <source>1280x720</source> <translation type="unfinished"></translation> </message> + <message> + <source>MJPEG</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>aruco_dialog</name> |