Maplab是一个开源的vSLAM项目。
按照github上的指导执行,执行编译命令catkin build maplab,直接报错。
(最开始报的是catkin_simple的错误,后来在结局问题过程中想做记录的时候,报的错就是aslam_cv相关的错误了。)
Errors << maplab_common:cmake /home/swing/maplab_ws/logs/maplab_common/build.cmake.006.log
CMake Error at /home/swing/maplab_ws/devel/share/catkin_simple/cmake/catkin_simple-extras.cmake:38 (find_package):
By not providing "Findaslam_cv_common.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "aslam_cv_common", but CMake did not find one.
not find a package configuration file provided by "aslam_cv_common"
with any of the following names:
aslam_cv_commonConfig.cmake
aslam_cv_common-config.cmake
Add the installation prefix of "aslam_cv_common" to CMAKE_PREFIX_PATH or set "aslam_cv_common_DIR" to a directory containing one of the above files.
If "aslam_cv_common" provides a separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:5 (catkin_simple)
在网络上查解决问题的方法,都没有查到。
在maplab_dependencies目录里面,是可以找到catkin_simple的。尝试把catkin_simple复制到maplab_ws/src目录下(和maplab源码同一级目录)。
再执行catkin build maplab,catkin_simple问题消失,又报hand_eye_calibration的错误。
把hand_eye_calibration复制进去,hand_eye_calibration的错误消失,又报aslam相关错误。
再检查maplab_dependencies,发现下面子目录都有了,但是里面的文件都不存在。maplab_dependencies是通过github网页以zip方式下载下来的。重试几次之后,发现文件都没有下载下来。
在办公机器windows系统上,重新通过git命令行下载,然后复制到ubuntu系统下编译,发现读取xml文件出错。检查之后发现,是公司的加密系统对文件加了密。只好在Ubuntu下直接用git命令下载,但是速度很慢,很慢。
Errors << protobuf_catkin:make /home/swing/maplab_ws/logs/protobuf_catkin/build.make.002.log
- 没有安装autoconf工具
autoreconf -f -i -Wall,no-obsolete
./autogen.sh: 38: ./autogen.sh: autoreconf: not found
- 下载问题
国内下载github速度太慢,以及墙的问题,会导致make过程失败。
参考这篇文章:Maplab编译安装,可以把源码下载之后放到对应目录。
下载https://github.com/opencv/opencv_contrib/3.2.0.zip放到
~/maplab_ws/build/opencv3_catkin/opencv3_contrib-prefix/src目录下,并命名为3.2.0.zip。下载https://github.com/Itseez/opencv/archive/3.2.0.zip并放到
~/maplab_ws/build/opencv3_catkin/opencv3_src-prefix/src目录下并命名为3.2.0.zip。下载https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz并放到
~/maplab_ws/build/protobuf_catkin/protobuf_src-prefix/src并命名为protobuf-2.6.1.tar.gz。把下面几句话添加到
~/maplab_ws/build/protobuf_catkin/protobuf_src-prefix/src/protobuf_src-stamp/download-protobuf_src.cmake最上面。
opencv和opencv_contrib库类似。ceres
ceres编译过程中,在ceres_src-stamp目录下,不会生成download-ceres_src.cmake文件,所以处理要稍有不同。
修改文件:~/maplab_ws/src/maplab_dependencies/3rdparty/ceres_catkin/CMakeLists.txt
把这一行中的库地址:
GIT_REPOSITORY https://ceres-solver.googlesource.com/ceres-solver
改成:
GIT_REPOSITORY https://github.com/ceres-solver/ceres-solver
还没有结束,这里下载的是最新版本,如果直接使用,会报错,
/home/swing/maplab_ws/src/maplab/algorithms/map-optimization-legacy/src/test/6dof-pose-graph-gen.cc:628:11: error: ‘struct ceres::Solver::Options’ has no member named ‘num_linear_solver_threads’
options.num_linear_solver_threads = 8;
ceres版本不一致,下载的ceres版本是最新的,num_linear_solver_threads这个字段已经没有了。
把文件中的
set(CERES_TAG 0352a521a654a29257077679c5a7ec9c35f45c7e) #version 1.12
改成:
set(CERES_TAG 029799d757b4ed2be5af64899178928f18cb6e28) #github version 1.12.0
编译过程中,可能还会出错,可以采用以下方法。
把源码下载后,直接放到以下目录:
~/maplab_ws/build/ceres_catkin/ceres_src-prefix/src/ceres_src。
在文件
~/maplab_ws/build/ceres_catkin/ceres_src-prefix/tmp/ceres_src-gitclone.cmake
最上面增加:
if(EXISTS "~/maplab_ws/build/ceres_catkin/ceres_src-prefix/src/ceres_src" )
return()
endif()
- opencv3中ippicv的downloader.cmake找不到
CMake Error at cmake/OpenCVFindIPP.cmake:243 (include):
include could not find load file:
/home/swing/maplab_ws/build/opencv3_catkin/opencv3_src/3rdparty/ippicv/downloader.cmake
Call Stack (most recent call first):
cmake/OpenCVFindLibsPerf.cmake:37 (include)
CMakeLists.txt:558 (include)
这个问题,可能是编译过程中下载失败后引起的,可以从opencv-3.2.0.zip中解压后复制到对应目录。
- 由于@符号导致下载的目录为空
maplab/aslam_cv2
maplab/tools/maplab_test_data
maplab_dependencies/3rdparty
maplab_dependencies/internal
前面已经提到,github上的目录带@符号,导致git命令行下载的目录为空,可以通过网页下载后复制到对应的目录。
最后编译结果:
............................................................................................................................................................................................................
Finished <<< rovioli [ 3 minutes and 2.7 seconds ]
[build] Summary: All 91 packages succeeded!
[build] Ignored: 14 packages were skipped or are blacklisted.
[build] Warnings: 12 packages succeeded with warnings.
[build] Abandoned: None.
[build] Failed: None.
[build] Runtime: 43 minutes and 35.5 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.