From 52b78748a40eb2f781e4d6c5878850d914e91b76 Mon Sep 17 00:00:00 2001
From: jvallve <jvallve@iri.upc.edu>
Date: Mon, 24 Jul 2023 14:27:18 +0200
Subject: [PATCH] [skip ci] wip

---
 CMakeLists.txt                                |  9 ++++
 .../bodydynamics/capture/capture_leg_odom.h   |  7 ---
 .../capture/capture_point_feet_nomove.h       |  6 ---
 .../bodydynamics/factor/factor_force_torque.h | 10 ----
 .../factor/factor_inertial_kinematics.h       |  6 ---
 .../factor/factor_point_feet_altitude.h       |  6 ---
 .../factor/factor_point_feet_nomove.h         |  6 ---
 .../factor/factor_point_feet_zero_velocity.h  |  6 ---
 include/bodydynamics/utils/load_gnss.h        | 51 +++++++++++++++++++
 src/capture/capture_leg_odom.cpp              |  6 ---
 src/capture/capture_point_feet_nomove.cpp     |  6 ---
 .../processor_inertial_kinematics.cpp         |  6 ---
 src/processor/processor_point_feet_nomove.cpp |  6 ---
 src/utils/load_gnss.cpp                       | 26 ++++++++++
 test/gtest_capture_inertial_kinematics.cpp    |  7 ---
 test/gtest_capture_leg_odom.cpp               |  7 ---
 test/gtest_factor_force_torque.cpp            |  9 ----
 test/gtest_factor_inertial_kinematics.cpp     |  9 ----
 test/gtest_feature_inertial_kinematics.cpp    |  7 ---
 test/gtest_processor_force_torque_preint.cpp  |  7 ---
 test/gtest_processor_inertial_kinematics.cpp  |  7 ---
 test/gtest_processor_point_feet_nomove.cpp    |  7 ---
 test/gtest_sensor_force_torque.cpp            |  7 ---
 test/gtest_sensor_inertial_kinematics.cpp     |  7 ---
 24 files changed, 86 insertions(+), 145 deletions(-)
 create mode 100644 include/bodydynamics/utils/load_gnss.h
 create mode 100644 src/utils/load_gnss.cpp

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd7799a..305d321 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,6 +135,9 @@ include/${PROJECT_NAME}/sensor/sensor_force_torque.h
 include/${PROJECT_NAME}/sensor/sensor_inertial_kinematics.h
 include/${PROJECT_NAME}/sensor/sensor_point_feet_nomove.h
   )
+SET(HDRS_UTILS
+include/${PROJECT_NAME}/utils/load_bodydynamics.h
+  )
 
 # ============ SOURCES ============ 
 SET(SRCS_CAPTURE
@@ -158,6 +161,9 @@ src/sensor/sensor_force_torque.cpp
 src/sensor/sensor_inertial_kinematics.cpp
 src/sensor/sensor_point_feet_nomove.cpp
   )
+SET(SRCS_UTILS
+src/utils/load_bodydynamics.cpp
+  )
 
 # create the shared library
 ADD_LIBRARY(${PLUGIN_NAME}
@@ -166,6 +172,7 @@ ADD_LIBRARY(${PLUGIN_NAME}
   ${SRCS_FEATURE}
   ${SRCS_PROCESSOR}
   ${SRCS_SENSOR}
+  ${SRCS_UTILS}
   )
 
 # Set compiler options
@@ -243,6 +250,8 @@ INSTALL(FILES ${HDRS_PROCESSOR}
   DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/processor)
 INSTALL(FILES ${HDRS_SENSOR}
   DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/sensor)
+INSTALL(FILES ${HDRS_UTILS}
+  DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/utils)
 
 INSTALL(FILES "${WOLF_CONFIG_DIR}/config.h"
 DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}/internal)
diff --git a/include/bodydynamics/capture/capture_leg_odom.h b/include/bodydynamics/capture/capture_leg_odom.h
index 54f6bfa..a627834 100644
--- a/include/bodydynamics/capture/capture_leg_odom.h
+++ b/include/bodydynamics/capture/capture_leg_odom.h
@@ -17,13 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file gtest_capture_leg_odom.h
- *
- *  Created on: May 12, 2020
- *      \author: mfourmy
- */
-
 
 #ifndef CAPTURE_LEG_ODOM_H
 #define CAPTURE_LEG_ODOM_H
