Eigen libriary does not work
hi guys,
I am working on Indigo installed on Ubuntu 14.04.
I want to use Eigen library in my code. I used this tutorial to add the library to my codes. I also checked this one.
After following these two tutorials, my package.xml
contains:
<build_depend>cmake_modules</build_depend>
<run_depend>cmake_modules</run_depend>
and my CMakeLists.txt
has these lines:
find_package(catkin REQUIRED COMPONENTS cmake_modules )
find_package(Eigen REQUIRED)
catkin_package(
INCLUDE_DIRS include
LIBRARIES talker1
CATKIN_DEPENDS roscpp rospy std_msgs geometry_msgs nav_msgs tf cmake_modules
DEPENDS Eigen
)
add_executable(CRControl1 src/CRControl1.cpp)
add_dependencies(CRControl1 beginner_tutorials_generate_messages_cpp)
target_link_libraries(CRControl1 ${catkin_LIBRARIES} ${EIGEN_LIBRARIES})
But unfortunately, non of them worked. when I am trying to compile, I get this error:
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:52:40: error: ‘RowMajorBit’ was not declared in this scope
Options = MatrixType::Options & ~RowMajorBit, // these are the options for the TmpMatrixType, we need a ColMajor matrix here!
In file included from /home/soheil/catkin_ws/src/talker1/src/CRControl1.h:31:0,
from /home/soheil/catkin_ws/src/talker1/src/CRControl1.cpp:1:
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:58:22: error: expected nested-name-specifier before ‘NumTraits’
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:58:22: error: expected ‘;’ at end of member declaration
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:58:31: error: expected unqualified-id before ‘<’ token
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:60:13: error: ‘Matrix’ does not name a type
typedef Matrix<Scalar, RowsAtCompileTime, 1, Options, MaxRowsAtCompileTime, 1> TmpMatrixType;
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:62:13: error: ‘Transpositions’ does not name a type
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime> TranspositionType;
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:63:13: error: ‘PermutationMatrix’ does not name a type
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> PermutationType;
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:125:18: error: ‘TranspositionType’ does not name a type
inline const TranspositionType& transpositionsP() const
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:132:12: error: ‘Diagonal’ does not name a type
inline Diagonal<const MatrixType> vectorD() const
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:175:18: error: ‘solve_retval’ in namespace ‘Eigen::internal’ does not name a type
inline const internal::solve_retval<LDLT, Rhs>
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:194:23: error: ‘MatrixBase’ has not been declared
bool solveInPlace(MatrixBase<Derived> &bAndX) const;
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:194:33: error: expected ‘,’ or ‘...’ before ‘<’ token
bool solveInPlace(MatrixBase<Derived> &bAndX) const;
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:199:28: error: ‘MatrixBase’ does not name a type
LDLT& rankUpdate(const MatrixBase<Derived>& w, const RealScalar& alpha=1);
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:199:38: error: expected ‘,’ or ‘...’ before ‘<’ token
LDLT& rankUpdate(const MatrixBase<Derived>& w, const RealScalar& alpha=1);
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:221:5: error: ‘ComputationInfo’ does not name a type
ComputationInfo info() const
^
/usr/include/eigen3/Eigen/src/Cholesky/LDLT.h:236:5: error ...