aharmat / mcptam

MCPTAM is a set of ROS nodes for running Real-time 3D Visual Simultaneous Localization and Mapping (SLAM) using Multi-Camera Clusters. It includes tools for calibrating both the intrinsic and extrinsic parameters of the individual cameras within the rigid camera rig.
GNU General Public License v3.0
155 stars 95 forks source link

Build Error on Ubuntu 16.04 #16

Closed ardalanK closed 7 years ago

ardalanK commented 7 years ago

I am trying to build MCPTAM on Ubuntu 16.04 and am getting the following error:

/home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc: In member function ‘int ChainBundle::Compute(bool, int, double)’: /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:21: error: ‘MatrixXd’ was not declared in this scope SparseBlockMatrix spinv; // This will hold the covariance matrices ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:21: note: suggested alternative: In file included from /usr/include/eigen3/Eigen/Core:367:0, from /usr/include/eigen3/Eigen/Dense:1, from /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:45: /usr/include/eigen3/Eigen/src/Core/Matrix.h:428:34: note: ‘Eigen::MatrixXd’ typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \ ^ /usr/include/eigen3/Eigen/src/Core/Matrix.h:444:1: note: in expansion of macro ‘EIGEN_MAKE_TYPEDEFS’ EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ ^ /usr/include/eigen3/Eigen/src/Core/Matrix.h:451:1: note: in expansion of macro ‘EIGEN_MAKE_TYPEDEFS_ALL_SIZES’ EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d) ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:29: error: template argument 1 is invalid SparseBlockMatrix spinv; // This will hold the covariance matrices ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1334:57: error: no matching function for call to ‘g2o::SparseOptimizer::computeMarginals(int&, g2o::OptimizableGraph::VertexContainer&)’ if(mpOptimizer->computeMarginals(spinv, vPointVertices)) ^ In file included from /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:51:0: /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:131:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const std::vector<std::pair<int, int> >&) bool computeMarginals(SparseBlockMatrix& spinv, const std::vector<std::pair<int, int> >& blockIndices); ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:131:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:139:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const g2o::OptimizableGraph::Vertex) bool computeMarginals(SparseBlockMatrix& spinv, const Vertex vertex) { ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:139:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:154:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const VertexContainer&) bool computeMarginals(SparseBlockMatrix& spinv, const VertexContainer& vertices) { ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:154:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1343:30: error: request for member ‘block’ in ‘spinv’, which is of non-class type ‘int’ vCov22.push_back(spinv.block(i,i)->col(2)(2)); ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc: In member function ‘int ChainBundle::Compute(bool, int, double)’: /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:21: error: ‘MatrixXd’ was not declared in this scope SparseBlockMatrix spinv; // This will hold the covariance matrices ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:21: note: suggested alternative: In file included from /usr/include/eigen3/Eigen/Core:367:0, from /usr/include/eigen3/Eigen/Dense:1, from /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:45: /usr/include/eigen3/Eigen/src/Core/Matrix.h:428:34: note: ‘Eigen::MatrixXd’ typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \ ^ /usr/include/eigen3/Eigen/src/Core/Matrix.h:444:1: note: in expansion of macro ‘EIGEN_MAKE_TYPEDEFS’ EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ ^ /usr/include/eigen3/Eigen/src/Core/Matrix.h:451:1: note: in expansion of macro ‘EIGEN_MAKE_TYPEDEFS_ALL_SIZES’ EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d) ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:29: error: template argument 1 is invalid SparseBlockMatrix spinv; // This will hold the covariance matrices ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1334:57: error: no matching function for call to ‘g2o::SparseOptimizer::computeMarginals(int&, g2o::OptimizableGraph::VertexContainer&)’ if(mpOptimizer->computeMarginals(spinv, vPointVertices)) ^ In file included from /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:51:0: /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:131:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const std::vector<std::pair<int, int> >&) bool computeMarginals(SparseBlockMatrix& spinv, const std::vector<std::pair<int, int> >& blockIndices); ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:131:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:139:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const g2o::OptimizableGraph::Vertex) bool computeMarginals(SparseBlockMatrix& spinv, const Vertex vertex) { ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:139:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:154:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const VertexContainer&) bool computeMarginals(SparseBlockMatrix& spinv, const VertexContainer& vertices) { ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:154:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1343:30: error: request for member ‘block’ in ‘spinv’, which is of non-class type ‘int’ vCov22.push_back(spinv.block(i,i)->col(2)(2)); ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc: In member function ‘int ChainBundle::Compute(bool, int, double)’: /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:21: error: ‘MatrixXd’ was not declared in this scope SparseBlockMatrix spinv; // This will hold the covariance matrices ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:21: note: suggested alternative: In file included from /usr/include/eigen3/Eigen/Core:367:0, from /usr/include/eigen3/Eigen/Dense:1, from /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:45: /usr/include/eigen3/Eigen/src/Core/Matrix.h:428:34: note: ‘Eigen::MatrixXd’ typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \ ^ /usr/include/eigen3/Eigen/src/Core/Matrix.h:444:1: note: in expansion of macro ‘EIGEN_MAKE_TYPEDEFS’ EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ ^ /usr/include/eigen3/Eigen/src/Core/Matrix.h:451:1: note: in expansion of macro ‘EIGEN_MAKE_TYPEDEFS_ALL_SIZES’ EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d) ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1332:29: error: template argument 1 is invalid SparseBlockMatrix spinv; // This will hold the covariance matrices ^ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1334:57: error: no matching function for call to ‘g2o::SparseOptimizer::computeMarginals(int&, g2o::OptimizableGraph::VertexContainer&)’ if(mpOptimizer->computeMarginals(spinv, vPointVertices)) ^ In file included from /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:51:0: /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:131:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const std::vector<std::pair<int, int> >&) bool computeMarginals(SparseBlockMatrix& spinv, const std::vector<std::pair<int, int> >& blockIndices); ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:131:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:139:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const g2o::OptimizableGraph::Vertex) bool computeMarginals(SparseBlockMatrix& spinv, const Vertex* vertex) { ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:139:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:154:10: note: candidate: bool g2o::SparseOptimizer::computeMarginals(g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&, const VertexContainer&) bool computeMarginals(SparseBlockMatrix& spinv, const VertexContainer& vertices) { ^ /opt/ros/kinetic/include/g2o/core/sparse_optimizer.h:154:10: note: no known conversion for argument 1 from ‘int’ to ‘g2o::SparseBlockMatrix<Eigen::Matrix<double, -1, -1> >&’ /home/ardalan/catkin_ws/src/mcptam/src/ChainBundle.cc:1343:30: error: request for member ‘block’ in ‘spinv’, which is of non-class type ‘int’ vCov22.push_back(spinv.block(i,i)->col(2)(2)); ^ mcptam/CMakeFiles/pose_calibrator.dir/build.make:758: recipe for target 'mcptam/CMakeFiles/pose_calibrator.dir/src/ChainBundle.cc.o' failed make[2]: [mcptam/CMakeFiles/pose_calibrator.dir/src/ChainBundle.cc.o] Error 1 CMakeFiles/Makefile2:442: recipe for target 'mcptam/CMakeFiles/pose_calibrator.dir/all' failed make[1]: [mcptam/CMakeFiles/pose_calibrator.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... mcptam/CMakeFiles/mcptam_server.dir/build.make:590: recipe for target 'mcptam/CMakeFiles/mcptam_server.dir/src/ChainBundle.cc.o' failed make[2]: [mcptam/CMakeFiles/mcptam_server.dir/src/ChainBundle.cc.o] Error 1 CMakeFiles/Makefile2:2206: recipe for target 'mcptam/CMakeFiles/mcptam_server.dir/all' failed make[1]: [mcptam/CMakeFiles/mcptam_server.dir/all] Error 2 mcptam/CMakeFiles/mcptam.dir/build.make:662: recipe for target 'mcptam/CMakeFiles/mcptam.dir/src/ChainBundle.cc.o' failed make[2]: [mcptam/CMakeFiles/mcptam.dir/src/ChainBundle.cc.o] Error 1 CMakeFiles/Makefile2:553: recipe for target 'mcptam/CMakeFiles/mcptam.dir/all' failed make[1]: [mcptam/CMakeFiles/mcptam.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j12 -l12" failed

Any idea how I might be able to fix this?

Thanks.

ardalanK commented 7 years ago

The error seems to be starting in ChainBundle.cc @ line 1332 SparseBlockMatrix spinv;

murrdpirate commented 6 years ago

For the record, this appears to be resolved by changing MatrixXd to MatrixXD on line 1330 in ChainBundle.cc. Took me way too long to notice.