diff --git a/include/bodydynamics/capture/capture_point_feet_nomove.h b/include/bodydynamics/capture/capture_point_feet_nomove.h
index 1223076..cc6370c 100644
--- a/include/bodydynamics/capture/capture_point_feet_nomove.h
+++ b/include/bodydynamics/capture/capture_point_feet_nomove.h
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- *
- *  Created on: Oct 23, 2020
- *      \author: mfourmy
- */
-
 
 #ifndef CAPTURE_POINT_FEET_NOMOVE_H
 #define CAPTURE_POINT_FEET_NOMOVE_H
diff --git a/include/bodydynamics/factor/factor_force_torque.h b/include/bodydynamics/factor/factor_force_torque.h
index 12af1ce..36729a2 100644
--- a/include/bodydynamics/factor/factor_force_torque.h
+++ b/include/bodydynamics/factor/factor_force_torque.h
@@ -17,16 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file factor_force_torque.h
- *
- *  Created on: Feb 19, 2020
- *      \author: mfourmy
- * 
- *  Works only for 2 limbs
- */
-
-
 
 #ifndef FACTOR_FORCE_TORQUE_H_
 #define FACTOR_FORCE_TORQUE_H_
diff --git a/include/bodydynamics/factor/factor_inertial_kinematics.h b/include/bodydynamics/factor/factor_inertial_kinematics.h
index 81c2a76..00e1758 100644
--- a/include/bodydynamics/factor/factor_inertial_kinematics.h
+++ b/include/bodydynamics/factor/factor_inertial_kinematics.h
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file factor_inertial_kinematics.h
- *
- *  Created on: Feb 17, 2020
- *      \author: mfourmy
- */
 
 #ifndef FACTOR_INERTIAL_KINEMATICS_H_
 #define FACTOR_INERTIAL_KINEMATICS_H_
diff --git a/include/bodydynamics/factor/factor_point_feet_altitude.h b/include/bodydynamics/factor/factor_point_feet_altitude.h
index 1f9faf1..d0ad5cd 100644
--- a/include/bodydynamics/factor/factor_point_feet_altitude.h
+++ b/include/bodydynamics/factor/factor_point_feet_altitude.h
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file factor_point_feet_altitude.h
- *
- *  Created on: Nov 5, 2020
- *      \author: mfourmy
- */
 
 #ifndef FACTOR_POINT_FEET_ALTITUDE_H_
 #define FACTOR_POINT_FEET_ALTITUDE_H_
diff --git a/include/bodydynamics/factor/factor_point_feet_nomove.h b/include/bodydynamics/factor/factor_point_feet_nomove.h
index 3c54483..efe0dcf 100644
--- a/include/bodydynamics/factor/factor_point_feet_nomove.h
+++ b/include/bodydynamics/factor/factor_point_feet_nomove.h
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file factor_point_feet_nomove.h
- *
- *  Created on: Feb 22, 2020
- *      \author: mfourmy
- */
 
 #ifndef FACTOR_POINT_FEET_NOMOVE_H_
 #define FACTOR_POINT_FEET_NOMOVE_H_
diff --git a/include/bodydynamics/factor/factor_point_feet_zero_velocity.h b/include/bodydynamics/factor/factor_point_feet_zero_velocity.h
index 92c5c93..ac18bc8 100644
--- a/include/bodydynamics/factor/factor_point_feet_zero_velocity.h
+++ b/include/bodydynamics/factor/factor_point_feet_zero_velocity.h
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file factor_point_feet_nomove.h
- *
- *  Created on: Feb 22, 2020
- *      \author: mfourmy
- */
 
 #ifndef FACTOR_POINT_FEET_ZERO_VELOCITY_H_
 #define FACTOR_POINT_FEET_ZERO_VELOCITY_H_
diff --git a/include/bodydynamics/utils/load_gnss.h b/include/bodydynamics/utils/load_gnss.h
new file mode 100644
index 0000000..66fbd58
--- /dev/null
+++ b/include/bodydynamics/utils/load_gnss.h
@@ -0,0 +1,51 @@
+// WOLF - Copyright (C) 2020,2021,2022,2023
+// Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Authors: Joan Solà Ortega (jsola@iri.upc.edu) and
+// Joan Vallvé Navarro (jvallve@iri.upc.edu)
+// All rights reserved.
+//
+// This file is part of WOLF: http://www.iri.upc.edu/wolf
+// WOLF is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#pragma once
+
+namespace wolf
+{
+// This class is just to force the .so to be easily loaded in tests
+class LoadGnss
+{
+  public:
+    static bool aux_var;
+};
+
+#ifdef __GNUC__
+#define WOLF_UNUSED __attribute__((used))
+#elif defined _MSC_VER
+#pragma warning(disable : Cxxxxx)
+#define WOLF_UNUSED
+#elif defined(__LCLINT__)
+#define WOLF_UNUSED /*@unused@*/
+#elif defined(__cplusplus)
+#define WOLF_UNUSED
+#else
+#define UNUSED(x) x
+#endif
+
+#define WOLF_LOAD_GNSS                                                                                                \
+    namespace                                                                                                         \
+    {                                                                                                                 \
+    const bool WOLF_UNUSED aux_var_gnss = wolf::LoadGnss::aux_var;                                                    \
+    }
+
+}  // namespace wolf
diff --git a/src/capture/capture_leg_odom.cpp b/src/capture/capture_leg_odom.cpp
index 04b6e87..f6d9770 100644
--- a/src/capture/capture_leg_odom.cpp
+++ b/src/capture/capture_leg_odom.cpp
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file capture_leg_odom.cpp
- *
- *  Created on: May 12, 2020
- *      \author: mfourmy
- */
 
 
 #include "core/math/rotations.h"
