Ask Your Question
0

Based on ROS, I want to run a cpp file which use Eigen

asked 2016-02-01 09:21:28 -0500

ZYS gravatar image

updated 2016-02-01 10:03:11 -0500

gvdhoorn gravatar image

Since the matrix geometry is complicated on C++, I download Eigen online and type #include <Eigen\Dense> in my cpp code file. Based on Visual Studio, I can just add path of Eigen by modifying the property of project. However, I want to run the cpp file on Ros and I cannot add path by modifying the property of project just like the visual studio. I have no idea. Please help me.

edit retag flag offensive close merge delete

Comments

More info would help. Which OS and ROS version are you using? Do you have a workspace with packages that you run? Can you provide a minimal example of what you would like to do? Which commands are you running that fail and what is the output?

Thomas D gravatar image Thomas D  ( 2016-02-01 10:03:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-01 10:14:48 -0500

In order to use Eigen in a ROS package (on Indigo and newer), you will need to edit your package.xml and CMakeLists.txt. Basically you need to depend on the cmake_modules package, and then you can use standard find_package(Eigen REQUIRED) in your CMakeLists.txt. More about this can be read on the Indigo migration guide or the usage instructions for cmake_modules.

edit flag offensive delete link more

Comments

Thanks for your suggestion. I have solved this problem by running g++ -std=c++0x -I /usr/local/include/eigen3 myprogram.cpp -o myprogram

ZYS gravatar image ZYS  ( 2016-02-05 12:02:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-02-01 09:21:28 -0500

Seen: 880 times

Last updated: Feb 01 '16