Eigen ROS package deprecated (ROS Electric). Old documentation
Eigen has been replaced with a rosdep system dependency. Electric also switched to Eigen 3. To migrate from Eigen2 to Eigen 3 see this guide
Contents
Electric: Porting to system dependency
Starting in ROS Electric, Eigen 3 is installed as a system dependency. This means that you compile against Eigen 3 without requiring any ROS-specific build tools.
CMakeLists.txt
For convenience, the system install includes CMake config files for easily finding and configuring Eigen in your CMakeLists.txt using the normal find_package() macro:
find_package(Eigen REQUIRED) include_directories(${EIGEN_INCLUDE_DIRS})
Eigen is a header-only library, so you do not need to specify any linking.
Unfortunately, Eigen on Ubuntu does not have a FindEigen.cmake file and we do not have that file in a ROS package yet. You need to include it by default in your package (in a ./cmake folder for example). You can get if from here: https://code.ros.org/svn/ros-pkg/stacks/laser_pipeline/trunk/laser_geometry/cmake/FindEigen.cmake
You then need to add the following before the find_package CMake instruction:
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
Package/stack dependencies
Eigen is defined in the common_rosdeps stack/package. You will need to update
manifest.xml
<depend package="common_rosdeps" /> <rosdep name="eigen" />
stack.xml
<depend stack="common_rosdeps" />
Documentation
Please see the Eigen homepage for documentation on the Eigen library. See also:
To help you get started with Eigen, we've put together an Eigen Cookbook.