在ROS Indigo中使用Eigen库 [英] Using Eigen Library in ROS Indigo
问题描述
我正在ROS Indigo的项目上工作,需要使用Eigen库。根据ROS Wiki上的indigo / Migration页面,FindEigen.cmake模块现在在cmake_modules包中。
I am working on a project in ROS Indigo that requires using the Eigen libraries. According to indigo/Migration page on the ROS Wiki, the FindEigen.cmake module is now in the cmake_modules package.
以下步骤将cmake_modules包添加到项目的CMake.txt(通过find_package)并添加一个构建依赖项到package.xml( < build_depend> cmake_modules< / build_depend>
),我仍然遇到编译项目的问题。我看过各种来源援引上述步骤应解决这个问题在ROS Indigo,但似乎不能得到它的工作。以下是 CMake 文件,此处是 package.xml 。此外,我在项目文件夹中添加了FindEigen.cmake文件。任何帮助将非常感谢!错误信息如下:
After following steps to add the cmake_modules package to the project's CMake.txt (via find_package) and adding a build dependency to the package.xml (< build_depend >cmake_modules< /build_depend >
), I'm still having issues compiling the project. I've looked at various sources citing the above steps should fix the issue in ROS Indigo, but can't seem to get it working. Here is the CMake file, and here is the package.xml . Additionally, I added the FindEigen.cmake file in the project folder. Any help would be greatly appreciated! The error reads:
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)
推荐答案
仅仅针对帖子完整性,以及这个答案在答案ROS:
Just for post completeness, and following this answer in Answers ROS:
如果你已经安装了Eigen(检查 sudo apt-get install libeigen3-dev
),那么你必须添加相应的 cmake_modules
和 Eigen
CMakeLists.txt和package.xml文件:
If you have Eigen already installed (check with sudo apt-get install libeigen3-dev
), then you have to add the corresponding cmake_modules
and Eigen
lines to the CMakeLists.txt and package.xml files:
package.xml
<build_depend>cmake_modules</build_depend>
<run_depend>cmake_modules</run_depend>
CMakeLists.txt
find_package(catkin REQUIRED cmake_modules)
find_package(Eigen REQUIRED)
catkin_package(
INCLUDE_DIRS ...
LIBRARIES ...
CATKIN_DEPENDS ....
DEPENDS Eigen
)
include_directories(
...
${Eigen_INCLUDE_DIRS}
)
target_link_libraries(my_target
....
${Eigen_LIBRARIES}
)
详情: http:// wiki .ros.org / indigo / Migration#cmake_modules
UPDATE :其实< run_depend>不需要cmake_modules< / run_depend>
,因为 cmake_modules
不是运行时依赖。
UPDATE: In fact <run_depend>cmake_modules</run_depend>
is not needed as cmake_modules
are not a runtime dependency.
此外,您可以使用ROS ecl包装程序: http:// wiki.ros.org/ecl
In addition, you could use the ROS ecl wrappers: http://wiki.ros.org/ecl
这篇关于在ROS Indigo中使用Eigen库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!