Skip to content
Snippets Groups Projects
Commit f94297c6 authored by mnaveau's avatar mnaveau
Browse files

Improve the choice of using or not the hrp2-dynamics library

parent 40b8772d
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,15 @@
# received a copy of the GNU Lesser General Public License along with
# sot-pattern-generator. If not, see <http://www.gnu.org/licenses/>.
IF(HRP2_DYNAMICS_FOUND)
MESSAGE(STATUS "hrp2-dynamics: found")
ELSE(NOT HRP2_DYNAMICS_FOUND)
MESSAGE(STATUS "hrp2-dynamics: not found")
ENDIF(HRP2_DYNAMICS_FOUND)
SET(WITH_HRP2_DYNAMICS "" CACHE STRING "Option to use HRP2-DYNAMICS robot in the PG" )
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_DEFINITIONS(-DDEBUG=2)
......@@ -105,8 +114,17 @@ FOREACH(LIBRARY_NAME ${plugins})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} jrl-dynamics-urdf)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} jrl-walkgen)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} jrl-dynamics-urdf)
IF(HRP2_DYNAMICS_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} hrp2-dynamics)
IF(NOT ${WITH_HRP2_DYNAMICS} EQUAL "" )
TARGET_COMPILE_DEFINITIONS(${LIBRARY_NAME} PRIVATE WITH_HRP2DYNAMICS=1)
ENDIF(NOT ${WITH_HRP2_DYNAMICS} EQUAL "" )
ENDIF(HRP2_DYNAMICS_FOUND)
IF(HRP2_DYNAMICS_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} hrp2-dynamics)
#TARGET_COMPILE_DEFINITIONS(${LIBRARY_NAME} PRIVATE WITH_HRP2DYNAMICS=1)
ENDIF(HRP2_DYNAMICS_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} sot-core)
......@@ -120,7 +138,6 @@ FOREACH(LIBRARY_NAME ${plugins})
ENDFOREACH(LIBRARY_NAME)
# --- PY ---
# Install lonely files
SET(PYTHON_MODULE dynamic_graph/sot/pattern_generator)
......
......@@ -18,7 +18,7 @@
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
//#define VP_DEBUG
#define VP_DEBUG_MODE 45
//#define VP_DEBUG_MODE 45
#include <sot/core/debug.hh>
#ifdef VP_DEBUG
class sotPG__INIT
......@@ -33,7 +33,7 @@
#include <jrl/dynamics/dynamicsfactory.hh>
#ifdef WITH_HRP2DYNAMICS
# include <hrp2Dynamics/hrp2Opthumanoid-dynamic-robot.hh>
# include <hrp2-dynamics/hrp2OptHumanoidDynamicRobot.h>
#endif
#include <dynamic-graph/factory.h>
......@@ -505,11 +505,12 @@ namespace dynamicgraph {
dynamicsJRLJapan::ObjectFactory aRobotDynamicsObjectConstructor;
CjrlHumanoidDynamicRobot * aHDR = 0;
#ifndef WITH_HRP2DYNAMICS
#ifndef WITH_HRP2DYNAMICS // WITH_HRP2DYNAMICS is not defined
aHDR = aRobotDynamicsObjectConstructor.createHumanoidDynamicRobot();
#else
aHDR = new Chrp2OptHumanoidDynamicRobot(&aRobotDynamicsObjectConstructor);
#endif
#else // WITH_HRP2DYNAMICS is defined
Chrp2OptHumanoidDynamicRobot *aHRP2HDR = new Chrp2OptHumanoidDynamicRobot(&aRobotDynamicsObjectConstructor) ;
aHDR = aHRP2HDR ;
#endif // end "if WITH_HRP2DYNAMICS defined"
// Parsing the file.
string RobotFileName = m_vrmlDirectory + m_vrmlMainFile;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment