From e4a772db1e59f4a675080dae31f7f76d2144f611 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Fri, 2 Aug 2019 23:01:33 +0200
Subject: [PATCH] Remove spaces in IMU YAML files

---
 demos/processor_imu.yaml         | 17 +++++++++--------
 demos/processor_imu_no_vote.yaml | 11 -----------
 src/yaml/processor_IMU_yaml.cpp  | 18 +++++++++---------
 test/gtest_IMU.cpp               |  2 +-
 4 files changed, 19 insertions(+), 29 deletions(-)
 delete mode 100644 demos/processor_imu_no_vote.yaml

diff --git a/demos/processor_imu.yaml b/demos/processor_imu.yaml
index 405d69fca..b86d47713 100644
--- a/demos/processor_imu.yaml
+++ b/demos/processor_imu.yaml
@@ -1,11 +1,12 @@
 type: "IMU"              # This must match the KEY used in the SensorFactory. Otherwise it is an error.
 
-unmeasured perturbation std: 0.00001
-time tolerance: 0.0025         # Time tolerance for joining KFs
-keyframe vote:
-    max time span:      2.0   # seconds
-    max buffer length:  20000    # motion deltas
-    dist traveled:      2.0   # meters
-    angle turned:       0.2   # radians (1 rad approx 57 deg, approx 60 deg)
+time_tolerance: 0.0025         # Time tolerance for joining KFs
+unmeasured_perturbation_std: 0.00001
+
+keyframe_vote:
     voting_active:      false
-    
\ No newline at end of file
+    voting_aux_active:  false
+    max_time_span:      2.0   # seconds
+    max_buff_length:  20000    # motion deltas
+    dist_traveled:      2.0   # meters
+    angle_turned:       0.2   # radians (1 rad approx 57 deg, approx 60 deg)
diff --git a/demos/processor_imu_no_vote.yaml b/demos/processor_imu_no_vote.yaml
deleted file mode 100644
index e01ed1cc4..000000000
--- a/demos/processor_imu_no_vote.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-type: "IMU"              # This must match the KEY used in the SensorFactory. Otherwise it is an error.
-
-time tolerance: 0.0025         # Time tolerance for joining KFs
-unmeasured perturbation std: 0.00001
-keyframe vote:
-    max time span:      999999.0   # seconds
-    max buffer length:  999999     # motion deltas
-    dist traveled:      999999.0   # meters
-    angle turned:       999999     # radians (1 rad approx 57 deg, approx 60 deg)
-    voting_active:      false
-    
\ No newline at end of file
diff --git a/src/yaml/processor_IMU_yaml.cpp b/src/yaml/processor_IMU_yaml.cpp
index b6f3137ea..a0ed78017 100644
--- a/src/yaml/processor_IMU_yaml.cpp
+++ b/src/yaml/processor_IMU_yaml.cpp
@@ -26,18 +26,18 @@ static ProcessorParamsBasePtr createProcessorIMUParams(const std::string & _file
 
     if (config["type"].as<std::string>() == "IMU")
     {
-        YAML::Node kf_vote = config["keyframe vote"];
+        YAML::Node kf_vote = config["keyframe_vote"];
 
         ProcessorParamsIMUPtr params = std::make_shared<ProcessorParamsIMU>();
-        params->time_tolerance = config["time tolerance"]           .as<Scalar>();
-        params->unmeasured_perturbation_std = config["unmeasured perturbation std"].as<Scalar>();
-
-        params->unmeasured_perturbation_std = config["unmeasured perturbation std"].as<Scalar>();
-        params->max_time_span       = kf_vote["max time span"]      .as<Scalar>();
-        params->max_buff_length     = kf_vote["max buffer length"]  .as<SizeEigen  >();
-        params->dist_traveled       = kf_vote["dist traveled"]      .as<Scalar>();
-        params->angle_turned        = kf_vote["angle turned"]       .as<Scalar>();
+        params->time_tolerance = config["time_tolerance"]           .as<Scalar>();
+        params->unmeasured_perturbation_std = config["unmeasured_perturbation_std"].as<Scalar>();
+
+        params->max_time_span       = kf_vote["max_time_span"]      .as<Scalar>();
+        params->max_buff_length     = kf_vote["max_buff_length"]    .as<SizeEigen>();
+        params->dist_traveled       = kf_vote["dist_traveled"]      .as<Scalar>();
+        params->angle_turned        = kf_vote["angle_turned"]       .as<Scalar>();
         params->voting_active       = kf_vote["voting_active"]      .as<bool>();
+        params->voting_aux_active   = kf_vote["voting_aux_active"]  .as<bool>();
         return params;
     }
 
diff --git a/test/gtest_IMU.cpp b/test/gtest_IMU.cpp
index 448437cab..e82663afc 100644
--- a/test/gtest_IMU.cpp
+++ b/test/gtest_IMU.cpp
@@ -98,7 +98,7 @@ class Process_Factor_IMU : public testing::Test
 
             // SENSOR + PROCESSOR IMU
             SensorBasePtr       sensor = problem->installSensor   ("IMU", "Main IMU", (Vector7s()<<0,0,0,0,0,0,1).finished(), wolf_root + "/demos/sensor_imu.yaml");
-            ProcessorBasePtr processor = problem->installProcessor("IMU", "IMU pre-integrator", "Main IMU", wolf_root + "/demos/processor_imu_no_vote.yaml");
+            ProcessorBasePtr processor = problem->installProcessor("IMU", "IMU pre-integrator", "Main IMU", wolf_root + "/demos/processor_imu.yaml");
             sensor_imu    = static_pointer_cast<SensorIMU>   (sensor);
             processor_imu = static_pointer_cast<ProcessorIMU>(processor);
 
-- 
GitLab