Commit a5328dc5 authored by Florian Valenza's avatar Florian Valenza
Browse files

[cmake][python] Define flag in order to control urdf inclusion

parent 950cdc75
......@@ -136,11 +136,13 @@ SET(HEADERS
)
IF(URDFDOM_FOUND)
LIST(APPEND HEADERS multibody/parser/urdf.hpp)
SET(${PROJECT_NAME}_MULTIBODY_PARSER_HEADERS
${${PROJECT_NAME}_MULTIBODY_PARSER_HEADERS}
multibody/parser/urdf.hpp
)
LIST(APPEND HEADERS
${${PROJECT_NAME}_MULTIBODY_PARSER_HEADERS}
)
ENDIF(URDFDOM_FOUND)
IF(LUA5_1_FOUND)
......
......@@ -75,6 +75,9 @@ IF(EIGENPY_FOUND)
TARGET_LINK_LIBRARIES(${PYWRAP} ${Boost_LIBRARIES} ${PROJECT_NAME})
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/python/${PROJECT_NAME}")
IF(URDFDOM_FOUND)
ADD_TARGET_CFLAGS (${PYWRAP} "-DWITH_URDFDOM")
ENDIF(URDFDOM_FOUND)
IF(LUA5_1_FOUND)
ADD_TARGET_CFLAGS (${PYWRAP} "-DWITH_LUA")
ENDIF(LUA5_1_FOUND)
......
......@@ -7,7 +7,9 @@
#include "pinocchio/python/model.hpp"
#include "pinocchio/python/data.hpp"
#include "pinocchio/multibody/parser/urdf.hpp"
#ifdef WITH_URDFDOM
#include "pinocchio/multibody/parser/urdf.hpp"
#endif
#ifdef WITH_LUA
#include "pinocchio/multibody/parser/lua.hpp"
......@@ -19,6 +21,8 @@ namespace se3
{
struct ParsersPythonVisitor
{
#ifdef WITH_URDFDOM
static ModelHandler buildModelFromUrdf( const std::string & filename,
bool ff )
{
......@@ -26,6 +30,7 @@ namespace se3
*model = se3::urdf::buildModel(filename,ff);
return ModelHandler(model,true);
}
#endif
#ifdef WITH_LUA
static ModelHandler buildModelFromLua(const std::string & filename,
......@@ -42,11 +47,14 @@ namespace se3
/* --- Expose --------------------------------------------------------- */
static void expose()
{
#ifdef WITH_URDFDOM
bp::def("buildModelFromUrdf",buildModelFromUrdf,
bp::args("Filename (string)",
"Free flyer (bool, false for a fixed robot)"),
"Parse the urdf file given in input and return a proper pinocchio model "
"(remember to create the corresponding data structure).");
#endif
#ifdef WITH_LUA
bp::def("buildModelFromLua",buildModelFromLua,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment