在CMakeList文件中分别添加以上三处
find_package(catkin REQUIRED COMPONENTS
cmake_modules
)
find_package(Eigen REQUIRED)
include_directories(
${EIGEN_INCLUDE_DIRS}
)
如果不加第一句,会出现错误
By not providing "FindEigen.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen" with any of
the following names:
EigenConfig.cmake
eigen-config.cmake
参考:http://wiki.ros.org/eigen