From b691f7a9be6cfc87376c43a87a303cfc0d263eff Mon Sep 17 00:00:00 2001
From: jcasals <jcasals@iri.upc.edu>
Date: Thu, 14 May 2020 10:26:05 +0200
Subject: [PATCH] Add addToProblem to IsMotion

---
 CMakeLists.txt                     | 1 +
 include/core/problem/problem.h     | 1 +
 include/core/processor/is_motion.h | 5 ++---
 src/processor/is_motion.cpp        | 9 +++++++++
 4 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 src/processor/is_motion.cpp

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75b2269f9..0910fe579 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -356,6 +356,7 @@ SET(SRCS_LANDMARK
   src/landmark/landmark_base.cpp
   )
 SET(SRCS_PROCESSOR
+  src/processor/is_motion.cpp
   src/processor/motion_buffer.cpp
   src/processor/processor_base.cpp
   src/processor/processor_diff_drive.cpp
diff --git a/include/core/problem/problem.h b/include/core/problem/problem.h
index 42dc859ad..36e5e338b 100644
--- a/include/core/problem/problem.h
+++ b/include/core/problem/problem.h
@@ -50,6 +50,7 @@ class Problem : public std::enable_shared_from_this<Problem>
     friend SolverManager; // Enable SolverManager to acces protected functions (consumeXXXNotificationMap())
     friend ProcessorBase;
     friend ProcessorMotion;
+    friend IsMotion;
 
     protected:
         TreeManagerBasePtr tree_manager_;
diff --git a/include/core/processor/is_motion.h b/include/core/processor/is_motion.h
index 8c99fe72e..3ba3f97ad 100644
--- a/include/core/processor/is_motion.h
+++ b/include/core/processor/is_motion.h
@@ -45,7 +45,8 @@ class IsMotion
 
         std::string getStateStructure(){return state_structure_;};
         void setStateStructure(std::string _state_structure){state_structure_ = _state_structure;};
-    
+        void addToProblem(ProblemPtr _prb_ptr, IsMotionPtr _motion_ptr);
+   
     protected:
         std::string state_structure_; ///< The structure of the state vector (to retrieve state blocks from frames)
 
@@ -83,8 +84,6 @@ inline Eigen::VectorXd IsMotion::getState(const TimeStamp& _ts) const
     return x;
 }
 
-
-
 } /* namespace wolf */
 
 #endif /* PROCESSOR_IS_MOTION_H_ */
diff --git a/src/processor/is_motion.cpp b/src/processor/is_motion.cpp
new file mode 100644
index 000000000..1bfd06a5e
--- /dev/null
+++ b/src/processor/is_motion.cpp
@@ -0,0 +1,9 @@
+#include "core/processor/is_motion.h"
+#include "core/problem/problem.h"
+
+using namespace wolf;
+
+void IsMotion::addToProblem(ProblemPtr _prb_ptr, IsMotionPtr _motion_ptr)
+{
+    _prb_ptr->addProcessorIsMotion(_motion_ptr);
+}
-- 
GitLab