summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt53
-rw-r--r--cmake/opentrack-boilerplate.cmake11
-rw-r--r--filter-accela/accela-settings.hpp2
-rw-r--r--filter-accela/ftnoir_accela_filtercontrols.ui2
-rw-r--r--filter-accela/ftnoir_filter_accela.cpp7
-rw-r--r--filter-accela/ftnoir_filter_accela.h2
6 files changed, 43 insertions, 34 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b68b82c..aff3011a 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,35 +52,34 @@ if(WIN32)
enable_language(RC)
endif()
-add_custom_target(mrproper COMMAND ${CMAKE_COMMAND} -P "${CMAKE_SOURCE_DIR}/cmake/opentrack-clean-build-directory.cmake" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
+add_custom_target(mrproper COMMAND
+ "${CMAKE_COMMAND}" -P
+ "${CMAKE_SOURCE_DIR}/cmake/opentrack-clean-build-directory.cmake"
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
-set(C CMakeLists.txt)
-file(GLOB opentrack-subprojects
- "tracker-*/${C}"
- "proto-*/${C}"
- "filter-*/${C}"
- "ext-*/${C}"
- "options/${C}"
- "api/${C}"
- "compat/${C}"
- "logic/${C}"
- "dinput/${C}"
- "gui/${C}"
- "x-plane-plugin/${C}"
- "csv/${C}"
- "pose-widget/${C}"
- "spline/${C}"
- "qxt-mini/${C}"
- "macosx/${C}"
- "cv/${C}"
- "migration/${C}"
-)
+otr_add_target_dirs(opentrack-subprojects
+ "tracker-*"
+ "proto-*"
+ "filter-*"
+ "ext-*"
+ "options"
+ "api"
+ "compat"
+ "logic"
+ "dinput"
+ "gui"
+ "x-plane-plugin"
+ "csv"
+ "pose-widget"
+ "spline"
+ "qxt-mini"
+ "macosx"
+ "cv"
+ "migration")
-list(SORT opentrack-subprojects)
-
-foreach(i ${opentrack-subprojects})
- get_filename_component(i ${i} DIRECTORY)
- add_subdirectory(${i})
+foreach(k ${opentrack-subprojects})
+ get_filename_component(k "${k}" DIRECTORY)
+ add_subdirectory("${k}")
endforeach()
otr_merge_translations()
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 36c8d666..d3becd56 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -266,3 +266,14 @@ function(otr_prop type)
endwhile()
endforeach()
endfunction()
+
+function(otr_add_target_dirs var)
+ set(globs "")
+ foreach(k ${ARGN})
+ list(APPEND globs "${k}/CMakeLists.txt")
+ endforeach()
+ set(projects "")
+ file(GLOB projects ${globs})
+ list(SORT projects)
+ set("${var}" "${projects}" PARENT_SCOPE)
+endfunction()
diff --git a/filter-accela/accela-settings.hpp b/filter-accela/accela-settings.hpp
index e1a48a6d..3f4c070a 100644
--- a/filter-accela/accela-settings.hpp
+++ b/filter-accela/accela-settings.hpp
@@ -45,7 +45,7 @@ struct settings_accela : opts
value<slider_value> rot_nonlinearity;
settings_accela() :
opts("accela-sliders"),
- rot_sensitivity(b, "rotation-sensitivity", slider_value(1.5, .2, 2.5)),
+ rot_sensitivity(b, "rotation-sensitivity", slider_value(1.5, .05, 2.5)),
pos_sensitivity(b, "translation-sensitivity", slider_value(1., .05, 1.5)),
rot_deadzone(b, "rotation-deadzone", slider_value(.03, 0, .1)),
pos_deadzone(b, "translation-deadzone", slider_value(.1, 0, 1)),
diff --git a/filter-accela/ftnoir_accela_filtercontrols.ui b/filter-accela/ftnoir_accela_filtercontrols.ui
index 710431ac..913b775e 100644
--- a/filter-accela/ftnoir_accela_filtercontrols.ui
+++ b/filter-accela/ftnoir_accela_filtercontrols.ui
@@ -278,7 +278,7 @@
<number>0</number>
</property>
<property name="maximum">
- <number>46</number>
+ <number>49</number>
</property>
<property name="pageStep">
<number>1</number>
diff --git a/filter-accela/ftnoir_filter_accela.cpp b/filter-accela/ftnoir_filter_accela.cpp
index 5eac439a..a0c48ff1 100644
--- a/filter-accela/ftnoir_filter_accela.cpp
+++ b/filter-accela/ftnoir_filter_accela.cpp
@@ -6,7 +6,6 @@
*/
#include "ftnoir_filter_accela.h"
#include <algorithm>
-#include <cmath>
#include <QDebug>
#include <QMutexLocker>
#include "api/plugin-api.hpp"
@@ -122,7 +121,7 @@ void accela::filter(const double* input, double *output)
{
for (unsigned k = 3; k < 6; k++)
{
- static constexpr double nl_end = 5;
+ static constexpr double nl_end = 7;
if (fabs(deltas[k]) <= nl_end)
deltas[k] = copysign(pow(fabs(deltas[k]/nl_end), nl) * nl_end, deltas[k]);
@@ -132,7 +131,7 @@ void accela::filter(const double* input, double *output)
do_deltas(&deltas[Yaw], &output[Yaw], alpha, smoothed_input[0], [this](double x) { return spline_rot.get_value_no_save(x); });
#if defined DEBUG_ACCELA
- var.input(smoothed_input[0]);
+ var.input(fabs(smoothed_input[0]) + fabs(smoothed_input[1]) + fabs(smoothed_input[2]));
debug_max = fmax(debug_max, smoothed_input[0]);
using time_units::secs_;
@@ -142,7 +141,7 @@ void accela::filter(const double* input, double *output)
qDebug() << "accela:"
<< "max" << debug_max
<< "mean" << var.avg()
- << "stddev" << var.stddev();
+ << "stddev/mean" << var.stddev() / var.avg();
var.clear();
debug_max = 0;
diff --git a/filter-accela/ftnoir_filter_accela.h b/filter-accela/ftnoir_filter_accela.h
index fa3c611f..9b0abec5 100644
--- a/filter-accela/ftnoir_filter_accela.h
+++ b/filter-accela/ftnoir_filter_accela.h
@@ -13,13 +13,13 @@
#include "compat/timer.hpp"
#include "compat/variance.hpp"
-#include <atomic>
#include <QMutex>
#include <QTimer>
// ------------------------------------
// debug knob
// ------------------------------------
+
//#define DEBUG_ACCELA
class accela : public IFilter