From 010c66ec9ac1b94b108d370c648503ce69ad38b5 Mon Sep 17 00:00:00 2001
From: Paul Beuchat <beuchatp@control.ee.ethz.ch>
Date: Tue, 24 Apr 2018 21:43:26 +0200
Subject: [PATCH] Added Eigen library to CMakeLists.txt It needs to be
 installed before hand

---
 pps_ws/src/d_fall_pps/CMakeLists.txt                     | 8 +++++---
 pps_ws/src/d_fall_pps/src/nodes/MpcControllerService.cpp | 6 ++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pps_ws/src/d_fall_pps/CMakeLists.txt b/pps_ws/src/d_fall_pps/CMakeLists.txt
index 1247d944..dc1394e6 100755
--- a/pps_ws/src/d_fall_pps/CMakeLists.txt
+++ b/pps_ws/src/d_fall_pps/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.3)
+cmake_minimum_required(VERSION 3.0)
 project(d_fall_pps)
 
 ## Add support for C++11, supported in ROS Kinetic and newer
@@ -15,8 +15,9 @@ find_package(catkin REQUIRED COMPONENTS
   genmsg
   rosbag
   roslib
-)
+  )
 
+find_package (Eigen3 3.3 REQUIRED NO_MODULE)
 
 # GUI -- Add precompiler definitions to include ROS things in GUI compilation
 add_definitions(-DCATKIN_MAKE)
@@ -34,6 +35,7 @@ find_package(Qt5Core REQUIRED)
 find_package(Qt5Gui REQUIRED)
 find_package(Qt5Svg REQUIRED)
 
+
 # GUI -- Add src and includes
 set(MY_GUI_LIB_PATH_SRC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/src)
 set(MY_GUI_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/include)
@@ -355,7 +357,7 @@ target_link_libraries(PPSClient                ${catkin_LIBRARIES})
 target_link_libraries(SafeControllerService    ${catkin_LIBRARIES})
 target_link_libraries(DemoControllerService    ${catkin_LIBRARIES})
 target_link_libraries(StudentControllerService ${catkin_LIBRARIES})
-target_link_libraries(MpcControllerService     ${catkin_LIBRARIES})
+target_link_libraries(MpcControllerService     ${catkin_LIBRARIES} Eigen3::Eigen)
 target_link_libraries(CentralManagerService    ${catkin_LIBRARIES})
 target_link_libraries(ParameterService         ${catkin_LIBRARIES})
 
diff --git a/pps_ws/src/d_fall_pps/src/nodes/MpcControllerService.cpp b/pps_ws/src/d_fall_pps/src/nodes/MpcControllerService.cpp
index 194d25e5..e0ea789d 100644
--- a/pps_ws/src/d_fall_pps/src/nodes/MpcControllerService.cpp
+++ b/pps_ws/src/d_fall_pps/src/nodes/MpcControllerService.cpp
@@ -60,7 +60,7 @@
 
 #include <std_msgs/Int32.h>
 
-
+#include <Eigen/Dense>
 
 
 
@@ -246,7 +246,7 @@ void processFetchedParameters();
 
 
 //    ------------------------------------------------------------------------------
-//     OOO   U   U  TTTTT  EEEEE  RRRR 
+//     OOO   U   U  TTTTT  EEEEE  RRRR
 //    O   O  U   U    T    E      R   R
 //    O   O  U   U    T    EEE    RRRR
 //    O   O  U   U    T    E      R  R
@@ -403,8 +403,6 @@ bool calculateControlOutput(Controller::Request &request, Controller::Response &
 	}
 
 
-	
-
 	//  **********************
 	//  Y   Y    A    W     W
 	//   Y Y    A A   W     W
-- 
GitLab