weixin_39624389
weixin_39624389
2020-11-21 01:44

Build failed on segmatch:make

Working on a fresh workspace (Lunar Loggerhead, though I did have a Kinetic workspace too first).

I'm pretty new to ROS and catkin builds so might have made some mistake but can't figure this out right now.
There was quite a lot of warnings, but these are the parts with actual errors (and the summary from end and catkin config output)):


Errors     << segmatch:make /home/graerth/new_ws/logs/segmatch/build.make.000.log                                         
In file included from /home/graerth/new_ws/devel/include/pointmatcher/PointMatcher.h:62:0,
                 from /home/graerth/new_ws/src/laser_slam/laser_slam/include/laser_slam/common.hpp:10,
                 from /home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/common.hpp:12,
                 from /home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/segmented_cloud.hpp:15,
                 from /home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/descriptors/descriptors.hpp:9,
                 from /home/graerth/new_ws/src/segmatch/segmatch/src/descriptors/descriptors.cpp:1:
/home/graerth/new_ws/devel/include/pointmatcher/Parametrizable.h:46:0: warning: "BOOST_ASSIGN_MAX_PARAMS" redefined
 #define BOOST_ASSIGN_MAX_PARAMS 6
 ^
In file included from /home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:1:0:
/home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/opencv_random_forest.hpp:47:3: error: ‘CvRTrees’ does not name a type
   CvRTrees rtrees_;
   ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp: In constructor ‘segmatch::OpenCvRandomForest::OpenCvRandomForest(const segmatch::ClassifierParams&)’:
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:24:3: error: ‘rtrees_’ was not declared in this scope
   rtrees_.load(params.classifier_filename.c_str());
   ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp: In member function ‘void segmatch::OpenCvRandomForest::resetParams(const segmatch::ClassifierParams&)’:
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:52:3: error: ‘rtrees_’ was not declared in this scope
   rtrees_.load(params.classifier_filename.c_str());
   ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp: In member function ‘segmatch::PairwiseMatches segmatch::OpenCvRandomForest::findCandidates(const segmatch::SegmentedCloud&, segmatch::PairwiseMatches*)’:
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:266:36: error: ‘rtrees_’ was not declared in this scope
           const float confidence = rtrees_.predict_prob(features);
                                    ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:315:34: error: ‘rtrees_’ was not declared in this scope
         const float confidence = rtrees_.predict_prob(features);
                                  ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp: In member function ‘void segmatch::OpenCvRandomForest::train(const MatrixXd&, const MatrixXd&)’:
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:350:65: warning: narrowing conversion of ‘((segmatch::OpenCvRandomForest*)this)->segmatch::OpenCvRandomForest::params_.segmatch::ClassifierParams::rf_priors.std::vector<_tp _alloc>::operator[]<double std::allocator> >(0ul)’ from ‘__gnu_cxx::__alloc_traits<:allocator> >::value_type {aka double}’ to ‘float’ inside { } [-Wnarrowing]
   float priors[] = { params_.rf_priors[0], params_.rf_priors[1] };
                                                                 ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:350:65: warning: narrowing conversion of ‘((segmatch::OpenCvRandomForest*)this)->segmatch::OpenCvRandomForest::params_.segmatch::ClassifierParams::rf_priors.std::vector<_tp _alloc>::operator[]<double std::allocator> >(1ul)’ from ‘__gnu_cxx::__alloc_traits<:allocator> >::value_type {aka double}’ to ‘float’ inside { } [-Wnarrowing]
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:353:3: error: ‘CvRTParams’ was not declared in this scope
   CvRTParams rtrees_params = CvRTParams(
   ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:361:3: error: ‘rtrees_’ was not declared in this scope
   rtrees_.train(opencv_features, CV_ROW_SAMPLE, opencv_labels, cv::Mat(),
   ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:361:34: error: ‘CV_ROW_SAMPLE’ was not declared in this scope
   rtrees_.train(opencv_features, CV_ROW_SAMPLE, opencv_labels, cv::Mat(),
                                  ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:362:50: error: ‘rtrees_params’ was not declared in this scope
                 cv::Mat(), cv::Mat(), cv::Mat(), rtrees_params);
                                                  ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp: In member function ‘void segmatch::OpenCvRandomForest::test(const MatrixXd&, const MatrixXd&, Eigen::MatrixXd*) const’:
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:403:28: error: ‘rtrees_’ was not declared in this scope
       double probability = rtrees_.predict_prob(opencv_sample);
                            ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp: In member function ‘void segmatch::OpenCvRandomForest::save(const string&) const’:
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:429:3: error: ‘rtrees_’ was not declared in this scope
   rtrees_.save(filename.c_str());
   ^
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp: In member function ‘void segmatch::OpenCvRandomForest::load(const string&)’:
/home/graerth/new_ws/src/segmatch/segmatch/src/opencv_random_forest.cpp:434:3: error: ‘rtrees_’ was not declared in this scope
   rtrees_.load(filename.c_str());
   ^
In file included from /home/graerth/new_ws/devel/include/pointmatcher/PointMatcher.h:62:0,
                 from /home/graerth/new_ws/src/laser_slam/laser_slam/include/laser_slam/common.hpp:10,
                 from /home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/segmatch.hpp:8,
                 from /home/graerth/new_ws/src/segmatch/segmatch/src/segmatch.cpp:1:
/home/graerth/new_ws/devel/include/pointmatcher/Parametrizable.h:46:0: warning: "BOOST_ASSIGN_MAX_PARAMS" redefined
 #define BOOST_ASSIGN_MAX_PARAMS 6
 ^
In file included from /home/graerth/new_ws/devel/include/gtsam/nonlinear/NonlinearFactor.h:30:0,
                 from /home/graerth/new_ws/devel/include/gtsam/nonlinear/ExpressionFactor.h:23,
                 from /home/graerth/new_ws/src/laser_slam/laser_slam/include/laser_slam/common.hpp:7,
                 from /home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/segmatch.hpp:8,
                 from /home/graerth/new_ws/src/segmatch/segmatch/src/segmatch.cpp:1:
/usr/include/boost/assign/list_of.hpp:378:0: note: this is the location of the previous definition
 #define BOOST_ASSIGN_MAX_PARAMS 5
 ^
In file included from /home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/segmatch.hpp:16:0,
                 from /home/graerth/new_ws/src/segmatch/segmatch/src/segmatch.cpp:1:
/home/graerth/new_ws/src/segmatch/segmatch/include/segmatch/opencv_random_forest.hpp:47:3: error: ‘CvRTrees’ does not name a type
   CvRTrees rtrees_;
   ^
make[2]: *** [CMakeFiles/segmatch.dir/src/opencv_random_forest.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/segmatch.dir/src/segmatch.cpp.o] Error 1
make[1]: *** [CMakeFiles/segmatch.dir/all] Error 2
make: *** [all] Error 2
cd /home/graerth/new_ws/build/segmatch; catkin build --get-env segmatch | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
..........................................................................................................................
Failed     << segmatch:make                        [ Exited with code 2 ]                                                 
Failed    <<< segmatch                             [ 2 minutes and 43.8 seconds ]                                         
Abandoned <<< segmatch_ros                         [ Unrelated job failed ]                                               
Abandoned <<< laser_mapper                         [ Unrelated job failed ]                                               
[build] Summary: 17 of 20 packages succeeded.                                                                             
[build]   Ignored:   10 packages were skipped or are blacklisted.                                                         
[build]   Warnings:  9 packages succeeded with warnings.                                                                  
[build]   Abandoned: 2 packages were abandoned.                                                                           
[build]   Failed:    1 packages failed.                                                                                   
[build] Runtime: 1 hour 21 minutes and 24.9 seconds total.                                                                
graerth-K30BF-M32BF-A-F-K31BF-6:~/new_ws$ catkin config
---------------------------------------------------------
Profile:                     default
Extending:          [cached] /opt/ros/lunar
Workspace:                   /home/graerth/new_ws
---------------------------------------------------------
Source Space:       [exists] /home/graerth/new_ws/src
Log Space:          [exists] /home/graerth/new_ws/logs
Build Space:        [exists] /home/graerth/new_ws/build
Devel Space:        [exists] /home/graerth/new_ws/devel
Install Space:      [unused] /home/graerth/new_ws/install
DESTDIR:            [unused] None
---------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
---------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
---------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
---------------------------------------------------------
Workspace configuration appears valid.
---------------------------------------------------------

</:allocator></double></_tp></:allocator></double></_tp>

Anyone got ideas what's the problem?

该提问来源于开源项目:ethz-asl/segmap

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39632524 weixin_39632524 5月前

    Hi ,

    The main maintainer () is currently travelling, I'll try my best with a couple of hints :) - What version of OpenCV are you using? It seems like CvRTree disappeared with OpenCV 3 (or to be more precise, it is still present in opencv/apps/traincascade/old_ml.hpp). On my computer (Ubuntu 16.04) I currently have OpenCV 2.4, can you try using that version? Otherwise you can dig in the code in order to use the old_ml.hpp header. - Officially only Ubuntu 14.04 and ROS Indigo are supported. In practice I'm currently working without problems on 16.04 & Kinetic. Is it possible for you to use one of these versions? has the final word, but I don't think we are going to upgrade to a non-LTS version.

    I hope this helps! :) Keep us updated!

    点赞 评论 复制链接分享
  • weixin_39600823 weixin_39600823 5月前

    Hi ,

    I followed this installation procedude for OpenCV2 and now it compiled. Thanks! https://gist.github.com/arthurbeggs/06df46af94af7f261513934e56103b30

    点赞 评论 复制链接分享
  • weixin_39632524 weixin_39632524 5月前

    Cool, thanks for the link!

    maybe you want to add it to the instructions on the wiki?

    点赞 评论 复制链接分享
  • weixin_39869378 weixin_39869378 5月前

    Hey, If you have ROS Kinetic and you don't want to perform a system-wide install of OpenCV 2.4.x, you can set CMAKE_INSTALL_PREFIX to point to another folder in your system.

    In my case I first declare the OpenCV 2.4.x install path as an environment variable in ~/.bashrc:

    
    export OPENCV2_INSTALL_DIR=/path/to/OpenCV2/lib
    

    I clone the latest version of OpenCV 2.4.x:

    
    git clone https://github.com/opencv/opencv.git OpenCV2 --depth=1 -b 2.4
    

    And then I build, by running:

    
    cd OpenCV2
    mkdir build
    cd build
    
    cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=$OPENCV2_INSTALL_DIR \
        -DBUILD_PNG=OFF \
        -DBUILD_TIFF=OFF \
        -DBUILD_TBB=OFF \
        -DBUILD_JPEG=OFF \
        -DBUILD_JASPER=OFF \
        -DBUILD_ZLIB=OFF \
        -DBUILD_EXAMPLES=ON \
        -DBUILD_opencv_java=OFF \
        -DBUILD_opencv_nonfree=OFF \
        -DBUILD_opencv_python=ON \
        -DWITH_OPENCL=OFF \
        -DWITH_OPENMP=OFF \
        -DWITH_FFMPEG=ON \
        -DWITH_GSTREAMER=OFF \
        -DWITH_GSTREAMER_0_10=OFF \
        -DWITH_CUDA=OFF \
        -DWITH_GTK=ON \
        -DWITH_VTK=OFF \
        -DWITH_TBB=ON \
        -DWITH_1394=OFF \
        -DWITH_OPENEXR=OFF \
        -DINSTALL_C_EXAMPLES=ON \
        -DINSTALL_TESTS=OFF \
        ../
    
    make -j$(nproc)
    sudo make install
    

    Finally, in all CMakeLists.txt files that attempt to import OpenCV (and specifically need version 2.4.x), I replace find_package(OpenCV REQUIRED) with:

    
    set(OpenCV_DIR  $ENV{OPENCV2_INSTALL_DIR})
    find_package(OpenCV 2 REQUIRED)
    
    点赞 评论 复制链接分享
  • weixin_39994665 weixin_39994665 5月前

    Thanks for your input! :-)

    点赞 评论 复制链接分享