Ubuntu16.04跑ORB_SLAM项目
所用显卡:GeForce RTX 2070
显卡驱动:NVIDIA-SMI 410.78
CUDA Version: 10.0
cudnn :7.5.0
查看CUDA版本:nvcc -V
cudnn版本:cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
查看显卡信息:nvidia-smi
安装caffe前的工作:Ubuntu16.04 Caffe 安装步骤
或者在参考caffe安装步骤
编译caffe前过程中会报一些错误:
1.Ubuntu16.04 编译 opencv 出现错误:Unsupported gpu architecture ‘compute_20’
可参考:参考
安装opencv2.4.11
可以参考
安装caffe两种方式:
make传统:
make all
make test
make runtest
cmake专业:
mkdir build
cd build
cmake ..
make all
make install
make runtest
编译caffe遇到问题及解决:
1.安装lmdb
sudo apt-get install libffi-dev python-dev build-essential
sudo pip install lmdb
pip(升级pip install --upgrade pip)之后
使用sudo pip install lmdb出错
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
这时打开了pip文件,修改
from pip import main
if __name__ == '__main__':
sys.exit(main())
为
from pip import __main__ //修改
if __name__ == '__main__':
sys.exit(__main__._main())//修改
cmake专业方法:
1.cmake …报错
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find LMDB (missing: LMDB_INCLUDE_DIR LMDB_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLMDB.cmake:19 (find_package_handle_standard_args)
cmake/Dependencies.cmake:60 (find_package)
CMakeLists.txt:49 (include)
操作:
sudo apt install libgflags-dev libgoogle-glog-dev liblmdb-dev -y
还是报错:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find LevelDB (missing: LevelDB_INCLUDE LevelDB_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindLevelDB.cmake:18 (find_package_handle_standard_args)
cmake/Dependencies.cmake:71 (find_package)
CMakeLists.txt:49 (include)
操作:
sudo apt install libgflags-dev libgoogle-glog-dev libleveldb-dev -y
3.报错:
Could NOT find Snappy
操作:
sudo apt-get install libsnappy-dev
2.make all时报错:
In file included from /home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/include/caffe/util/cudnn.hpp:8:0,
from /home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/include/caffe/util/device_alternate.hpp:40,
from /home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/include/caffe/common.hpp:19,
from /home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/src/caffe/util/bbox_util.cu:9:
/home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/include/caffe/proto/caffe.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/include/caffe/proto/caffe.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/include/caffe/proto/caffe.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^
CMake Error at cuda_compile_generated_bbox_util.cu.o.cmake:207 (message):
Error generating
/home/ckq/projects/ORB_SLAM2/Thirdparty/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_bbox_util.cu.o
由于我系统装的protoc装的版本是ptotoc2.6.1而项目用的是protoc2.5.0
所有要卸载2.6.1装2.5.0
查看自己的protoc版本:protoc --version
下载好后,安装:
./autogen.sh;
./configure;
make;
make check;
sudo make install;
sudo ldconfig;
4. make runtest报错
[ RUN ] DataLayerTest/2.TestReadCropTestLevelDB
[ OK ] DataLayerTest/2.TestReadCropTestLevelDB (8 ms)
[ RUN ] DataLayerTest/2.TestReshapeLMDB
*** Aborted at 1571406316 (unix time) try "date -d @1571406316" if you are using GNU date ***
PC: @ 0x7f5c3b99d8c1 caffe::Blob<>::Reshape()
*** SIGSEGV (@0x90) received by PID 25350 (TID 0x7f5c00e3f700) from PID 144; stack trace: ***
@ 0x7f5c3ad9b390 (unknown)
@ 0x7f5c3b99d8c1 caffe::Blob<>::Reshape()
@ 0x7f5c3b858c93 caffe::DataLayer<>::load_batch()
@ 0x7f5c3b94c0cb caffe::BasePrefetchingDataLayer<>::InternalThreadEntry()
@ 0x7f5c3b7c25e5 caffe::InternalThread::entry()
@ 0x7f5c3b7c350e boost::detail::thread_data<>::run()
@ 0x7f5c3b1d05d5 (unknown)
@ 0x7f5c3ad916ba start_thread
@ 0x7f5c3450241d clone
@ 0x0 (unknown)
Segmentation fault (core dumped)
src/caffe/test/CMakeFiles/runtest.dir/build.make:57: recipe for target 'src/caffe/test/CMakeFiles/runtest' failed
make[3]: *** [src/caffe/test/CMakeFiles/runtest] Error 139
CMakeFiles/Makefile2:360: recipe for target 'src/caffe/test/CMakeFiles/runtest.dir/all' failed
make[2]: *** [src/caffe/test/CMakeFiles/runtest.dir/all] Error 2
CMakeFiles/Makefile2:367: recipe for target 'src/caffe/test/CMakeFiles/runtest.dir/rule' failed
make[1]: *** [src/caffe/test/CMakeFiles/runtest.dir/rule] Error 2
Makefile:253: recipe for target 'runtest' failed
make: *** [runtest] Error 2
[ RUN ] DataLayerTest/2.TestReshapeLMDB
*** Aborted at 1571450231 (unix time) try "date -d @1571450231" if you are using GNU date ***
PC: @ 0x92b3bb boost::shared_ptr<>::reset<>()
*** SIGSEGV (@0x6ad) received by PID 6103 (TID 0x7ff871b51700) from PID 1709; stack trace: ***
@ 0x7ff8aa8d0390 (unknown)
@ 0x92b3bb boost::shared_ptr<>::reset<>()
@ 0x7ff8ab4d2b74 caffe::Blob<>::Reshape()
@ 0x7ff8ab38dc93 caffe::DataLayer<>::load_batch()
@ 0x7ff8ab4810cb caffe::BasePrefetchingDataLayer<>::InternalThreadEntry()
@ 0x7ff8ab2f75e5 caffe::InternalThread::entry()
@ 0x7ff8ab2f850e boost::detail::thread_data<>::run()
@ 0x7ff8aad055d5 (unknown)
@ 0x7ff8aa8c66ba start_thread
@ 0x7ff8a403741d clone
@ 0x0 (unknown)
Segmentation fault (core dumped)
src/caffe/test/CMakeFiles/runtest.dir/build.make:57: recipe for target 'src/caffe/test/CMakeFiles/runtest' failed
make[3]: *** [src/caffe/test/CMakeFiles/runtest] Error 139
CMakeFiles/Makefile2:360: recipe for target 'src/caffe/test/CMakeFiles/runtest.dir/all' failed
make[2]: *** [src/caffe/test/CMakeFiles/runtest.dir/all] Error 2
CMakeFiles/Makefile2:367: recipe for target 'src/caffe/test/CMakeFiles/runtest.dir/rule' failed
make[1]: *** [src/caffe/test/CMakeFiles/runtest.dir/rule] Error 2
Makefile:253: recipe for target 'runtest' failed
make: *** [runtest] Error 2
还未解决,貌似可以不跑!
传统make方法
编译caffe时,遇见boost函数undefined reference to `boost::xxxxxx
修改makefile文件,将需要的boost::xxxxxx库,加到LIBRARIES后面
例如:
.build_release/lib/libcaffe.so: undefined reference to `boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::put_mem_block(void*)'
.build_release/lib/libcaffe.so: undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
上面错误是 undefined reference没有将regex填入LIBRARIES 中
修改LIBRARIES ,将boost_regex加入进去
# We will also explicitly add stdc++ to the link target.
LIBRARIES += boost_regex boost_atomic boost_thread stdc++
1.错误:
ckq@ckq:~/projects/ORB_SLAM2/Thirdparty/caffe$ make runtest -j8
.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libcudart.so.10.0: cannot open shared object file: No such file or directory
Makefile:543: recipe for target 'runtest' failed
make: *** [runtest] Error 127
不行
sudo cp /usr/local/cuda-10.0/lib64/libcudart.so.10.0 /usr/local/lib/libcudart.so.10.0 && sudo ldconfig
sudo cp /usr/local/cuda-10.0/lib64/libcublas.so.10.0 /usr/local/lib/libcublas.so.10.0 && sudo ldconfig
sudo cp /usr/local/cuda-10.0/lib64/libcurand.so.10.0 /usr/local/lib/libcurand.so.10.0 && sudo ldconfig
sudo cp /usr/local/cuda-10.0/lib64/libcudnn.so.7 /usr/local/lib/libcudnn.so.7 && sudo ldconfig
报错信息如下:error while loading shared libraries: libcudart.so.10.0: cannot open shared object file: No such file or directory
解决方案:sudo ldconfig /usr/local/cuda/lib64
2.错误
/usr/bin/ld: warning: libcudnn.so.7, needed by ../Thirdparty/caffe/build/lib/libcaffe.so, not found (try using -rpath or -rpath-link)
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnPoolingForward@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnCreateLRNDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSetPooling2dDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnLRNCrossChannelForward@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSoftmaxBackward@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSetTensor4dDescriptorEx@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSetActivationDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnGetConvolutionForwardWorkspaceSize@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnDivisiveNormalizationBackward@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnPoolingBackward@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnDestroyActivationDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSetLRNDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSetStream@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnDestroyTensorDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSetFilter4dDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnDestroyPoolingDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnCreateActivationDescriptor@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnGetConvolutionBackwardDataAlgorithm@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnActivationForward@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnSoftmaxForward@libcudnn.so.7'
../Thirdparty/caffe/build/lib/libcaffe.so: undefined reference to `cudnnGetConvolutionBackwardDataWorkspaceSize@libcudnn.so.7'
修改
sudo cp /usr/local/cuda-10.0/lib64/libcudnn.so.7 /usr/local/lib/libcudnn.so.7 && sudo ldconfig
之后make runtest -j8
依旧出错:
[ RUN ] DataLayerTest/3.TestReshapeLMDB
*** Aborted at 1571472058 (unix time) try "date -d @1571472058" if you are using GNU date ***
PC: @ 0x7fe0f8fba5e1 caffe::Blob<>::Reshape()
*** SIGSEGV (@0x90) received by PID 6561 (TID 0x7fe0adfff700) from PID 144; stack trace: ***
@ 0x7fe0f848c390 (unknown)
@ 0x7fe0f8fba5e1 caffe::Blob<>::Reshape()
@ 0x7fe0f8e93859 caffe::DataLayer<>::load_batch()
@ 0x7fe0f8f6fdbf caffe::BasePrefetchingDataLayer<>::InternalThreadEntry()
@ 0x7fe0f8e01645 caffe::InternalThread::entry()
@ 0x7fe0f8e0256e boost::detail::thread_data<>::run()
@ 0x7fe0f9e705d5 (unknown)
@ 0x7fe0f84826ba start_thread
@ 0x7fe0f81b841d clone
@ 0x0 (unknown)
Makefile:543: recipe for target 'runtest' failed
make: *** [runtest] Segmentation fault (core dumped)
make runtest -j8
[----------] 12 tests from SGDSolverTest/2, where TypeParam = caffe::GPUDevice<float>
[ RUN ] SGDSolverTest/2.TestLeastSquaresUpdateWithWeightDecayMultiIter
F1020 19:45:51.637085 12090 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: HDF5Data (known types: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Clip, Concat, ContrastiveLoss, Convolution, Crop, Data, Deconvolution, DetectionEvaluate, DetectionOutput, Dropout, DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, Input, LRN, LSTM, LSTMUnit, Log, MVN, MaskOutputs, MemoryData, MultiBoxLoss, MultinomialLogisticLoss, Normalize, PReLU, Parameter, Permute, Pooling, Power, PriorBox, Python, RNN, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, SmoothL1Loss, Softmax, SoftmaxWithLoss, Split, Swish, TanH, Threshold, Tile, VideoData, WindowData)
*** Check failure stack trace: ***
@ 0x7f45dd92e5cd google::LogMessage::Fail()
@ 0x7f45dd930433 google::LogMessage::SendToLog()
@ 0x7f45dd92e15b google::LogMessage::Flush()
@ 0x7f45dd930e1e google::LogMessageFatal::~LogMessageFatal()
@ 0x7f45db202f9c caffe::Net<>::Init()
@ 0x7f45db20472e caffe::Net<>::Net()
@ 0x7f45db215db0 caffe::Solver<>::InitTrainNet()
@ 0x7f45db217285 caffe::Solver<>::Init()
@ 0x7f45db21759f caffe::Solver<>::Solver()
@ 0x5fd852 caffe::SGDSolverTest<>::InitSolver()
@ 0x5f30ab caffe::GradientBasedSolverTest<>::TestLeastSquaresUpdate()
@ 0x5f441c caffe::SGDSolverTest_TestLeastSquaresUpdateWithWeightDecayMultiIter_Test<>::TestBody()
@ 0x947413 testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x940a2a testing::Test::Run()
@ 0x940b78 testing::TestInfo::Run()
@ 0x940c55 testing::TestCase::Run()
@ 0x941f2f testing::internal::UnitTestImpl::RunAllTests()
@ 0x942253 testing::UnitTest::Run()
@ 0x46f3ad main
@ 0x7f45da4ff830 __libc_start_main
@ 0x477269 _start
@ (nil) (unknown)
Makefile:543: recipe for target 'runtest' failed
make: *** [runtest] Aborted (core dumped)
[----------] 12 tests from NesterovSolverTest/0, where TypeParam = caffe::CPUDevice<float>
[ RUN ] NesterovSolverTest/0.TestNesterovLeastSquaresUpdateLROneHundredth
[----------] 11 tests from AdaDeltaSolverTest/2, where TypeParam = caffe::GPUDevice<float>
[ RUN ] AdaDeltaSolverTest/2.TestAdaDeltaLeastSquaresUpdateWithWeightDecay
修改:
sudo gedit /etc/default/locale
添加:LC_ALL="en_US.UTF-8"
至始至终没改好
编译build-ros.sh脚本一直通不过,只好进入/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2自行编译
直接 :mkdir build
cd build
cmake ..
报错1:
CMake Error at CMakeLists.txt:2 (include):
include could not find load file:
/core/rosbuild/rosbuild.cmake
CMake Error at CMakeLists.txt:4 (rosbuild_init):
Unknown CMake command "rosbuild_init".
-- Configuring incomplete, errors occurred!
See also "/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
报错2:
[rosbuild] Building package ORB_SLAM2
[rosbuild] Error from directory check: /opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py /home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2
1
Traceback (most recent call last):
File "/opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in <module>
raise Exception
Exception
CMake Error at /opt/ros/kinetic/share/ros/core/rosbuild/private.cmake:102 (message):
[rosbuild] rospack found package "ORB_SLAM2" at "", but the current
directory is "/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2". You
should double-check your ROS_PACKAGE_PATH to ensure that packages are found
in the correct precedence order.
Call Stack (most recent call first):
/opt/ros/kinetic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
CMakeLists.txt:4 (rosbuild_init)
-- Configuring incomplete, errors occurred!
See also "/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build2/CMakeFiles/CMakeOutput.log".
解决:类似于超级连接的作用
sudo ln -s /home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2 /opt/ros/kinetic/share/ORB_SLAM2
项目中ros的编译:
自己安装好ros:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
卸载:
sudo apt-get remove ros-kinetic-desktop-full
sudo apt-get purge ros-*
sudo rm -rf /etc/ros
gedit ~/.bashrc
问题1
ros报错:
/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc: In member function ‘void ImageGrabber::GrabRGBD(const ImageConstPtr&, const ImageConstPtr&)’:
/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc:114:86: error: invalid use of member function (did you forget the ‘()’ ?)
h = "/home/ckq/Desktop/sematicData/gazebo/rgb"+msgRGB->header.stamp.toSec+".jpg
^
/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2/src/ros_rgbd.cc:115:84: error: invalid use of member function (did you forget the ‘()’ ?)
h = "/home/ckq/Desktop/sematicData/gazebo/depth"+msgD->header.stamp.toSec+".jpg
^
CMakeFiles/RGBD.dir/build.make:119: recipe for target 'CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o' failed
make[2]: *** [CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
修改:
string rgbPath = "/home/ckq/Desktop/sematicData/gazebo/rgb"+to_string(msgRGB->header.stamp.toSec())+".jpg";
string dPath = "/home/ckq/Desktop/sematicData/gazebo/depth"+to_string(msgD->header.stamp.toSec())+".jpg";
问题2:
报错:
make[2]: *** No rule to make target '../../../../Thirdparty/g2o/lib/libg2o.so', needed by '../RGBD'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 11%] Building CXX object CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o
make[2]: *** No rule to make target '../../../../Thirdparty/g2o/lib/libg2o.so', needed by '../Stereo'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 22%] Building CXX object CMakeFiles/Stereo.dir/src/ros_stereo.cc.o
make[2]: *** No rule to make target '../../../../Thirdparty/g2o/lib/libg2o.so', needed by '../Mono'. Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target '../../../../Thirdparty/g2o/lib/libg2o.so', needed by '../MonoAR'. Stop.
make[2]: *** Waiting for unfinished jobs....
修改:
复制一份libg2o.so到项目的g2o下(/home/ckq/projects/ORB_SLAM2/Thirdparty/g2o/lib) libg2o.so从原先一个orbslam2中复制得到,不知道是否有影响
问题3:
报错:
/usr/bin/ld: CMakeFiles/RGBD.dir/src/ros_rgbd.cc.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/RGBD.dir/build.make:214: recipe for target '../RGBD' failed
make[2]: *** [../RGBD] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/RGBD.dir/all' failed
make[1]: *** [CMakeFiles/RGBD.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: CMakeFiles/Stereo.dir/src/ros_stereo.cc.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/Stereo.dir/build.make:214: recipe for target '../Stereo' failed
make[2]: *** [../Stereo] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/Stereo.dir/all' failed
make[1]: *** [CMakeFiles/Stereo.dir/all] Error 2
[ 55%] Built target Mono
[ 77%] Built target MonoAR
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
修改:
将libboost_system.so,libboost_system.so.1.58.0
和libboost_filesystem.so,libboost_filesystem.so.1.58.0
复制到ORB_SLAM2/lib下,
在/home/ckq/projects/ORB_SLAM2/Examples/ROS/ORB_SLAM2/CMakeLists.txt下添加
${PROJECT_SOURCE_DIR}/../../../lib/libboost_filesystem.so
${PROJECT_SOURCE_DIR}/../../../lib/libboost_system.so