rgbdslamv2在catkin_make时的错误代码

执行到75%时开始出现以下错误

 In file included from /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:32:0:

   /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:40:
error: ‘cv::vector’ has not been declared
   void detect(const cv::Mat& image, cv::vector& keypoints, std::vector& descriptors, const cv::Mat& mask = cv::Mat()) const;
                                        ^
   /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:46:
error: expected ‘,’ or ‘...’ before ‘<’ token
   void detect(const cv::Mat& image, cv::vector& keypoints, std::vector& descriptors, const cv::Mat& mask = cv::Mat()) const;
                                              ^
     In file included from /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/misc.cpp:41:0:
     /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:65:56:
error: ‘vector’ has not been declared
     void operator()(InputArray image, InputArray mask, vector& keypoints) const;
                                                        ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:65:62:
error: expected ‘,’ or ‘...’ before ‘<’ token
     void operator()(InputArray image, InputArray mask, vector& keypoints) const;
                                                              ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:68:57:
error: ‘vector’ has not been declared
     void operator()( InputArray image, InputArray mask, vector& keypoints,
                                                         ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:68:63:
error: expected ‘,’ or ‘...’ before ‘<’ token
     void operator()( InputArray image, InputArray mask, vector& keypoints,
                                                               ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:68:10:
error: ‘void cv::AORB::operator()(cv::InputArray, cv::InputArray, int) const’ cannot be overloaded
     void operator()( InputArray image, InputArray mask, vector& keypoints,
          ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:65:10:
error: with ‘void cv::AORB::operator()(cv::InputArray, cv::InputArray, int) const’
     void operator()(InputArray image, InputArray mask, vector& keypoints) const;
          ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:71:5:
error: ‘AlgorithmInfo’ does not name a type
     AlgorithmInfo* info() const;
     ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:75:41:
error: ‘vector’ has not been declared
     void computeImpl( const Mat& image, vector& keypoints, Mat& descriptors ) const;
                                         ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:75:47: error: expected ‘,’ or ‘...’ before ‘<’ token
     void computeImpl( const Mat& image, vector& keypoints, Mat& descriptors ) const;
                                               ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:76:40: error: ‘vector’ has not been declared
     void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const;
                                        ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h:76:46: error: expected ‘,’ or ‘...’ before ‘<’ token
     void detectImpl( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const;
                                              ^
In file included from /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/misc.cpp:51:0:
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:12:1: error: expected class-name before ‘{’ token
 {
 ^
In file included from /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/misc.cpp:51:0:
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:21:21: error: ‘AdjusterAdapter’ is not a member of ‘cv’
     virtual cv::Ptr clone() const;
                     ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:21:21: error: ‘AdjusterAdapter’ is not a member of ‘cv’
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:21:40: error: template argument 1 is invalid
     virtual cv::Ptr clone() const;
                                        ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:63:50: error: ‘AdjusterAdapter’ is not a member of ‘cv’
      VideoDynamicAdaptedFeatureDetector( cv::Ptr adjuster, int min_features=400, int max_features=500, int max_iters=5);
                                                  ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:63:50: error: ‘AdjusterAdapter’ is not a member of ‘cv’
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:63:69: error: template argument 1 is invalid
      VideoDynamicAdaptedFeatureDetector( cv::Ptr adjuster, int min_features=400, int max_features=500, int max_iters=5);
                                                                     ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:77:21: error: ‘AdjusterAdapter’ is not a member of ‘cv’
     mutable cv::Ptr adjuster_;
                     ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:77:21: error: ‘AdjusterAdapter’ is not a member of ‘cv’
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/feature_adjuster.h:77:40: error: template argument 1 is invalid
     mutable cv::Ptr adjuster_;
                                        ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp: In constructor ‘Node::Node(const cv::Mat&, const cv::Mat&, const cv::Mat&, const CameraInfoConstPtr&, myHeader, cv::Ptr, cv::Ptr)’:
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:151:65: error: no matching function for call to ‘SiftGPUWrapper::detect(cv::Mat&, std::vector&, std::vector&)’
     siftgpu->detect(gray_img, feature_locations_2d_, descriptors);
                                                                 ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:151:65: note: candidate is:
In file included from /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:32:0:
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:7: note: void SiftGPUWrapper::detect(const cv::Mat&, int) const
  void detect(const cv::Mat& image, cv::vector& keypoints, std::vector& descriptors, const cv::Mat& mask = cv::Mat()) const;
       ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:7: note:   candidate expects 2 arguments, 3 provided
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:170:67: error: no matching function for call to ‘SiftGPUWrapper::detect(cv::Mat&, std::vector&, std::vector&)’
       siftgpu->detect(gray_img, feature_locations_2d_, descriptors);
                                                                   ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:170:67: note: candidate is:
In file included from /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:32:0:
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:7: note: void SiftGPUWrapper::detect(const cv::Mat&, int) const
  void detect(const cv::Mat& image, cv::vector& keypoints, std::vector& descriptors, const cv::Mat& mask = cv::Mat()) const;
       ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:7: note:   candidate expects 2 arguments, 3 provided
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp: In constructor ‘Node::Node(cv::Mat, cv::Ptr, cv::Ptr, pcl::PointCloud::Ptr, cv::Mat)’:
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:283:65: error: no matching function for call to ‘SiftGPUWrapper::detect(cv::Mat&, std::vector&, std::vector&)’
     siftgpu->detect(gray_img, feature_locations_2d_, descriptors);
                                                                 ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:283:65: note: candidate is:
In file included from /home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/node.cpp:32:0:
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:7: note: void SiftGPUWrapper::detect(const cv::Mat&, int) const
  void detect(const cv::Mat& image, cv::vector& keypoints, std::vector& descriptors, const cv::Mat& mask = cv::Mat()) const;
       ^
/home/dzz/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h:49:7: note:   candidate expects 2 arguments, 3 provided
make[2]: *** [rgbdslam_v2-indigo/CMakeFiles/rgbdslam.dir/src/node.cpp.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [rgbdslam_v2-indigo/CMakeFiles/rgbdslam.dir/src/misc.cpp.o] 错误 1
make[1]: *** [rgbdslam_v2-indigo/CMakeFiles/rgbdslam.dir/all] 错误 2
make: *** [all] 错误 2
make: INTERNAL: Exiting with 9 jobserver tokens available; should be 8!
Invoking "make -j8 -l8" failed

dzz@dzz-Lenovo:~/rgbdslam_catkin_ws$


根据查找资料和报错,用以下方法解决,可能某些步骤不需要也能成功

1、在/rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/sift_gpu_wrapper.h中加入#include

2、在CmakeLists.txt中给定opencv2.4.9的build目录路径,即opencv2.4.9源码编译的build目录的路径。

    set(OpenCV_DIR /home/dzz/download/opencv-2.4.9/build)。这是我的路径,我的源码下载在了/home/dzz/download目录下

3、在rgbdslam_catkin_ws/src/rgbdslam_v2-indigo/src/aorb.h中的vector改为std::vector

4、通过修改bashrc文件来设置PKG_ CONFIG_PATH 和 LD_LIBRARY_PATH的路径来选择对应的opencv版

    在终端执行sudo gedit ~/.bashrc  

    在文件末尾加入

export PKG_CONFIG_PATH=/usr/local/opencv-2.4.9/lib/pkgconfig 

export LD_LIBRARY_PATH=/usr/local/opencv-2.4.9/lib

这两个路径为opencv2.4.9的安装路径


重点可能是第二步。

你可能感兴趣的:(rgbdslamv2在catkin_make时的错误代码)