From 3cabe7926a04d5120fb82478efa6045582ecc8c8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 5 Feb 2018 10:58:25 +0100 Subject: filter/kalman: use "constexpr inline" --- filter-kalman/kalman.cpp | 6 ------ filter-kalman/kalman.h | 14 +++++++------- 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 #include -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 -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; using StateMatrix = Eigen::Matrix; @@ -90,11 +90,11 @@ struct settings : opts { value noise_rot_slider_value; 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_) { -- cgit v1.2.3