diff --git a/src/capture/capture_point_feet_nomove.cpp b/src/capture/capture_point_feet_nomove.cpp
index ea6d4b6..904db89 100644
--- a/src/capture/capture_point_feet_nomove.cpp
+++ b/src/capture/capture_point_feet_nomove.cpp
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file capture_point_feet_nomove.cpp
- *
- *  Created on: Oct 23, 2020
- *      \author: mfourmy
- */
 
 
 #include "core/capture/capture_base.h"
diff --git a/src/processor/processor_inertial_kinematics.cpp b/src/processor/processor_inertial_kinematics.cpp
index 7802d0b..513575d 100644
--- a/src/processor/processor_inertial_kinematics.cpp
+++ b/src/processor/processor_inertial_kinematics.cpp
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file processor_inertial_kinematics.cpp
- *
- *  Created on: Feb 27, 2020
- *      \author: jsola
- */
 
 #include "bodydynamics/processor/processor_inertial_kinematics.h"
 
diff --git a/src/processor/processor_point_feet_nomove.cpp b/src/processor/processor_point_feet_nomove.cpp
index 363329e..110ea42 100644
--- a/src/processor/processor_point_feet_nomove.cpp
+++ b/src/processor/processor_point_feet_nomove.cpp
@@ -17,12 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file processor_point_feet_nomove.cpp
- *
- *  Created on: Oct 23, 2020
- *      \author: mfourmy
- */
 
 #include "bodydynamics/processor/processor_point_feet_nomove.h"
 
diff --git a/src/utils/load_gnss.cpp b/src/utils/load_gnss.cpp
new file mode 100644
index 0000000..5bda1d4
--- /dev/null
+++ b/src/utils/load_gnss.cpp
@@ -0,0 +1,26 @@
+// WOLF - Copyright (C) 2020,2021,2022,2023
+// Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
+// Authors: Joan Solà Ortega (jsola@iri.upc.edu) and
+// Joan Vallvé Navarro (jvallve@iri.upc.edu)
+// All rights reserved.
+//
+// This file is part of WOLF: http://www.iri.upc.edu/wolf
+// WOLF is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+#include "gnss/utils/load_gnss.h"
+
+namespace wolf
+{
+bool LoadGnss::aux_var = true;
+}  // namespace wolf
diff --git a/test/gtest_capture_inertial_kinematics.cpp b/test/gtest_capture_inertial_kinematics.cpp
index 1875a5b..bf576e1 100644
--- a/test/gtest_capture_inertial_kinematics.cpp
+++ b/test/gtest_capture_inertial_kinematics.cpp
@@ -17,13 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file gtest_capture_inertial_kinematics.cpp
- *
- *  Created on: Feb 28, 2020
- *      \author: jsola
- */
-
 
 #include "bodydynamics/capture/capture_inertial_kinematics.h"
 #include "bodydynamics/sensor/sensor_inertial_kinematics.h"
diff --git a/test/gtest_capture_leg_odom.cpp b/test/gtest_capture_leg_odom.cpp
index ac3feac..040f186 100644
--- a/test/gtest_capture_leg_odom.cpp
+++ b/test/gtest_capture_leg_odom.cpp
@@ -17,13 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file gtest_capture_leg_odom.cpp
- *
- *  Created on: May 12, 2020
- *      \author: mfourmy
- */
-
 
 #include "bodydynamics/capture/capture_leg_odom.h"
 
