按照网上DynaSLAM的Readme文档步骤进行配置,在编译DynaSLAM工程的时候报以下错误:
In file included from /home/hust220/catkin_ws/DynaSLAM/src/Conversion.cc:9:0:
/home/hust220/catkin_ws/DynaSLAM/include/Conversion.h:17:27: fatal error: ndarrayobject.h: No such file or directory
compilation terminated.
CMakeFiles/DynaSLAM.dir/build.make:518: recipe for target 'CMakeFiles/DynaSLAM.dir/src/Conversion.cc.o' failed
make[2]: *** [CMakeFiles/DynaSLAM.dir/src/Conversion.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/hust220/catkin_ws/DynaSLAM/include/MaskNet.h:26:0,
from /home/hust220/catkin_ws/DynaSLAM/src/MaskNet.cc:9:
/home/hust220/catkin_ws/DynaSLAM/include/Conversion.h:17:27: fatal error: ndarrayobject.h: No such file or directory
compilation terminated.
CMakeFiles/DynaSLAM.dir/build.make:542: recipe for target 'CMakeFiles/DynaSLAM.dir/src/MaskNet.cc.o' failed
make[2]: *** [CMakeFiles/DynaSLAM.dir/src/MaskNet.cc.o] Error 1
通过cmake发现cmakelist找到的python库为python3.5
PROJECT_SOURCE_DIR:
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found version "3.5.2")
PYTHON LIBS were found!
PYTHON LIBS DIRECTORY: /usr/lib/x86_64-linux-gnu/libpython3.5m.so
编译时声明python路径
cmake -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib ..
并在include_directories里面添加numpy的安装路径
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${EIGEN3_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
/usr/include/python2.7/
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/
${Boost_INCLUDE_DIRS}
)
编译成功