fatal error Eigen/core: No such file or directory
Hi everybody,
i'm trying to use eigen with ros electric. I don't know if I'm missing some aspects or just misunderstand the whole thing. I installed eigen via
sudo apt-get install ros-electric-eigen
As mentioned in the eigen Wiki for electric Installation I downloaded the FindEigen.cmake and moved it in the cmake directory of my package.
In the CMakeList.txt I appended
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Eigen REQUIRED)
include_directories(${EIGEN_INCLUDE_DIRS})
Furthermore I edited the manifest.xml and included
<depend package="common_rosdeps" />
<rosdep name="eigen" />
But now I don't know how to include it within my cpp file. I've had look at the laser_geometry package, where the FindEigen.cmake comes from, but if I do it like this
#include <ros/ros.h>
#include <Eigen/Core>
...
i get an error making my package:
fatal error Eigen/Core: No such file or directory
What do i have to include within my cpp file or am I doing something else quite wrong? Most information I've found does not cover my problem or is referring to Fuerte installs.
thanking you in anticipation
Ah, ok sorry. Just referred to the errors. Here the rosmake output:
[ rosmake ] No package specified. Building ['testEigen']
[ rosmake ] Packages requested are: ['testEigen']
[ rosmake ] Logging to directory/home/namco/.ros/rosmake/rosmake_output-20121107-163504
[ rosmake ] Expanded args ['testEigen'] to:
['testEigen']
[ rosmake ] Checking rosdeps compliance for packages testEigen. This may take a few seconds.
[ rosmake ] rosdep check passed all system dependencies in packages
[rosmake-0] Starting >>> rosbuild [ make ]
[rosmake-0] Finished <<< rosbuild ROS_NOBUILD in package rosbuild
No Makefile in package rosbuild
[rosmake-1] Starting >>> cpp_common [ make ]
[rosmake-0] Starting >>> roslang [ make ]
[rosmake-0] Finished <<< roslang ROS_NOBUILD in package roslang
No Makefile in package roslang
[rosmake-1] Finished <<< cpp_common ROS_NOBUILD in package cpp_common
[rosmake-0] Starting >>> roslib [ make ]
[rosmake-1] Starting >>> roscpp_traits [ make ]
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib
[rosmake-1] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits
[rosmake-0] Starting >>> rostime [ make ]
[rosmake-0] Finished <<< rostime ROS_NOBUILD in package rostime
[rosmake-1] Starting >>> xmlrpcpp [ make ]
[rosmake-0] Starting >>> roscpp_serialization [ make ]
[rosmake-0] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization
[rosmake-1] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp
[rosmake-0] Starting >>> rosconsole [ make ]
[rosmake-0] Finished <<< rosconsole ROS_NOBUILD in package rosconsole
[rosmake-1] Starting >>> std_msgs [ make ]
[rosmake-1] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
[rosmake-0] Starting >>> common_rosdeps [ make ]
[rosmake-1] Starting >>> rosgraph_msgs [ make ]
[rosmake-0] Finished <<< common_rosdeps ROS_NOBUILD in package common_rosdeps
[rosmake-1] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs
[rosmake-1] Starting >>> roscpp [ make ]
[rosmake-1] Finished <<< roscpp ROS_NOBUILD in package roscpp
[rosmake-1] Starting >>> testEigen [ make ]
[ rosmake ] All 37 linesestEigen: 4.0 sec ] [ 1 Active 14/15 Complete ]
{-------------------------------------------------------------------------------
mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake ..
[rosbuild] Building package testEigen
[rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/roslisp/cmake/roslisp.cmake
[rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/rospy/cmake/rospy.cmake
[rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_TOOLCHAIN_FILE
-- Build files have been written to: /home/namco/ros/testEigen/build
cd build && make -l2
make[1 ...
Did you get any other errors? What is the output of
VERBOSE=1 make
?No, when i do make VERBOSE=1 it's the same. Only this error and after that compilation is terminated.
I'm sure, there is more output than just the error. Please provide the COMPLETE output.
eigen is not added to the include. If it is installed, check the output of the variables that FindEigen produces.
Your fix is not a real fix. You basically manually specified to look in /usr/include/eigen3/Eigen/Core. The original code was correct. The problem lies in the compile setup, which should add /usr/include/eigen3 to the include.
Okay, I see what you mean. FindEigen should produce EIGEN_FOUND, EIGEN_INCLUDE_DIR and EIGEN_VERSION, correct? So they should be via echo $EIGEN_FOUND available after rosmake? Or after running CMakeList.txt? I use QtCreator in which i can run them. Nevertheless there are no Variables available.
Yes, those should be produced. Either they are not produced or not used for some reason.Those are not environment variables, but CMAKE variables. You can use cmake's message function to output them.
If I message Variables at the end of CMakeList.txt I get TRUE for EIGEN_FOUND, /usr/include/eigen3 for EIGEN_INCLUDE_DIR and 3.0.1 for EIGEN_VERSION