From 06bdb35a57e5c0a6e7060653d130241ec461a7cd Mon Sep 17 00:00:00 2001
From: Steve Tonneau <stonneau@laas.fr>
Date: Wed, 8 Mar 2017 17:59:56 +0100
Subject: [PATCH] eigenpy dependency

---
 CMakeLists.txt                        |  1 -
 python/CMakeLists.txt                 |  9 +++++++++
 python/centroidal_dynamics_python.cpp | 12 +++++++-----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6886681..f0bc1a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,6 @@ IF(BUILD_PYTHON_INTERFACE)
 	find_package( Boost COMPONENTS python REQUIRED )
 	include_directories( ${Boost_INCLUDE_DIR} )
 
-	SET(PKG_CONFIG_PYWRAP_REQUIRES "eigenpy >= 1.3.1")
 ENDIF(BUILD_PYTHON_INTERFACE)
 
 
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 34d4390..c5fbdae 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -3,10 +3,19 @@ cmake_minimum_required( VERSION 2.8 )
 include_directories("${INCLUDE_DIR}")
 include_directories("${EIGEN3_INCLUDE_DIR}")
 
+ADD_REQUIRED_DEPENDENCY("eigenpy")
+
+
 # Define the wrapper library that wraps our library
 add_library( centroidal_dynamics SHARED centroidal_dynamics_python.cpp )
 target_link_libraries( centroidal_dynamics ${Boost_LIBRARIES} ${PROJECT_NAME} )
 # don't prepend wrapper library name with lib
 set_target_properties( centroidal_dynamics PROPERTIES PREFIX "" )
 
+IF(APPLE)
+	# We need to change the extension for python bindings
+	SET_TARGET_PROPERTIES(centroidal_dynamics PROPERTIES SUFFIX ".so")
+ENDIF(APPLE)
+PKG_CONFIG_USE_DEPENDENCY(centroidal_dynamics eigenpy)
+
 #INSTALL(TARGETS centroidal_dynamics DESTINATION lib)
diff --git a/python/centroidal_dynamics_python.cpp b/python/centroidal_dynamics_python.cpp
index 91aa651..9b8cb27 100644
--- a/python/centroidal_dynamics_python.cpp
+++ b/python/centroidal_dynamics_python.cpp
@@ -3,6 +3,7 @@
 
 #include <eigenpy/memory.hpp>
 #include <eigenpy/eigenpy.hpp>
+#include <eigenpy/geometry.hpp>
 
 #include <boost/python.hpp>
 
@@ -12,10 +13,10 @@ namespace centroidal_dynamics
 {
 using namespace boost::python;
 
-bool wrapSetNewContacts(Equilibrium& self, MatrixX3 contactPoints, MatrixX3 contactNormals,
-                    double frictionCoefficient, EquilibriumAlgorithm alg)
+bool wrapSetNewContacts(Equilibrium& self, const MatrixXX& contactPoints, const MatrixXX& contactNormals) //,
+                    //double frictionCoefficient, EquilibriumAlgorithm alg)
 {
-    return self.setNewContacts(contactPoints, contactNormals, frictionCoefficient, alg);
+    return self.setNewContacts(contactPoints, contactNormals, 0.3, EQUILIBRIUM_ALGORITHM_LP);
 }
 
 
@@ -25,8 +26,9 @@ BOOST_PYTHON_MODULE(centroidal_dynamics)
     eigenpy::enableEigenPy();
 
     eigenpy::enableEigenPySpecific<MatrixX3,MatrixX3>();
-    /*eigenpy::exposeAngleAxis();
-    eigenpy::exposeQuaternion();*/
+    eigenpy::enableEigenPySpecific<MatrixXX,MatrixXX>();
+    eigenpy::exposeAngleAxis();
+    eigenpy::exposeQuaternion();
 
     /** END eigenpy init**/
 
-- 
GitLab