diff --git a/test/gtest_factor_force_torque.cpp b/test/gtest_factor_force_torque.cpp
index 7b4f241..2953dcb 100644
--- a/test/gtest_factor_force_torque.cpp
+++ b/test/gtest_factor_force_torque.cpp
@@ -18,16 +18,7 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-/**
- * \file gtest_factor_inertial_kinematics.cpp
- *
- *  Created on: Janv 29, 2020
- *      \author: Mederic Fourmy
- */
-
 /*
-
-
 Organisation: For each test, the problem, sensors, factors (if possible) are instanciated in a base class inheriting fromtesting::Test only.
 Then, each test case is derived in a child class which defines the data processed by the different sensors and expected estimated test values.
 Finally, each of these child classes is used in one or several Test in which basically the expected values are compared against estimation and
diff --git a/test/gtest_factor_inertial_kinematics.cpp b/test/gtest_factor_inertial_kinematics.cpp
index 3f3a4c2..fbe458e 100644
--- a/test/gtest_factor_inertial_kinematics.cpp
+++ b/test/gtest_factor_inertial_kinematics.cpp
@@ -18,16 +18,7 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-/**
- * \file gtest_factor_inertial_kinematics.cpp
- *
- *  Created on: Janv 29, 2020
- *      \author: Mederic Fourmy
- */
-
 /*
-
-
 Organisation: For each test, the problem, sensors, factors (if possible) are instanciated in a base class inheriting fromtesting::Test only.
 Then, each test case is derived in a child class which defines the data processed by the different sensors and expected estimated test values.
 Finally, each of these child classes is used in one or several Test in which basically the expected values are compared against estimation and
diff --git a/test/gtest_feature_inertial_kinematics.cpp b/test/gtest_feature_inertial_kinematics.cpp
index 7c2d214..41a3ff1 100644
--- a/test/gtest_feature_inertial_kinematics.cpp
+++ b/test/gtest_feature_inertial_kinematics.cpp
@@ -17,13 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file gtest_feature_inertial_kinematics.cpp
- *
- *  Created on: March 9, 2020
- *      \author: mfourmy
- */
-
 
 #include "bodydynamics/feature/feature_inertial_kinematics.h"
 
diff --git a/test/gtest_processor_force_torque_preint.cpp b/test/gtest_processor_force_torque_preint.cpp
index 0f41953..a5310ae 100644
--- a/test/gtest_processor_force_torque_preint.cpp
+++ b/test/gtest_processor_force_torque_preint.cpp
@@ -18,13 +18,6 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-/**
- * \file gtest_factor_force_torque_preint.cpp
- *
- *  Created on: March 20, 2020
- *      \author: Mederic Fourmy
- */
-
 // debug
 #include <iostream>
 #include <fstream>
diff --git a/test/gtest_processor_inertial_kinematics.cpp b/test/gtest_processor_inertial_kinematics.cpp
index 0978ee3..1fd6469 100644
--- a/test/gtest_processor_inertial_kinematics.cpp
+++ b/test/gtest_processor_inertial_kinematics.cpp
@@ -18,13 +18,6 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-/**
- * \file gtest_factor_inertial_kinematics.cpp
- *
- *  Created on: March 9, 2020
- *      \author: Mederic Fourmy
- */
-
 // debug
 #include <iostream>
 #include <fstream>
diff --git a/test/gtest_processor_point_feet_nomove.cpp b/test/gtest_processor_point_feet_nomove.cpp
index 381e0de..9657f6d 100644
--- a/test/gtest_processor_point_feet_nomove.cpp
+++ b/test/gtest_processor_point_feet_nomove.cpp
@@ -18,13 +18,6 @@
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-/**
- * \file gtest_processor_point_feet_nomove.cpp
- *
- *  Created on: October 28, 2020
- *      \author: Mederic Fourmy
- */
-
 // debug
 #include <iostream>
 #include <fstream>
diff --git a/test/gtest_sensor_force_torque.cpp b/test/gtest_sensor_force_torque.cpp
index 1f61b42..a486849 100644
--- a/test/gtest_sensor_force_torque.cpp
+++ b/test/gtest_sensor_force_torque.cpp
@@ -17,13 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file gtest_sensor_force_torque.cpp
- *
- *  Created on: Feb 26, 2020
- *      \author: jsola
- */
-
 
 #include "bodydynamics/sensor/sensor_force_torque.h"
 
diff --git a/test/gtest_sensor_inertial_kinematics.cpp b/test/gtest_sensor_inertial_kinematics.cpp
index c54c825..9a62320 100644
--- a/test/gtest_sensor_inertial_kinematics.cpp
+++ b/test/gtest_sensor_inertial_kinematics.cpp
@@ -17,13 +17,6 @@
 //
 // You should have received a copy of the GNU Lesser General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
-/**
- * \file gtest_sensor_inertial_kinematics.cpp
- *
- *  Created on: Feb 28, 2020
- *      \author: jsola
- */
-
 
 #include "bodydynamics/sensor/sensor_inertial_kinematics.h"
 
-- 
GitLab