Using Eigen libraries in ROS

Hi, I am fairly new to ROS and was wanting to do some matrix multiplication in a node. I found that Eigen has a good range of different matrices and vectors to use but was not quite sure what modifications I would have to make to allow it to be used in ROS.

First of all when I download the libraries, where do I put them? Is it inside the workspace folder, the src folder inside the workspace folder or is it inside the package inside the src folder? So one of these:

/workspace
/workspace/src
/workspace/src/package


In addition what changes do I have to make to the CMakeLists.txt file inside the package to include these new libraries?

Is there anything else I have to do in order to get these libraries working? I take it I need to include the header files in the node files I’m using (i.e. #include <Eigen/Eigen> #include <Eigen/Eigenvalues>)

Any help would be greatly appreciated. I am using catkin and the OS is Ubuntu Kinetic 16.04. If any more information is required please don't hesitate to ask.

edit retag close merge delete

Sort by » oldest newest most voted

I have installed the Eigen headers at /usr/local/include/Eigen3/.

I use link_directories(/usr/local/include)  in my CMakeLists and in my node I use

#include <Eigen3/Eigen/Dense>


I did read at (catkin_wiki) that the link_directories is not preferred but as of now I have not been able to get it working with FIND_LIBRARY and TARGET_LINK_LIBRARY. Will update the answer when I do

*Tested on Indigo and 14.04. But I think should work with your configuration as well

more
more