Cmake 在rosindigo中使用特征库
我正在ROS Indigo的一个项目中工作,该项目需要使用Eigen库。根据ROS Wiki上的indigo/Migration页面,FindEigen.cmake模块现在位于cmake_模块包中 按照以下步骤将cmake_modules包添加到项目的cmake.txt(通过find_包)并将构建依赖项添加到package.xml(Cmake 在rosindigo中使用特征库,cmake,eigen,ros,Cmake,Eigen,Ros,我正在ROS Indigo的一个项目中工作,该项目需要使用Eigen库。根据ROS Wiki上的indigo/Migration页面,FindEigen.cmake模块现在位于cmake_模块包中 按照以下步骤将cmake_modules包添加到项目的cmake.txt(通过find_包)并将构建依赖项添加到package.xml(cmake_modules)之后,我仍然在编译项目时遇到问题。我查看了各种来源,引用上述步骤可以解决ROS Indigo中的问题,但似乎无法使其正常工作。这是文件,这
cmake_modules
)之后,我仍然在编译项目时遇到问题。我查看了各种来源,引用上述步骤可以解决ROS Indigo中的问题,但似乎无法使其正常工作。这是文件,这是文件。此外,我还在项目文件夹中添加了FindEigen.cmake文件。任何帮助都将不胜感激!错误内容如下:
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75 (find_package):
Could not find a package configuration file provided by "Eigen" with any of the
following names:
EigenConfig.cmake
eigen-config.cmake
Add the installation prefix of "Eigen" to CMAKE_PREFIX_PATH or set
"Eigen_DIR" to a directory containing one of the above files. If "Eigen"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
lidar_point_cloud/CMakeLists.txt:9 (find_package)
Eigen不是一个ROS包,而是一个独立的库。因此,不要将其作为catkin的一个组件列出,只需添加一个单独的
find\u包
调用:
find_package(Eigen REQUIRED)
我现在无法再次检查它(目前正在使用groovy的机器上),但我非常确定,这对我使用indigo也有效。我也有同样的问题,这解决了它:(Ubuntu 14.04)
sudo-apt-get-install-libeigen3-dev
仅用于发布完整性,以下为答案:
如果已经安装了Eigen(请与sudo apt get install libegen3 dev
联系),则必须将相应的cmake_模块
和Eigen
行添加到CMakeLists.txt和package.xml文件中:
package.xml
<build_depend>cmake_modules</build_depend>
<run_depend>cmake_modules</run_depend>
更新:请注意,以下内容不是必需的,因为模块没有定义Eigen_库
,因为它是一个仅标题的库:
target_link_libraries(my_target
....
${Eigen_LIBRARIES}
)
更多信息:
更新:事实上,cmake_模块
不需要,因为cmake_模块
不是运行时依赖项
此外,您可以使用ROS ecl包装器:对我来说,“sudo apt get install libegen3 dev”不起作用。因此,我通过make文件并按照软件包中给出的安装程序安装了它,即
-download the package from http://eigen.tuxfamily.org/index.php?title=Main_Page
-create another directory which we will call 'build_dir'
-cd build_dir
-cmake source_dir
-make install
如果这不能解决您的问题,您可以将eigen3文件夹从(我的位于/usr/local/include)
复制到/usr/include。使用命令
sudo cp -r /usr/local/include/eigen3 /usr/include
另外,我在ubuntuth上使用rosindigo
${Eigen_LIBRARIES}
是不需要的。Eigen是一个只有标题的库,所以没有任何链接。
sudo cp -r /usr/local/include/eigen3 /usr/include