Using your own library in ROS Indigo

I am working on a project in ROS Indigo that requires the use of native libraries. According to the indigo / migration page on the ROS Wiki, the FindEigen.cmake module is now in the cmake_modules package.

After following the steps to add the cmake_modules package to the CMake.txt project (via find_package) and add the build dependency to package.xml ( < build_depend >cmake_modules< /build_depend >

), I am still having problems compiling the project. I looked at various sources referencing the above steps to fix the issue in ROS Indigo, but can't seem to get it to work. Here is the CMake file , and here is the package.xml . Also, I added the FindEigen.cmake file to my 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)

      

+3


source to share


4 answers


Just for completeness of the post, and follow this answer in the ROS answers:

If you already have Eigen installed (check with sudo apt-get install libeigen3-dev

), you must add the appropriate lines to cmake_modules

both the Eigen

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}
 )

      



UPDATE: Please note that the following is not required as the FindEigen.cmake module does not define Eigen_LIBRARIES

becuse it is only a header library:

 target_link_libraries(my_target
   ....
   ${Eigen_LIBRARIES}
 )

      

More information: http://wiki.ros.org/indigo/Migration#cmake_modules

UPDATE : <run_depend>cmake_modules</run_depend>

Not really required as cmake_modules

it is not an execution dependency.


Alternatively, you can use the ROS ecl wrappers: http://wiki.ros.org/ecl

+5


source


Eigen is not a ROS package but a stand-alone library. So instead of listing it as a catkin component, just add a separate call find_package

:

find_package(Eigen REQUIRED)

      



I can't double-check it right now (currently sitting on a groovy machine), but I'm pretty sure this worked for me with indigo as well.

0


source


I had the same problem, this fixed it: (Ubuntu 14.04)

sudo apt-get install libeigen3-dev

0


source


For me, "sudo apt-get install libeigen3-dev" didn't work. So I installed it via make file and following the installation procedure given in the package i.e.

-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

      

If that doesn't solve your problem, you can copy the eigen3 folder from wherever it is (mine was at /usr/local/include)

to / usr / include. Use the command

sudo cp -r /usr/local/include/eigen3  /usr/include

      

0


source







All Articles