summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-02-05 10:58:25 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-02-05 10:58:25 +0100
commit3cabe7926a04d5120fb82478efa6045582ecc8c8 (patch)
tree7a343e841afbc73f33fdfdf079c424545fd477ff
parenta40998dbbb625acf8fcff7bc943f4cd1f1daf557 (diff)
filter/kalman: use "constexpr inline"
-rw-r--r--filter-kalman/kalman.cpp6
-rw-r--r--filter-kalman/kalman.h14
2 files changed, 7 insertions, 13 deletions
diff --git a/filter-kalman/kalman.cpp b/filter-kalman/kalman.cpp
index 744c732b..82b1b0f1 100644
--- a/filter-kalman/kalman.cpp
+++ b/filter-kalman/kalman.cpp
@@ -8,12 +8,6 @@
#include <QDebug>
#include <cmath>
-constexpr double settings::adaptivity_window_length;
-constexpr double settings::deadzone_scale;
-constexpr double settings::deadzone_exponent;
-constexpr double settings::process_sigma_pos;
-constexpr double settings::process_sigma_rot;
-
void KalmanFilter::init()
{
// allocate and initialize matrices
diff --git a/filter-kalman/kalman.h b/filter-kalman/kalman.h
index 607c8ddf..431041dc 100644
--- a/filter-kalman/kalman.h
+++ b/filter-kalman/kalman.h
@@ -20,8 +20,8 @@ using namespace options;
#include <atomic>
-static constexpr int NUM_STATE_DOF = 12;
-static constexpr int NUM_MEASUREMENT_DOF = 6;
+static constexpr inline int NUM_STATE_DOF = 12;
+static constexpr inline int NUM_MEASUREMENT_DOF = 6;
// These vectors are compile time fixed size, stack allocated
using StateToMeasureMatrix = Eigen::Matrix<double, NUM_MEASUREMENT_DOF, NUM_STATE_DOF>;
using StateMatrix = Eigen::Matrix<double, NUM_STATE_DOF, NUM_STATE_DOF>;
@@ -90,11 +90,11 @@ struct settings : opts {
value<slider_value> noise_rot_slider_value;
value<slider_value> noise_pos_slider_value;
- static constexpr double adaptivity_window_length = 0.25; // seconds
- static constexpr double deadzone_scale = 8;
- static constexpr double deadzone_exponent = 2.0;
- static constexpr double process_sigma_pos = 0.5;
- static constexpr double process_sigma_rot = 0.5;
+ static constexpr inline double adaptivity_window_length = 0.25; // seconds
+ static constexpr inline double deadzone_scale = 8;
+ static constexpr inline double deadzone_exponent = 2.0;
+ static constexpr inline double process_sigma_pos = 0.5;
+ static constexpr inline double process_sigma_rot = 0.5;
static double map_slider_value(const slider_value &v_)
{